/* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ typedef signed char __s8; typedef unsigned char __u8; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef unsigned long long __u64; typedef unsigned char u8; typedef unsigned short u16; typedef int s32; typedef unsigned int u32; typedef long long s64; typedef unsigned long long u64; typedef long __kernel_long_t; typedef unsigned long __kernel_ulong_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 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 __u16 __be16; typedef __u32 __be32; typedef __u64 __be64; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef unsigned short umode_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 unsigned char u_char; typedef unsigned long u_long; 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 unsigned int gfp_t; typedef unsigned int fmode_t; typedef unsigned int oom_flags_t; typedef u64 phys_addr_t; typedef phys_addr_t resource_size_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 callback_head { struct callback_head *next ; void (*func)(struct callback_head * ) ; }; struct class; struct device; struct completion; struct gendisk; struct module; struct mutex; struct request_queue; typedef u16 __ticket_t; typedef u32 __ticketpair_t; struct __raw_tickets { __ticket_t head ; __ticket_t tail ; }; union __anonunion____missing_field_name_8 { __ticketpair_t head_tail ; struct __raw_tickets tickets ; }; struct arch_spinlock { union __anonunion____missing_field_name_8 __annonCompField4 ; }; typedef struct arch_spinlock arch_spinlock_t; struct qrwlock { atomic_t cnts ; arch_spinlock_t lock ; }; typedef struct qrwlock arch_rwlock_t; struct task_struct; struct lockdep_map; 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____missing_field_name_10 { unsigned int a ; unsigned int b ; }; struct __anonstruct____missing_field_name_11 { 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____missing_field_name_9 { struct __anonstruct____missing_field_name_10 __annonCompField5 ; struct __anonstruct____missing_field_name_11 __annonCompField6 ; }; struct desc_struct { union __anonunion____missing_field_name_9 __annonCompField7 ; }; typedef unsigned long pteval_t; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct __anonstruct_pte_t_12 { pteval_t pte ; }; typedef struct __anonstruct_pte_t_12 pte_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_13 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_13 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct mm_struct; struct cpumask; struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 18 ; unsigned char flags ; }; struct file_operations; 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____missing_field_name_16 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion____missing_field_name_16 __annonCompField8 ; }; struct cpumask { unsigned long bits[128U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; 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____missing_field_name_21 { u64 rip ; u64 rdp ; }; struct __anonstruct____missing_field_name_22 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion____missing_field_name_20 { struct __anonstruct____missing_field_name_21 __annonCompField12 ; struct __anonstruct____missing_field_name_22 __annonCompField13 ; }; union __anonunion____missing_field_name_23 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion____missing_field_name_20 __annonCompField14 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion____missing_field_name_23 __annonCompField15 ; }; 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 lwp_struct { u8 reserved[128U] ; }; struct bndreg { u64 lower_bound ; u64 upper_bound ; }; struct bndcsr { u64 bndcfgu ; u64 bndstatus ; }; struct xsave_hdr_struct { u64 xstate_bv ; u64 xcomp_bv ; u64 reserved[6U] ; }; struct xsave_struct { struct i387_fxsave_struct i387 ; struct xsave_hdr_struct xsave_hdr ; struct ymmh_struct ymmh ; struct lwp_struct lwp ; struct bndreg bndreg[4U] ; struct bndcsr bndcsr ; }; 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 ; unsigned char fpu_counter ; }; 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 ; }; 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 : 1 ; unsigned char hardirqs_off : 1 ; unsigned short references : 12 ; }; 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____missing_field_name_27 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion____missing_field_name_26 { struct raw_spinlock rlock ; struct __anonstruct____missing_field_name_27 __annonCompField17 ; }; struct spinlock { union __anonunion____missing_field_name_26 __annonCompField18 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_28 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_28 rwlock_t; struct optimistic_spin_queue { atomic_t tail ; }; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; 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_30 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_31 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_32 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion____missing_field_name_29 { struct __anonstruct_futex_30 futex ; struct __anonstruct_nanosleep_31 nanosleep ; struct __anonstruct_poll_32 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion____missing_field_name_29 __annonCompField19 ; }; struct seqcount { unsigned int sequence ; struct lockdep_map dep_map ; }; typedef struct seqcount seqcount_t; struct __anonstruct_seqlock_t_45 { struct seqcount seqcount ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_45 seqlock_t; 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 notifier_block; union __anonunion____missing_field_name_46 { unsigned long bitmap[4U] ; struct callback_head callback_head ; }; struct idr_layer { int prefix ; int layer ; struct idr_layer *ary[256U] ; int count ; union __anonunion____missing_field_name_46 __annonCompField20 ; }; struct idr { struct idr_layer *hint ; struct idr_layer *top ; int layers ; int cur ; spinlock_t lock ; int id_free_cnt ; struct idr_layer *id_free ; }; struct ida_bitmap { long nr_busy ; unsigned long bitmap[15U] ; }; struct ida { struct idr idr ; struct ida_bitmap *free_bitmap ; }; 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 dentry; struct iattr; struct vm_area_struct; struct super_block; struct file_system_type; struct kernfs_open_node; struct kernfs_iattrs; struct kernfs_root; struct kernfs_elem_dir { unsigned long subdirs ; struct rb_root children ; struct kernfs_root *root ; }; struct kernfs_node; struct kernfs_elem_symlink { struct kernfs_node *target_kn ; }; struct kernfs_ops; struct kernfs_elem_attr { struct kernfs_ops const *ops ; struct kernfs_open_node *open ; loff_t size ; struct kernfs_node *notify_next ; }; union __anonunion____missing_field_name_47 { struct kernfs_elem_dir dir ; struct kernfs_elem_symlink symlink ; struct kernfs_elem_attr attr ; }; struct kernfs_node { atomic_t count ; atomic_t active ; struct lockdep_map dep_map ; struct kernfs_node *parent ; char const *name ; struct rb_node rb ; void const *ns ; unsigned int hash ; union __anonunion____missing_field_name_47 __annonCompField21 ; void *priv ; unsigned short flags ; umode_t mode ; unsigned int ino ; struct kernfs_iattrs *iattr ; }; struct kernfs_syscall_ops { int (*remount_fs)(struct kernfs_root * , int * , char * ) ; int (*show_options)(struct seq_file * , struct kernfs_root * ) ; int (*mkdir)(struct kernfs_node * , char const * , umode_t ) ; int (*rmdir)(struct kernfs_node * ) ; int (*rename)(struct kernfs_node * , struct kernfs_node * , char const * ) ; }; struct kernfs_root { struct kernfs_node *kn ; unsigned int flags ; struct ida ino_ida ; struct kernfs_syscall_ops *syscall_ops ; struct list_head supers ; wait_queue_head_t deactivate_waitq ; }; struct vm_operations_struct; struct kernfs_open_file { struct kernfs_node *kn ; struct file *file ; void *priv ; struct mutex mutex ; int event ; struct list_head list ; char *prealloc_buf ; size_t atomic_write_len ; bool mmapped ; struct vm_operations_struct const *vm_ops ; }; struct kernfs_ops { int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; ssize_t (*read)(struct kernfs_open_file * , char * , size_t , loff_t ) ; size_t atomic_write_len ; bool prealloc ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; int (*mmap)(struct kernfs_open_file * , struct vm_area_struct * ) ; struct lock_class_key lockdep_key ; }; struct sock; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; bool (*current_may_mount)(void) ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; struct __anonstruct_kuid_t_48 { uid_t val ; }; typedef struct __anonstruct_kuid_t_48 kuid_t; struct __anonstruct_kgid_t_49 { gid_t val ; }; typedef struct __anonstruct_kgid_t_49 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 bin_attribute; 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 **bin_attrs ; }; struct bin_attribute { struct attribute attr ; size_t size ; void *private ; ssize_t (*read)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; ssize_t (*write)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; int (*mmap)(struct file * , struct kobject * , struct bin_attribute * , struct vm_area_struct * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; }; struct kref { atomic_t refcount ; }; 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 workqueue_struct; 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 workqueue_struct *wq ; int cpu ; }; 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 kernfs_node *sd ; struct kref kref ; struct delayed_work release ; 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 *argv[3U] ; 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 inode; struct cdev { struct kobject kobj ; struct module *owner ; struct file_operations const *ops ; struct list_head list ; dev_t dev ; unsigned int count ; }; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct __anonstruct_nodemask_t_50 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_50 nodemask_t; struct path; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; size_t pad_until ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; struct user_namespace *user_ns ; 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 pinctrl; struct pinctrl_state; struct dev_pin_info { struct pinctrl *p ; struct pinctrl_state *default_state ; struct pinctrl_state *sleep_state ; struct pinctrl_state *idle_state ; }; 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 list_head clock_list ; }; struct dev_pm_qos; 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 is_noirq_suspended ; bool is_late_suspended ; bool ignore_children ; bool early_init ; bool direct_complete ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path ; bool syscore ; 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 ; unsigned char memalloc_noio : 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 pm_subsys_data *subsys_data ; void (*set_latency_tolerance)(struct device * , s32 ) ; struct dev_pm_qos *qos ; }; struct dev_pm_domain { struct dev_pm_ops ops ; void (*detach)(struct device * , bool ) ; }; struct rw_semaphore; struct rw_semaphore { long count ; struct list_head wait_list ; raw_spinlock_t wait_lock ; struct optimistic_spin_queue osq ; struct task_struct *owner ; struct lockdep_map dep_map ; }; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct __anonstruct_mm_context_t_115 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; atomic_t perf_rdpmc_allowed ; }; typedef struct __anonstruct_mm_context_t_115 mm_context_t; struct bio_vec; struct device_node; struct llist_node; struct llist_node { struct llist_node *next ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct subsys_private; struct bus_type; struct iommu_ops; struct iommu_group; struct device_attribute; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct device_attribute *dev_attrs ; struct attribute_group const **bus_groups ; struct attribute_group const **dev_groups ; struct attribute_group const **drv_groups ; 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 (*online)(struct device * ) ; int (*offline)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct iommu_ops const *iommu_ops ; struct subsys_private *p ; struct lock_class_key lock_key ; }; struct device_type; struct of_device_id; struct acpi_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 ; struct acpi_device_id const *acpi_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 class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct attribute_group const **dev_groups ; 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 ) ; }; 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 * , kuid_t * , kgid_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 acpi_device; struct acpi_dev_node { struct acpi_device *companion ; }; struct dma_coherent_mem; struct cma; 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 ; void *driver_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; struct dev_pin_info *pins ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; unsigned long dma_pfn_offset ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct cma *cma_area ; struct dev_archdata archdata ; struct device_node *of_node ; struct acpi_dev_node acpi_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 iommu_group *iommu_group ; bool offline_disabled ; bool offline ; }; 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 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 __anonstruct____missing_field_name_143 { spinlock_t lock ; int count ; }; union __anonunion____missing_field_name_142 { struct __anonstruct____missing_field_name_143 __annonCompField32 ; }; struct lockref { union __anonunion____missing_field_name_142 __annonCompField33 ; }; struct vfsmount; struct __anonstruct____missing_field_name_145 { u32 hash ; u32 len ; }; union __anonunion____missing_field_name_144 { struct __anonstruct____missing_field_name_145 __annonCompField34 ; u64 hash_len ; }; struct qstr { union __anonunion____missing_field_name_144 __annonCompField35 ; unsigned char const *name ; }; struct dentry_operations; union __anonunion_d_u_146 { struct hlist_node d_alias ; struct callback_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] ; struct lockref d_lockref ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; struct list_head d_child ; struct list_head d_subdirs ; union __anonunion_d_u_146 d_u ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_weak_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct dentry 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 mem_cgroup; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; int nid ; struct mem_cgroup *memcg ; }; struct shrinker { unsigned long (*count_objects)(struct shrinker * , struct shrink_control * ) ; unsigned long (*scan_objects)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; unsigned long flags ; struct list_head list ; atomic_long_t *nr_deferred ; }; struct list_lru_one { struct list_head list ; long nr_items ; }; struct list_lru_memcg { struct list_lru_one *lru[0U] ; }; struct list_lru_node { spinlock_t lock ; struct list_lru_one lru ; struct list_lru_memcg *memcg_lrus ; }; struct list_lru { struct list_lru_node *node ; struct list_head list ; }; struct __anonstruct____missing_field_name_148 { struct radix_tree_node *parent ; void *private_data ; }; union __anonunion____missing_field_name_147 { struct __anonstruct____missing_field_name_148 __annonCompField36 ; struct callback_head callback_head ; }; struct radix_tree_node { unsigned int path ; unsigned int count ; union __anonunion____missing_field_name_147 __annonCompField37 ; struct list_head private_list ; void *slots[64U] ; unsigned long tags[3U][1U] ; }; 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 callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; 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 block_device; struct io_context; struct bio_vec { struct page *bv_page ; unsigned int bv_len ; unsigned int bv_offset ; }; struct backing_dev_info; struct export_operations; struct iovec; struct nameidata; struct kiocb; struct pipe_inode_info; struct poll_table_struct; struct kstatfs; struct cred; struct swap_info_struct; struct iov_iter; struct vm_fault; 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 percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; 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 fs_qfilestatv { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; __u32 qfs_pad ; }; struct fs_quota_statv { __s8 qs_version ; __u8 qs_pad1 ; __u16 qs_flags ; __u32 qs_incoredqs ; struct fs_qfilestatv qs_uquota ; struct fs_qfilestatv qs_gquota ; struct fs_qfilestatv qs_pquota ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; __u64 qs_pad2[8U] ; }; struct dquot; typedef __kernel_uid32_t projid_t; struct __anonstruct_kprojid_t_151 { projid_t val ; }; typedef struct __anonstruct_kprojid_t_151 kprojid_t; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion____missing_field_name_152 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion____missing_field_name_152 __annonCompField39 ; enum quota_type type ; }; 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_max_spc_limit ; qsize_t dqi_max_ino_limit ; 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 ; struct kqid dq_id ; loff_t dq_off ; unsigned long dq_flags ; 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 qc_dqblk { int d_fieldmask ; u64 d_spc_hardlimit ; u64 d_spc_softlimit ; u64 d_ino_hardlimit ; u64 d_ino_softlimit ; u64 d_space ; u64 d_ino_count ; s64 d_ino_timer ; s64 d_spc_timer ; int d_ino_warns ; int d_spc_warns ; u64 d_rt_spc_hardlimit ; u64 d_rt_spc_softlimit ; u64 d_rt_space ; s64 d_rt_spc_timer ; int d_rt_spc_warns ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_enable)(struct super_block * , unsigned int ) ; int (*quota_disable)(struct super_block * , unsigned int ) ; int (*quota_sync)(struct super_block * , 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 * , struct kqid , struct qc_dqblk * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct qc_dqblk * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*get_xstatev)(struct super_block * , struct fs_quota_statv * ) ; int (*rm_xquota)(struct super_block * , unsigned 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 inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; struct address_space; struct writeback_control; 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 int , unsigned int ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iov_iter * , loff_t ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , unsigned long , unsigned long ) ; void (*is_dirty_writeback)(struct page * , bool * , bool * ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; int (*swap_activate)(struct swap_info_struct * , struct file * , sector_t * ) ; void (*swap_deactivate)(struct file * ) ; }; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; atomic_t i_mmap_writable ; struct rb_root i_mmap ; struct rw_semaphore i_mmap_rwsem ; unsigned long nrpages ; unsigned long nrshadows ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; spinlock_t private_lock ; struct list_head private_list ; void *private_data ; }; struct hd_struct; 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____missing_field_name_155 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion____missing_field_name_156 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock_context; union __anonunion____missing_field_name_157 { 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____missing_field_name_155 __annonCompField40 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; 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____missing_field_name_156 __annonCompField41 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; atomic_t i_readcount ; struct file_operations const *i_fop ; struct file_lock_context *i_flctx ; struct address_space i_data ; struct list_head i_devices ; union __anonunion____missing_field_name_157 __annonCompField42 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; 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_158 { struct llist_node fu_llist ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_158 f_u ; struct path f_path ; struct inode *f_inode ; struct file_operations const *f_op ; spinlock_t f_lock ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; struct mutex f_pos_lock ; 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 ; }; typedef void *fl_owner_t; struct file_lock; 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 * ) ; unsigned long (*lm_owner_key)(struct file_lock * ) ; void (*lm_get_owner)(struct file_lock * , struct file_lock * ) ; void (*lm_put_owner)(struct file_lock * ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , int ) ; bool (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock * , int , struct list_head * ) ; void (*lm_setup)(struct file_lock * , void ** ) ; }; 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 fasync_struct; struct __anonstruct_afs_160 { struct list_head link ; int state ; }; union __anonunion_fl_u_159 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_160 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_list ; struct hlist_node fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; int fl_link_cpu ; 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_159 fl_u ; }; struct file_lock_context { spinlock_t flc_lock ; struct list_head flc_flock ; struct list_head flc_posix ; struct list_head flc_lease ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct callback_head fa_rcu ; }; struct sb_writers { struct percpu_counter counter[3U] ; wait_queue_head_t wait ; int frozen ; wait_queue_head_t wait_unfrozen ; struct lockdep_map lock_map[3U] ; }; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; 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 ; 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_mounts ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; unsigned int s_quota_types ; struct quota_info s_dquot ; struct sb_writers s_writers ; 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 workqueue_struct *s_dio_done_wq ; struct hlist_head s_pins ; struct list_lru s_dentry_lru ; struct list_lru s_inode_lru ; struct callback_head rcu ; int s_stack_depth ; }; 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 dir_context; struct dir_context { int (*actor)(struct dir_context * , char const * , int , loff_t , u64 , unsigned int ) ; loff_t pos ; }; 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 ) ; ssize_t (*read_iter)(struct kiocb * , struct iov_iter * ) ; ssize_t (*write_iter)(struct kiocb * , struct iov_iter * ) ; int (*iterate)(struct file * , struct dir_context * ) ; 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 * ) ; void (*mremap)(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 ** , void ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; void (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; 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 , bool ) ; 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 * ) ; int (*rename2)(struct inode * , struct dentry * , struct inode * , struct dentry * , unsigned int ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; int (*update_time)(struct inode * , struct timespec * , int ) ; int (*atomic_open)(struct inode * , struct dentry * , struct file * , unsigned int , umode_t , int * ) ; int (*tmpfile)(struct inode * , struct dentry * , umode_t ) ; int (*set_acl)(struct inode * , struct posix_acl * , int ) ; int (*dentry_open)(struct dentry * , struct file * , struct cred const * ) ; }; 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 * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_super)(struct super_block * ) ; int (*freeze_fs)(struct super_block * ) ; int (*thaw_super)(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 ) ; struct dquot **(*get_dquots)(struct inode * ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; long (*nr_cached_objects)(struct super_block * , struct shrink_control * ) ; long (*free_cached_objects)(struct super_block * , struct shrink_control * ) ; }; 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 s_writers_key[3U] ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; }; struct arch_uprobe_task { unsigned long saved_scratch_register ; unsigned int saved_trap_nr ; unsigned int saved_tf ; }; enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ; struct __anonstruct____missing_field_name_166 { struct arch_uprobe_task autask ; unsigned long vaddr ; }; struct __anonstruct____missing_field_name_167 { struct callback_head dup_xol_work ; unsigned long dup_xol_addr ; }; union __anonunion____missing_field_name_165 { struct __anonstruct____missing_field_name_166 __annonCompField45 ; struct __anonstruct____missing_field_name_167 __annonCompField46 ; }; struct uprobe; struct return_instance; struct uprobe_task { enum uprobe_task_state state ; union __anonunion____missing_field_name_165 __annonCompField47 ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; struct return_instance *return_instances ; unsigned int depth ; }; struct xol_area; struct uprobes_state { struct xol_area *xol_area ; }; typedef void compound_page_dtor(struct page * ); union __anonunion____missing_field_name_168 { struct address_space *mapping ; void *s_mem ; }; union __anonunion____missing_field_name_170 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct____missing_field_name_174 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion____missing_field_name_173 { atomic_t _mapcount ; struct __anonstruct____missing_field_name_174 __annonCompField50 ; int units ; }; struct __anonstruct____missing_field_name_172 { union __anonunion____missing_field_name_173 __annonCompField51 ; atomic_t _count ; }; union __anonunion____missing_field_name_171 { unsigned long counters ; struct __anonstruct____missing_field_name_172 __annonCompField52 ; unsigned int active ; }; struct __anonstruct____missing_field_name_169 { union __anonunion____missing_field_name_170 __annonCompField49 ; union __anonunion____missing_field_name_171 __annonCompField53 ; }; struct __anonstruct____missing_field_name_176 { struct page *next ; int pages ; int pobjects ; }; struct slab; struct __anonstruct____missing_field_name_177 { compound_page_dtor *compound_dtor ; unsigned long compound_order ; }; union __anonunion____missing_field_name_175 { struct list_head lru ; struct __anonstruct____missing_field_name_176 __annonCompField55 ; struct slab *slab_page ; struct callback_head callback_head ; struct __anonstruct____missing_field_name_177 __annonCompField56 ; pgtable_t pmd_huge_pte ; }; union __anonunion____missing_field_name_178 { unsigned long private ; spinlock_t *ptl ; struct kmem_cache *slab_cache ; struct page *first_page ; }; struct page { unsigned long flags ; union __anonunion____missing_field_name_168 __annonCompField48 ; struct __anonstruct____missing_field_name_169 __annonCompField54 ; union __anonunion____missing_field_name_175 __annonCompField57 ; union __anonunion____missing_field_name_178 __annonCompField58 ; struct mem_cgroup *mem_cgroup ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_shared_179 { struct rb_node rb ; unsigned long rb_subtree_last ; }; struct anon_vma; struct mempolicy; struct vm_area_struct { unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; struct rb_node vm_rb ; unsigned long rb_subtree_gap ; struct mm_struct *vm_mm ; pgprot_t vm_page_prot ; unsigned long vm_flags ; struct __anonstruct_shared_179 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 task_rss_stat { int events ; int count[3U] ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct kioctx_table; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; u32 vmacache_seqnum ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; unsigned long mmap_base ; unsigned long mmap_legacy_base ; unsigned long task_size ; unsigned long highest_vm_end ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; atomic_long_t nr_ptes ; atomic_long_t nr_pmds ; 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 def_flags ; 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[46U] ; 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 kioctx_table *ioctx_table ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; struct cpumask cpumask_allocation ; unsigned long numa_next_scan ; unsigned long numa_scan_offset ; int numa_scan_seq ; bool tlb_flush_pending ; struct uprobes_state uprobes_state ; void *bd_addr ; }; struct rlimit { __kernel_ulong_t rlim_cur ; __kernel_ulong_t rlim_max ; }; struct user_struct; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *cow_page ; struct page *page ; unsigned long max_pgoff ; pte_t *pte ; }; 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 * ) ; void (*map_pages)(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 ) ; char const *(*name)(struct vm_area_struct * ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; struct page *(*find_special_page)(struct vm_area_struct * , unsigned long ) ; }; struct kvec; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; typedef unsigned long cputime_t; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct sysv_shm { struct list_head shm_clist ; }; struct __anonstruct_sigset_t_185 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_185 sigset_t; struct siginfo; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_187 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_188 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_189 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_190 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__addr_bnd_192 { void *_lower ; void *_upper ; }; struct __anonstruct__sigfault_191 { void *_addr ; short _addr_lsb ; struct __anonstruct__addr_bnd_192 _addr_bnd ; }; struct __anonstruct__sigpoll_193 { long _band ; int _fd ; }; struct __anonstruct__sigsys_194 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_186 { int _pad[28U] ; struct __anonstruct__kill_187 _kill ; struct __anonstruct__timer_188 _timer ; struct __anonstruct__rt_189 _rt ; struct __anonstruct__sigchld_190 _sigchld ; struct __anonstruct__sigfault_191 _sigfault ; struct __anonstruct__sigpoll_193 _sigpoll ; struct __anonstruct__sigsys_194 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_186 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct rt_mutex_waiter; 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 int cpu ; unsigned int active_bases ; unsigned int clock_was_set ; ktime_t expires_next ; int in_hrtirq ; 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[4U] ; }; 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 assoc_array_ptr; struct assoc_array { struct assoc_array_ptr *root ; unsigned long nr_leaves_on_tree ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_index_key { struct key_type *type ; char const *description ; size_t desc_len ; }; union __anonunion____missing_field_name_199 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion____missing_field_name_200 { time_t expiry ; time_t revoked_at ; }; struct __anonstruct____missing_field_name_202 { struct key_type *type ; char *description ; }; union __anonunion____missing_field_name_201 { struct keyring_index_key index_key ; struct __anonstruct____missing_field_name_202 __annonCompField66 ; }; union __anonunion_type_data_203 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_205 { unsigned long value ; void *rcudata ; void *data ; void *data2[2U] ; }; union __anonunion____missing_field_name_204 { union __anonunion_payload_205 payload ; struct assoc_array keys ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion____missing_field_name_199 __annonCompField64 ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion____missing_field_name_200 __annonCompField65 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; union __anonunion____missing_field_name_201 __annonCompField67 ; union __anonunion_type_data_203 type_data ; union __anonunion____missing_field_name_204 __annonCompField68 ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; 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 *session_keyring ; struct key *process_keyring ; struct key *thread_keyring ; struct key *request_key_auth ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct callback_head rcu ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct task_group; 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 cputime { cputime_t utime ; cputime_t stime ; }; 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 ; struct list_head thread_head ; 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 ; int posix_timer_id ; 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 ; seqlock_t stats_lock ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; struct cputime prev_cputime ; 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 ; unsigned int audit_tty_log_passwd ; struct tty_audit_buf *tty_audit_buf ; struct rw_semaphore group_rwsem ; oom_flags_t oom_flags ; short oom_score_adj ; short oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; 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 ; u64 blkio_start ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; u64 freepages_start ; u64 freepages_delay ; u32 freepages_count ; }; struct load_weight { unsigned long weight ; u32 inv_weight ; }; struct sched_avg { u32 runnable_avg_sum ; u32 runnable_avg_period ; u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; }; 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 ; int depth ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; struct sched_avg avg ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned long watchdog_stamp ; unsigned int time_slice ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct sched_dl_entity { struct rb_node rb_node ; u64 dl_runtime ; u64 dl_deadline ; u64 dl_period ; u64 dl_bw ; s64 runtime ; u64 deadline ; unsigned int flags ; int dl_throttled ; int dl_new ; int dl_boosted ; int dl_yielded ; struct hrtimer dl_timer ; }; struct memcg_oom_info { struct mem_cgroup *memcg ; gfp_t gfp_mask ; int order ; unsigned char may_oom : 1 ; }; struct sched_class; struct files_struct; struct css_set; struct compat_robust_list_head; struct numa_group; struct ftrace_ret_stack; 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 ; struct task_struct *last_wakee ; unsigned long wakee_flips ; unsigned long wakee_flip_decay_ts ; int wake_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 task_group *sched_task_group ; struct sched_dl_entity dl ; struct hlist_head preempt_notifiers ; unsigned int btrace_seq ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; unsigned long rcu_tasks_nvcsw ; bool rcu_tasks_holdout ; struct list_head rcu_tasks_holdout_list ; int rcu_tasks_idle_cpu ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct rb_node pushable_dl_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; unsigned char brk_randomized : 1 ; u32 vmacache_seqnum ; struct vm_area_struct *vmacache[4U] ; struct task_rss_stat rss_stat ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int jobctl ; unsigned int personality ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; unsigned char memcg_kmem_skip_account : 1 ; unsigned long atomic_flags ; struct restart_block restart_block ; pid_t pid ; pid_t tgid ; 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 list_head thread_node ; 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 ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; u64 start_time ; u64 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 ; char comm[16U] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; struct sysv_shm sysvshm ; 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 callback_head *task_works ; struct audit_context *audit_context ; kuid_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 rb_root pi_waiters ; struct rb_node *pi_waiters_leftmost ; 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 ; int numa_scan_seq ; unsigned int numa_scan_period ; unsigned int numa_scan_period_max ; int numa_preferred_nid ; unsigned long numa_migrate_retry ; u64 node_stamp ; u64 last_task_numa_placement ; u64 last_sum_exec_runtime ; struct callback_head numa_work ; struct list_head numa_entry ; struct numa_group *numa_group ; unsigned long *numa_faults ; unsigned long total_numa_faults ; unsigned long numa_faults_locality[2U] ; unsigned long numa_pages_migrated ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; 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 ; unsigned int kasan_depth ; int curr_ret_stack ; struct ftrace_ret_stack *ret_stack ; unsigned long long ftrace_timestamp ; atomic_t trace_overrun ; atomic_t tracing_graph_pause ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_oom_info memcg_oom ; struct uprobe_task *utask ; unsigned int sequential_io ; unsigned int sequential_io_avg ; unsigned long task_state_change ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct kvec { void *iov_base ; size_t iov_len ; }; union __anonunion____missing_field_name_210 { struct iovec const *iov ; struct kvec const *kvec ; struct bio_vec const *bvec ; }; struct iov_iter { int type ; size_t iov_offset ; size_t count ; union __anonunion____missing_field_name_210 __annonCompField72 ; unsigned long nr_segs ; }; struct otp_info { __u32 start ; __u32 length ; __u32 locked ; }; struct nand_oobfree { __u32 offset ; __u32 length ; }; struct mtd_ecc_stats { __u32 corrected ; __u32 failed ; __u32 badblocks ; __u32 bbtblocks ; }; struct erase_info { struct mtd_info *mtd ; uint64_t addr ; uint64_t len ; uint64_t fail_addr ; u_long time ; u_long retries ; unsigned int dev ; unsigned int cell ; void (*callback)(struct erase_info * ) ; u_long priv ; u_char state ; struct erase_info *next ; }; struct mtd_erase_region_info { uint64_t offset ; uint32_t erasesize ; uint32_t numblocks ; unsigned long *lockmap ; }; struct mtd_oob_ops { unsigned int mode ; size_t len ; size_t retlen ; size_t ooblen ; size_t oobretlen ; uint32_t ooboffs ; uint8_t *datbuf ; uint8_t *oobbuf ; }; struct nand_ecclayout { __u32 eccbytes ; __u32 eccpos[640U] ; __u32 oobavail ; struct nand_oobfree oobfree[32U] ; }; struct mtd_info { u_char type ; uint32_t flags ; uint64_t size ; uint32_t erasesize ; uint32_t writesize ; uint32_t writebufsize ; uint32_t oobsize ; uint32_t oobavail ; unsigned int erasesize_shift ; unsigned int writesize_shift ; unsigned int erasesize_mask ; unsigned int writesize_mask ; unsigned int bitflip_threshold ; char const *name ; int index ; struct nand_ecclayout *ecclayout ; unsigned int ecc_step_size ; unsigned int ecc_strength ; int numeraseregions ; struct mtd_erase_region_info *eraseregions ; int (*_erase)(struct mtd_info * , struct erase_info * ) ; int (*_point)(struct mtd_info * , loff_t , size_t , size_t * , void ** , resource_size_t * ) ; int (*_unpoint)(struct mtd_info * , loff_t , size_t ) ; unsigned long (*_get_unmapped_area)(struct mtd_info * , unsigned long , unsigned long , unsigned long ) ; int (*_read)(struct mtd_info * , loff_t , size_t , size_t * , u_char * ) ; int (*_write)(struct mtd_info * , loff_t , size_t , size_t * , u_char const * ) ; int (*_panic_write)(struct mtd_info * , loff_t , size_t , size_t * , u_char const * ) ; int (*_read_oob)(struct mtd_info * , loff_t , struct mtd_oob_ops * ) ; int (*_write_oob)(struct mtd_info * , loff_t , struct mtd_oob_ops * ) ; int (*_get_fact_prot_info)(struct mtd_info * , size_t , size_t * , struct otp_info * ) ; int (*_read_fact_prot_reg)(struct mtd_info * , loff_t , size_t , size_t * , u_char * ) ; int (*_get_user_prot_info)(struct mtd_info * , size_t , size_t * , struct otp_info * ) ; int (*_read_user_prot_reg)(struct mtd_info * , loff_t , size_t , size_t * , u_char * ) ; int (*_write_user_prot_reg)(struct mtd_info * , loff_t , size_t , size_t * , u_char * ) ; int (*_lock_user_prot_reg)(struct mtd_info * , loff_t , size_t ) ; int (*_writev)(struct mtd_info * , struct kvec const * , unsigned long , loff_t , size_t * ) ; void (*_sync)(struct mtd_info * ) ; int (*_lock)(struct mtd_info * , loff_t , uint64_t ) ; int (*_unlock)(struct mtd_info * , loff_t , uint64_t ) ; int (*_is_locked)(struct mtd_info * , loff_t , uint64_t ) ; int (*_block_isreserved)(struct mtd_info * , loff_t ) ; int (*_block_isbad)(struct mtd_info * , loff_t ) ; int (*_block_markbad)(struct mtd_info * , loff_t ) ; int (*_suspend)(struct mtd_info * ) ; void (*_resume)(struct mtd_info * ) ; void (*_reboot)(struct mtd_info * ) ; int (*_get_device)(struct mtd_info * ) ; void (*_put_device)(struct mtd_info * ) ; struct backing_dev_info *backing_dev_info ; struct notifier_block reboot_notifier ; struct mtd_ecc_stats ecc_stats ; int subpage_sft ; void *priv ; struct module *owner ; struct device dev ; int usecount ; }; struct ubi_volume_desc; struct ubi_vid_hdr { __be32 magic ; __u8 version ; __u8 vol_type ; __u8 copy_flag ; __u8 compat ; __be32 vol_id ; __be32 lnum ; __u8 padding1[4U] ; __be32 data_size ; __be32 used_ebs ; __be32 data_pad ; __be32 data_crc ; __u8 padding2[4U] ; __be64 sqnum ; __u8 padding3[12U] ; __be32 hdr_crc ; }; struct ubi_vtbl_record { __be32 reserved_pebs ; __be32 alignment ; __be32 data_pad ; __u8 vol_type ; __u8 upd_marker ; __be16 name_len ; __u8 name[128U] ; __u8 flags ; __u8 padding[23U] ; __be32 crc ; }; union __anonunion_u_212 { struct rb_node rb ; struct list_head list ; }; struct ubi_wl_entry { union __anonunion_u_212 u ; int ec ; int pnum ; }; struct ubi_rename_entry { int new_name_len ; char new_name[128U] ; int remove ; struct ubi_volume_desc *desc ; struct list_head list ; }; struct ubi_fastmap_layout { struct ubi_wl_entry *e[32U] ; int to_be_tortured[32U] ; int used_blocks ; int max_pool_size ; int max_wl_pool_size ; }; struct ubi_fm_pool { int pebs[256U] ; int used ; int size ; int max_size ; }; struct ubi_device; struct ubi_volume { struct device dev ; struct cdev cdev ; struct ubi_device *ubi ; int vol_id ; int ref_count ; int readers ; int writers ; int exclusive ; int metaonly ; int reserved_pebs ; int vol_type ; int usable_leb_size ; int used_ebs ; int last_eb_bytes ; long long used_bytes ; int alignment ; int data_pad ; int name_len ; char name[128U] ; int upd_ebs ; int ch_lnum ; long long upd_bytes ; long long upd_received ; void *upd_buf ; int *eba_tbl ; unsigned char checked : 1 ; unsigned char corrupted : 1 ; unsigned char upd_marker : 1 ; unsigned char updating : 1 ; unsigned char changing_leb : 1 ; unsigned char direct_writes : 1 ; }; struct ubi_volume_desc { struct ubi_volume *vol ; int mode ; }; struct ubi_debug_info { unsigned char chk_gen : 1 ; unsigned char chk_io : 1 ; unsigned char disable_bgt : 1 ; unsigned char emulate_bitflips : 1 ; unsigned char emulate_io_failures : 1 ; char dfs_dir_name[7U] ; struct dentry *dfs_dir ; struct dentry *dfs_chk_gen ; struct dentry *dfs_chk_io ; struct dentry *dfs_disable_bgt ; struct dentry *dfs_emulate_bitflips ; struct dentry *dfs_emulate_io_failures ; }; struct ubi_device { struct cdev cdev ; struct device dev ; int ubi_num ; char ubi_name[9U] ; int vol_count ; struct ubi_volume *volumes[129U] ; spinlock_t volumes_lock ; int ref_count ; int image_seq ; int rsvd_pebs ; int avail_pebs ; int beb_rsvd_pebs ; int beb_rsvd_level ; int bad_peb_limit ; int autoresize_vol_id ; int vtbl_slots ; int vtbl_size ; struct ubi_vtbl_record *vtbl ; struct mutex device_mutex ; int max_ec ; int mean_ec ; unsigned long long global_sqnum ; spinlock_t ltree_lock ; struct rb_root ltree ; struct mutex alc_mutex ; int fm_disabled ; struct ubi_fastmap_layout *fm ; struct ubi_fm_pool fm_pool ; struct ubi_fm_pool fm_wl_pool ; struct rw_semaphore fm_sem ; struct mutex fm_mutex ; void *fm_buf ; size_t fm_size ; struct work_struct fm_work ; struct rb_root used ; struct rb_root erroneous ; struct rb_root free ; int free_count ; struct rb_root scrub ; struct list_head pq[10U] ; int pq_head ; spinlock_t wl_lock ; struct mutex move_mutex ; struct rw_semaphore work_sem ; int wl_scheduled ; struct ubi_wl_entry **lookuptbl ; struct ubi_wl_entry *move_from ; struct ubi_wl_entry *move_to ; int move_to_put ; struct list_head works ; int works_count ; struct task_struct *bgt_thread ; int thread_enabled ; char bgt_name[13U] ; long long flash_size ; int peb_count ; int peb_size ; int bad_peb_count ; int good_peb_count ; int corr_peb_count ; int erroneous_peb_count ; int max_erroneous ; int min_io_size ; int hdrs_min_io_size ; int ro_mode ; int leb_size ; int leb_start ; int ec_hdr_alsize ; int vid_hdr_alsize ; int vid_hdr_offset ; int vid_hdr_aloffset ; int vid_hdr_shift ; unsigned char bad_allowed : 1 ; unsigned char nor_flash : 1 ; int max_write_size ; struct mtd_info *mtd ; void *peb_buf ; struct mutex buf_mutex ; struct mutex ckvol_mutex ; struct ubi_debug_info dbg ; }; union __anonunion_u_213 { struct rb_node rb ; struct list_head list ; }; struct ubi_ainf_peb { int ec ; int pnum ; int vol_id ; int lnum ; unsigned char scrub : 1 ; unsigned char copy_flag : 1 ; unsigned long long sqnum ; union __anonunion_u_213 u ; }; struct ubi_ainf_volume { int vol_id ; int highest_lnum ; int leb_count ; int vol_type ; int used_ebs ; int last_data_size ; int data_pad ; int compat ; struct rb_node rb ; struct rb_root root ; }; struct ubi_attach_info { struct rb_root volumes ; struct list_head corr ; struct list_head free ; struct list_head erase ; struct list_head alien ; int corr_peb_count ; int empty_peb_count ; int alien_peb_count ; int bad_peb_count ; int maybe_bad_peb_count ; int vols_found ; int highest_vol_id ; int is_empty ; int min_ec ; int max_ec ; unsigned long long max_sqnum ; int mean_ec ; uint64_t ec_sum ; int ec_count ; struct kmem_cache *aeb_slab_cache ; }; typedef short __s16; typedef long long __s64; struct ldv_thread; enum hrtimer_restart; struct ubi_mkvol_req { __s32 vol_id ; __s32 alignment ; __s64 bytes ; __s8 vol_type ; __s8 padding1 ; __s16 name_len ; __s8 padding2[4U] ; char name[128U] ; }; enum hrtimer_restart; struct ubi_leb_change_req { __s32 lnum ; __s32 bytes ; __s8 dtype ; __s8 padding[7U] ; }; typedef signed char s8; struct kernel_symbol { unsigned long value ; char const *name ; }; typedef void (*ctor_fn_t)(void); struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct jump_entry; typedef u64 jump_label_t; struct jump_entry { jump_label_t code ; jump_label_t target ; jump_label_t key ; }; enum hrtimer_restart; struct blocking_notifier_head { struct rw_semaphore rwsem ; struct notifier_block *head ; }; struct exception_table_entry { int insn ; int fixup ; }; 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 { unsigned int flags ; 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____missing_field_name_191 { 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 ; s8 level ; u8 flags ; union __anonunion____missing_field_name_191 __annonCompField64 ; }; 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 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 completion *kobj_completion ; }; 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 * ) ; }; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ; struct module_sect_attrs; struct module_notes_attrs; struct tracepoint; 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 ; bool sig_ok ; 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 ; struct jump_entry *jump_entries ; unsigned int num_jump_entries ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct ftrace_event_call **trace_events ; unsigned int num_trace_events ; unsigned int num_ftrace_callsites ; unsigned long *ftrace_callsites ; struct list_head source_list ; struct list_head target_list ; void (*exit)(void) ; atomic_t refcnt ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct miscdevice { int minor ; char const *name ; struct file_operations const *fops ; struct list_head list ; struct device *parent ; struct device *this_device ; char const *nodename ; umode_t mode ; }; struct ubi_volume_info { int ubi_num ; int vol_id ; int size ; long long used_bytes ; int used_ebs ; int vol_type ; int corrupted ; int upd_marker ; int alignment ; int usable_leb_size ; int name_len ; char const *name ; dev_t cdev ; }; struct ubi_device_info { int ubi_num ; int leb_size ; int leb_start ; int min_io_size ; int max_write_size ; int ro_mode ; dev_t cdev ; }; struct ubi_notification { struct ubi_device_info di ; struct ubi_volume_info vi ; }; struct mtd_dev_param { char name[64U] ; int ubi_num ; int vid_hdr_offs ; int max_beb_per1024 ; }; struct ldv_struct_EMGentry_15 { int signal_pending ; }; struct ldv_struct_file_operations_instance_0 { struct file_operations *arg0 ; int signal_pending ; }; typedef int ldv_func_ret_type___0; typedef int ldv_func_ret_type___1; typedef int ldv_func_ret_type___2; typedef int ldv_func_ret_type___3; typedef __s64 int64_t; enum hrtimer_restart; struct hd_geometry; typedef s32 compat_time_t; typedef s32 compat_long_t; typedef u32 compat_uptr_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; 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 ubi_attach_req { __s32 ubi_num ; __s32 mtd_num ; __s32 vid_hdr_offset ; __s16 max_beb_per1024 ; __s8 padding[10U] ; }; struct ubi_rsvol_req { __s64 bytes ; __s32 vol_id ; }; struct __anonstruct_ents_241 { __s32 vol_id ; __s16 name_len ; __s8 padding2[2U] ; char name[128U] ; }; struct ubi_rnvol_req { __s32 count ; __s8 padding1[12U] ; struct __anonstruct_ents_241 ents[32U] ; }; struct ubi_map_req { __s32 lnum ; __s8 dtype ; __s8 padding[3U] ; }; struct ubi_set_vol_prop_req { __u8 property ; __u8 padding[7U] ; __u64 value ; }; typedef u64 dma_addr_t; enum hrtimer_restart; 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 ubi_sgl { int list_pos ; int page_pos ; struct scatterlist sg[64U] ; }; enum hrtimer_restart; struct ubi_ltree_entry { struct rb_node rb ; int vol_id ; int lnum ; int users ; struct rw_semaphore mutex ; }; 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 ; }; enum hrtimer_restart; struct ubi_ec_hdr { __be32 magic ; __u8 version ; __u8 padding1[3U] ; __be64 ec ; __be32 vid_hdr_offset ; __be32 data_offset ; __be32 image_seq ; __u8 padding2[32U] ; __be32 hdr_crc ; }; enum hrtimer_restart; struct ubi_work { struct list_head list ; int (*func)(struct ubi_device * , struct ubi_work * , int ) ; struct ubi_wl_entry *e ; int vol_id ; int lnum ; int torture ; int anchor ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; struct ubi_fm_sb { __be32 magic ; __u8 version ; __u8 padding1[3U] ; __be32 data_crc ; __be32 used_blocks ; __be32 block_loc[32U] ; __be32 block_ec[32U] ; __be64 sqnum ; __u8 padding2[32U] ; }; struct ubi_fm_hdr { __be32 magic ; __be32 free_peb_count ; __be32 used_peb_count ; __be32 scrub_peb_count ; __be32 bad_peb_count ; __be32 erase_peb_count ; __be32 vol_count ; __u8 padding[4U] ; }; struct ubi_fm_scan_pool { __be32 magic ; __be16 size ; __be16 max_size ; __be32 pebs[256U] ; __be32 padding[4U] ; }; struct ubi_fm_ec { __be32 pnum ; __be32 ec ; }; struct ubi_fm_volhdr { __be32 magic ; __be32 vol_id ; __u8 vol_type ; __u8 padding1[3U] ; __be32 data_pad ; __be32 used_ebs ; __be32 last_eb_bytes ; __u8 padding2[8U] ; }; struct ubi_fm_eba { __be32 magic ; __be32 reserved_pebs ; __be32 pnum[0U] ; }; struct request; enum hrtimer_restart; struct call_single_data { struct llist_node llist ; void (*func)(void * ) ; void *info ; u16 flags ; }; struct bio_set; struct bio; struct bio_integrity_payload; struct cgroup_subsys_state; typedef void bio_end_io_t(struct bio * , int ); struct bvec_iter { sector_t bi_sector ; unsigned int bi_size ; unsigned int bi_idx ; unsigned int bi_bvec_done ; }; union __anonunion____missing_field_name_150 { struct bio_integrity_payload *bi_integrity ; }; struct bio { struct bio *bi_next ; struct block_device *bi_bdev ; unsigned long bi_flags ; unsigned long bi_rw ; struct bvec_iter bi_iter ; unsigned int bi_phys_segments ; unsigned int bi_seg_front_size ; unsigned int bi_seg_back_size ; atomic_t bi_remaining ; bio_end_io_t *bi_end_io ; void *bi_private ; struct io_context *bi_ioc ; struct cgroup_subsys_state *bi_css ; union __anonunion____missing_field_name_150 __annonCompField38 ; unsigned short bi_vcnt ; unsigned short bi_max_vecs ; atomic_t bi_cnt ; struct bio_vec *bi_io_vec ; struct bio_set *bi_pool ; struct bio_vec bi_inline_vecs[0U] ; }; struct block_device_operations; 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 { char uuid[37U] ; u8 volname[64U] ; }; struct hd_struct { sector_t start_sect ; sector_t nr_sects ; seqcount_t nr_sects_seq ; 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 callback_head callback_head ; }; struct disk_part_tbl { struct callback_head callback_head ; int len ; struct hd_struct *last_lookup ; struct hd_struct *part[] ; }; struct disk_events; struct timer_rand_state; 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 ; }; struct fprop_local_percpu { struct percpu_counter events ; unsigned int period ; raw_spinlock_t lock ; }; 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 ; unsigned char for_sync : 1 ; }; struct bdi_writeback; typedef int congested_fn(void * , int ); struct bdi_writeback { struct backing_dev_info *bdi ; unsigned long last_old_flush ; struct delayed_work dwork ; struct list_head b_dirty ; struct list_head b_io ; struct list_head b_more_io ; struct list_head b_dirty_time ; 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 fprop_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____missing_field_name_216 { struct list_head q_node ; struct kmem_cache *__rcu_icq_cache ; }; union __anonunion____missing_field_name_217 { struct hlist_node ioc_node ; struct callback_head __rcu_head ; }; struct io_cq { struct request_queue *q ; struct io_context *ioc ; union __anonunion____missing_field_name_216 __annonCompField73 ; union __anonunion____missing_field_name_217 __annonCompField74 ; 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 ; struct bvec_iter bip_iter ; bio_end_io_t *bip_end_io ; unsigned short bip_slab ; unsigned short bip_vcnt ; unsigned short bip_max_vcnt ; unsigned short bip_flags ; struct work_struct bip_work ; struct bio_vec *bip_vec ; struct bio_vec bip_inline_vecs[0U] ; }; struct bio_list { struct bio *head ; struct bio *tail ; }; struct bio_set { struct kmem_cache *bio_slab ; unsigned int front_pad ; mempool_t *bio_pool ; mempool_t *bvec_pool ; mempool_t *bio_integrity_pool ; mempool_t *bvec_integrity_pool ; spinlock_t rescue_lock ; struct bio_list rescue_list ; struct work_struct rescue_work ; struct workqueue_struct *rescue_workqueue ; }; 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 percpu_ref; typedef void percpu_ref_func_t(struct percpu_ref * ); struct percpu_ref { atomic_long_t count ; unsigned long percpu_count_ptr ; percpu_ref_func_t *release ; percpu_ref_func_t *confirm_switch ; bool force_atomic ; struct callback_head rcu ; }; struct elevator_queue; struct blk_trace; struct bsg_job; struct blkcg_gq; struct blk_flush_queue; typedef void rq_end_io_fn(struct request * , int ); struct request_list { struct request_queue *q ; struct blkcg_gq *blkg ; int count[2U] ; int starved[2U] ; mempool_t *rq_pool ; wait_queue_head_t wait[2U] ; unsigned int flags ; }; 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____missing_field_name_218 { struct call_single_data csd ; unsigned long fifo_time ; }; struct blk_mq_ctx; union __anonunion____missing_field_name_219 { struct hlist_node hash ; struct list_head ipi_list ; }; union __anonunion____missing_field_name_220 { struct rb_node rb_node ; void *completion_data ; }; struct __anonstruct_elv_222 { struct io_cq *icq ; void *priv[2U] ; }; struct __anonstruct_flush_223 { unsigned int seq ; struct list_head list ; rq_end_io_fn *saved_end_io ; }; union __anonunion____missing_field_name_221 { struct __anonstruct_elv_222 elv ; struct __anonstruct_flush_223 flush ; }; struct request { struct list_head queuelist ; union __anonunion____missing_field_name_218 __annonCompField75 ; struct request_queue *q ; struct blk_mq_ctx *mq_ctx ; u64 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 ; union __anonunion____missing_field_name_219 __annonCompField76 ; union __anonunion____missing_field_name_220 __annonCompField77 ; union __anonunion____missing_field_name_221 __annonCompField78 ; struct gendisk *rq_disk ; struct hd_struct *part ; unsigned long start_time ; struct request_list *rl ; 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 ; void *special ; 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 ; }; struct elevator_type; 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 * , struct elevator_type * ); 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 ; unsigned char registered : 1 ; struct hlist_head hash[64U] ; }; 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 ; int alloc_policy ; int next_tag ; }; struct queue_limits { unsigned long bounce_pfn ; unsigned long seg_boundary_mask ; unsigned int max_hw_sectors ; unsigned int chunk_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 max_write_same_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 ; unsigned char raid_partial_stripes_expensive ; }; struct blk_mq_ops; struct blk_mq_hw_ctx; struct throtl_data; struct blk_mq_tag_set; struct request_queue { struct list_head queue_head ; struct request *last_merge ; struct elevator_queue *elevator ; int nr_rqs[2U] ; int nr_rqs_elvpriv ; struct request_list root_rl ; 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 ; struct blk_mq_ops *mq_ops ; unsigned int *mq_map ; struct blk_mq_ctx *queue_ctx ; unsigned int nr_queues ; struct blk_mq_hw_ctx **queue_hw_ctx ; unsigned int nr_hw_queues ; 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 ; struct kobject mq_kobj ; struct device *dev ; int rpm_status ; unsigned int nr_pending ; 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 request_fn_active ; 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 ; struct blk_trace *blk_trace ; unsigned int flush_flags ; unsigned char flush_not_queueable : 1 ; struct blk_flush_queue *fq ; struct list_head requeue_list ; spinlock_t requeue_lock ; struct work_struct requeue_work ; struct mutex sysfs_lock ; int bypass_depth ; int mq_freeze_depth ; bsg_job_fn *bsg_job_fn ; int bsg_job_size ; struct bsg_class_device bsg_dev ; struct throtl_data *td ; struct callback_head callback_head ; wait_queue_head_t mq_freeze_wq ; struct percpu_ref mq_usage_counter ; struct list_head all_q_node ; struct blk_mq_tag_set *tag_set ; struct list_head tag_set_list ; }; struct blk_plug { struct list_head list ; struct list_head mq_list ; struct list_head cb_list ; }; struct blk_integrity_iter { void *prot_buf ; void *data_buf ; sector_t seed ; unsigned int data_size ; unsigned short interval ; char const *disk_name ; }; typedef int integrity_processing_fn(struct blk_integrity_iter * ); struct blk_integrity { integrity_processing_fn *generate_fn ; integrity_processing_fn *verify_fn ; unsigned short flags ; unsigned short tuple_size ; unsigned short interval ; unsigned short tag_size ; char const *name ; struct kobject kobj ; }; struct block_device_operations { int (*open)(struct block_device * , fmode_t ) ; void (*release)(struct gendisk * , fmode_t ) ; int (*rw_page)(struct block_device * , sector_t , struct page * , int ) ; int (*ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct block_device * , fmode_t , unsigned int , unsigned long ) ; long (*direct_access)(struct block_device * , sector_t , void ** , unsigned long * , 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 blk_mq_tags; struct blk_mq_cpu_notifier { struct list_head list ; void *data ; int (*notify)(void * , unsigned long , unsigned int ) ; }; struct blk_align_bitmap; struct blk_mq_ctxmap { unsigned int map_size ; unsigned int bits_per_word ; struct blk_align_bitmap *map ; }; struct __anonstruct____missing_field_name_225 { spinlock_t lock ; struct list_head dispatch ; }; struct blk_mq_hw_ctx { struct __anonstruct____missing_field_name_225 __annonCompField79 ; unsigned long state ; struct delayed_work run_work ; struct delayed_work delay_work ; cpumask_var_t cpumask ; int next_cpu ; int next_cpu_batch ; unsigned long flags ; struct request_queue *queue ; struct blk_flush_queue *fq ; void *driver_data ; struct blk_mq_ctxmap ctx_map ; unsigned int nr_ctx ; struct blk_mq_ctx **ctxs ; atomic_t wait_index ; struct blk_mq_tags *tags ; unsigned long queued ; unsigned long run ; unsigned long dispatched[10U] ; unsigned int numa_node ; unsigned int queue_num ; atomic_t nr_active ; struct blk_mq_cpu_notifier cpu_notifier ; struct kobject kobj ; }; struct blk_mq_tag_set { struct blk_mq_ops *ops ; unsigned int nr_hw_queues ; unsigned int queue_depth ; unsigned int reserved_tags ; unsigned int cmd_size ; int numa_node ; unsigned int timeout ; unsigned int flags ; void *driver_data ; struct blk_mq_tags **tags ; struct mutex tag_list_lock ; struct list_head tag_list ; }; struct blk_mq_queue_data { struct request *rq ; struct list_head *list ; bool last ; }; typedef int queue_rq_fn(struct blk_mq_hw_ctx * , struct blk_mq_queue_data const * ); typedef struct blk_mq_hw_ctx *map_queue_fn(struct request_queue * , int const ); typedef enum blk_eh_timer_return timeout_fn(struct request * , bool ); typedef int init_hctx_fn(struct blk_mq_hw_ctx * , void * , unsigned int ); typedef void exit_hctx_fn(struct blk_mq_hw_ctx * , unsigned int ); typedef int init_request_fn(void * , struct request * , unsigned int , unsigned int , unsigned int ); typedef void exit_request_fn(void * , struct request * , unsigned int , unsigned int ); struct blk_mq_ops { queue_rq_fn *queue_rq ; map_queue_fn *map_queue ; timeout_fn *timeout ; softirq_done_fn *complete ; init_hctx_fn *init_hctx ; exit_hctx_fn *exit_hctx ; init_request_fn *init_request ; exit_request_fn *exit_request ; }; struct hd_geometry { unsigned char heads ; unsigned char sectors ; unsigned short cylinders ; unsigned long start ; }; struct ubiblock_param { int ubi_num ; int vol_id ; char name[64U] ; }; struct ubiblock_pdu { struct work_struct work ; struct ubi_sgl usgl ; }; struct ubiblock { struct ubi_volume_desc *desc ; int ubi_num ; int vol_id ; int refcnt ; int leb_size ; struct gendisk *gd ; struct request_queue *rq ; struct workqueue_struct *wq ; struct mutex dev_mutex ; struct list_head list ; struct blk_mq_tag_set tag_set ; }; struct ldv_struct_dummy_resourceless_instance_8 { struct notifier_block *arg0 ; int signal_pending ; }; typedef struct gendisk *ldv_func_ret_type___4; struct device_private { void *driver_data ; }; typedef short s16; enum hrtimer_restart; typedef unsigned long kernel_ulong_t; struct acpi_device_id { __u8 id[9U] ; kernel_ulong_t driver_data ; }; struct of_device_id { char name[32U] ; char type[32U] ; char compatible[128U] ; void const *data ; }; struct kthread_work; struct kthread_worker { spinlock_t lock ; struct list_head work_list ; struct task_struct *task ; struct kthread_work *current_work ; }; struct kthread_work { struct list_head node ; void (*func)(struct kthread_work * ) ; struct kthread_worker *worker ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; struct dma_chan; struct spi_master; struct spi_device { struct device dev ; struct spi_master *master ; u32 max_speed_hz ; u8 chip_select ; u8 bits_per_word ; u16 mode ; int irq ; void *controller_state ; void *controller_data ; char modalias[32U] ; int cs_gpio ; }; struct spi_message; struct spi_transfer; struct spi_master { struct device dev ; struct list_head list ; s16 bus_num ; u16 num_chipselect ; u16 dma_alignment ; u16 mode_bits ; u32 bits_per_word_mask ; u32 min_speed_hz ; u32 max_speed_hz ; u16 flags ; spinlock_t bus_lock_spinlock ; struct mutex bus_lock_mutex ; bool bus_lock_flag ; int (*setup)(struct spi_device * ) ; int (*transfer)(struct spi_device * , struct spi_message * ) ; void (*cleanup)(struct spi_device * ) ; bool (*can_dma)(struct spi_master * , struct spi_device * , struct spi_transfer * ) ; bool queued ; struct kthread_worker kworker ; struct task_struct *kworker_task ; struct kthread_work pump_messages ; spinlock_t queue_lock ; struct list_head queue ; struct spi_message *cur_msg ; bool idling ; bool busy ; bool running ; bool rt ; bool auto_runtime_pm ; bool cur_msg_prepared ; bool cur_msg_mapped ; struct completion xfer_completion ; size_t max_dma_len ; int (*prepare_transfer_hardware)(struct spi_master * ) ; int (*transfer_one_message)(struct spi_master * , struct spi_message * ) ; int (*unprepare_transfer_hardware)(struct spi_master * ) ; int (*prepare_message)(struct spi_master * , struct spi_message * ) ; int (*unprepare_message)(struct spi_master * , struct spi_message * ) ; void (*set_cs)(struct spi_device * , bool ) ; int (*transfer_one)(struct spi_master * , struct spi_device * , struct spi_transfer * ) ; int *cs_gpios ; struct dma_chan *dma_tx ; struct dma_chan *dma_rx ; void *dummy_rx ; void *dummy_tx ; }; struct spi_transfer { void const *tx_buf ; void *rx_buf ; unsigned int len ; dma_addr_t tx_dma ; dma_addr_t rx_dma ; struct sg_table tx_sg ; struct sg_table rx_sg ; unsigned char cs_change : 1 ; unsigned char tx_nbits : 3 ; unsigned char rx_nbits : 3 ; u8 bits_per_word ; u16 delay_usecs ; u32 speed_hz ; struct list_head transfer_list ; }; struct spi_message { struct list_head transfers ; struct spi_device *spi ; unsigned char is_dma_mapped : 1 ; void (*complete)(void * ) ; void *context ; unsigned int frame_length ; unsigned int actual_length ; int status ; struct list_head queue ; void *state ; }; enum hrtimer_restart; struct ratelimit_state { raw_spinlock_t lock ; int interval ; int burst ; int printed ; int missed ; unsigned long begin ; }; typedef unsigned int mmc_pm_flag_t; struct mmc_card; struct sdio_func; typedef void sdio_irq_handler_t(struct sdio_func * ); struct sdio_func_tuple { struct sdio_func_tuple *next ; unsigned char code ; unsigned char size ; unsigned char data[0U] ; }; struct sdio_func { struct mmc_card *card ; struct device dev ; sdio_irq_handler_t *irq_handler ; unsigned int num ; unsigned char class ; unsigned short vendor ; unsigned short device ; unsigned int max_blksize ; unsigned int cur_blksize ; unsigned int enable_timeout ; unsigned int state ; u8 tmpbuf[4U] ; unsigned int num_info ; char const **info ; struct sdio_func_tuple *tuples ; }; enum led_brightness { LED_OFF = 0, LED_HALF = 127, LED_FULL = 255 } ; struct led_trigger; struct led_classdev { char const *name ; enum led_brightness brightness ; enum led_brightness max_brightness ; int flags ; void (*brightness_set)(struct led_classdev * , enum led_brightness ) ; int (*brightness_set_sync)(struct led_classdev * , enum led_brightness ) ; enum led_brightness (*brightness_get)(struct led_classdev * ) ; int (*blink_set)(struct led_classdev * , unsigned long * , unsigned long * ) ; struct device *dev ; struct attribute_group const **groups ; struct list_head node ; char const *default_trigger ; unsigned long blink_delay_on ; unsigned long blink_delay_off ; struct timer_list blink_timer ; int blink_brightness ; void (*flash_resume)(struct led_classdev * ) ; struct work_struct set_brightness_work ; int delayed_set_value ; struct rw_semaphore trigger_lock ; struct led_trigger *trigger ; struct list_head trig_list ; void *trigger_data ; bool activated ; struct mutex led_access ; }; struct led_trigger { char const *name ; void (*activate)(struct led_classdev * ) ; void (*deactivate)(struct led_classdev * ) ; rwlock_t leddev_list_lock ; struct list_head led_cdevs ; struct list_head next_trig ; }; struct fault_attr { unsigned long probability ; unsigned long interval ; atomic_t times ; atomic_t space ; unsigned long verbose ; u32 task_filter ; unsigned long stacktrace_depth ; unsigned long require_start ; unsigned long require_end ; unsigned long reject_start ; unsigned long reject_end ; unsigned long count ; struct ratelimit_state ratelimit_state ; struct dentry *dname ; }; struct mmc_data; struct mmc_request; struct mmc_command { u32 opcode ; u32 arg ; u32 resp[4U] ; unsigned int flags ; unsigned int retries ; unsigned int error ; unsigned int busy_timeout ; bool sanitize_busy ; struct mmc_data *data ; struct mmc_request *mrq ; }; struct mmc_data { unsigned int timeout_ns ; unsigned int timeout_clks ; unsigned int blksz ; unsigned int blocks ; unsigned int error ; unsigned int flags ; unsigned int bytes_xfered ; struct mmc_command *stop ; struct mmc_request *mrq ; unsigned int sg_len ; struct scatterlist *sg ; s32 host_cookie ; }; struct mmc_host; struct mmc_request { struct mmc_command *sbc ; struct mmc_command *cmd ; struct mmc_data *data ; struct mmc_command *stop ; struct completion completion ; void (*done)(struct mmc_request * ) ; struct mmc_host *host ; }; struct mmc_async_req; struct mmc_cid { unsigned int manfid ; char prod_name[8U] ; unsigned char prv ; unsigned int serial ; unsigned short oemid ; unsigned short year ; unsigned char hwrev ; unsigned char fwrev ; unsigned char month ; }; struct mmc_csd { unsigned char structure ; unsigned char mmca_vsn ; unsigned short cmdclass ; unsigned short tacc_clks ; unsigned int tacc_ns ; unsigned int c_size ; unsigned int r2w_factor ; unsigned int max_dtr ; unsigned int erase_size ; unsigned int read_blkbits ; unsigned int write_blkbits ; unsigned int capacity ; unsigned char read_partial : 1 ; unsigned char read_misalign : 1 ; unsigned char write_partial : 1 ; unsigned char write_misalign : 1 ; unsigned char dsr_imp : 1 ; }; struct mmc_ext_csd { u8 rev ; u8 erase_group_def ; u8 sec_feature_support ; u8 rel_sectors ; u8 rel_param ; u8 part_config ; u8 cache_ctrl ; u8 rst_n_function ; u8 max_packed_writes ; u8 max_packed_reads ; u8 packed_event_en ; unsigned int part_time ; unsigned int sa_timeout ; unsigned int generic_cmd6_time ; unsigned int power_off_longtime ; u8 power_off_notification ; unsigned int hs_max_dtr ; unsigned int hs200_max_dtr ; unsigned int sectors ; unsigned int hc_erase_size ; unsigned int hc_erase_timeout ; unsigned int sec_trim_mult ; unsigned int sec_erase_mult ; unsigned int trim_timeout ; bool partition_setting_completed ; unsigned long long enhanced_area_offset ; unsigned int enhanced_area_size ; unsigned int cache_size ; bool hpi_en ; bool hpi ; unsigned int hpi_cmd ; bool bkops ; bool man_bkops_en ; unsigned int data_sector_size ; unsigned int data_tag_unit_size ; unsigned int boot_ro_lock ; bool boot_ro_lockable ; bool ffu_capable ; u8 fwrev[8U] ; u8 raw_exception_status ; u8 raw_partition_support ; u8 raw_rpmb_size_mult ; u8 raw_erased_mem_count ; u8 raw_ext_csd_structure ; u8 raw_card_type ; u8 out_of_int_time ; u8 raw_pwr_cl_52_195 ; u8 raw_pwr_cl_26_195 ; u8 raw_pwr_cl_52_360 ; u8 raw_pwr_cl_26_360 ; u8 raw_s_a_timeout ; u8 raw_hc_erase_gap_size ; u8 raw_erase_timeout_mult ; u8 raw_hc_erase_grp_size ; u8 raw_sec_trim_mult ; u8 raw_sec_erase_mult ; u8 raw_sec_feature_support ; u8 raw_trim_mult ; u8 raw_pwr_cl_200_195 ; u8 raw_pwr_cl_200_360 ; u8 raw_pwr_cl_ddr_52_195 ; u8 raw_pwr_cl_ddr_52_360 ; u8 raw_pwr_cl_ddr_200_360 ; u8 raw_bkops_status ; u8 raw_sectors[4U] ; unsigned int feature_support ; }; struct sd_scr { unsigned char sda_vsn ; unsigned char sda_spec3 ; unsigned char bus_widths ; unsigned char cmds ; }; struct sd_ssr { unsigned int au ; unsigned int erase_timeout ; unsigned int erase_offset ; }; struct sd_switch_caps { unsigned int hs_max_dtr ; unsigned int uhs_max_dtr ; unsigned int sd3_bus_mode ; unsigned int sd3_drv_type ; unsigned int sd3_curr_limit ; }; struct sdio_cccr { unsigned int sdio_vsn ; unsigned int sd_vsn ; unsigned char multi_block : 1 ; unsigned char low_speed : 1 ; unsigned char wide_bus : 1 ; unsigned char high_power : 1 ; unsigned char high_speed : 1 ; unsigned char disable_cd : 1 ; }; struct sdio_cis { unsigned short vendor ; unsigned short device ; unsigned short blksize ; unsigned int max_dtr ; }; struct mmc_ios; struct mmc_part { unsigned int size ; unsigned int part_cfg ; char name[20U] ; bool force_ro ; unsigned int area_type ; }; struct mmc_card { struct mmc_host *host ; struct device dev ; u32 ocr ; unsigned int rca ; unsigned int type ; unsigned int state ; unsigned int quirks ; unsigned int erase_size ; unsigned int erase_shift ; unsigned int pref_erase ; u8 erased_byte ; u32 raw_cid[4U] ; u32 raw_csd[4U] ; u32 raw_scr[2U] ; struct mmc_cid cid ; struct mmc_csd csd ; struct mmc_ext_csd ext_csd ; struct sd_scr scr ; struct sd_ssr ssr ; struct sd_switch_caps sw_caps ; unsigned int sdio_funcs ; struct sdio_cccr cccr ; struct sdio_cis cis ; struct sdio_func *sdio_func[7U] ; struct sdio_func *sdio_single_irq ; unsigned int num_info ; char const **info ; struct sdio_func_tuple *tuples ; unsigned int sd_bus_speed ; unsigned int mmc_avail_type ; struct dentry *debugfs_root ; struct mmc_part part[7U] ; unsigned int nr_parts ; }; struct mmc_ios { unsigned int clock ; unsigned short vdd ; unsigned char bus_mode ; unsigned char chip_select ; unsigned char power_mode ; unsigned char bus_width ; unsigned char timing ; unsigned char signal_voltage ; unsigned char drv_type ; }; struct mmc_host_ops { int (*enable)(struct mmc_host * ) ; int (*disable)(struct mmc_host * ) ; void (*post_req)(struct mmc_host * , struct mmc_request * , int ) ; void (*pre_req)(struct mmc_host * , struct mmc_request * , bool ) ; void (*request)(struct mmc_host * , struct mmc_request * ) ; void (*set_ios)(struct mmc_host * , struct mmc_ios * ) ; int (*get_ro)(struct mmc_host * ) ; int (*get_cd)(struct mmc_host * ) ; void (*enable_sdio_irq)(struct mmc_host * , int ) ; void (*init_card)(struct mmc_host * , struct mmc_card * ) ; int (*start_signal_voltage_switch)(struct mmc_host * , struct mmc_ios * ) ; int (*card_busy)(struct mmc_host * ) ; int (*execute_tuning)(struct mmc_host * , u32 ) ; int (*prepare_hs400_tuning)(struct mmc_host * , struct mmc_ios * ) ; int (*select_drive_strength)(unsigned int , int , int ) ; void (*hw_reset)(struct mmc_host * ) ; void (*card_event)(struct mmc_host * ) ; int (*multi_io_quirk)(struct mmc_card * , unsigned int , int ) ; }; struct mmc_async_req { struct mmc_request *mrq ; int (*err_check)(struct mmc_card * , struct mmc_async_req * ) ; }; struct mmc_slot { int cd_irq ; void *handler_priv ; }; struct mmc_context_info { bool is_done_rcv ; bool is_new_req ; bool is_waiting_last_req ; wait_queue_head_t wait ; spinlock_t lock ; }; struct regulator; struct mmc_pwrseq; struct mmc_supply { struct regulator *vmmc ; struct regulator *vqmmc ; }; struct mmc_bus_ops; struct mmc_host { struct device *parent ; struct device class_dev ; int index ; struct mmc_host_ops const *ops ; struct mmc_pwrseq *pwrseq ; unsigned int f_min ; unsigned int f_max ; unsigned int f_init ; u32 ocr_avail ; u32 ocr_avail_sdio ; u32 ocr_avail_sd ; u32 ocr_avail_mmc ; struct notifier_block pm_notify ; u32 max_current_330 ; u32 max_current_300 ; u32 max_current_180 ; u32 caps ; u32 caps2 ; mmc_pm_flag_t pm_caps ; int clk_requests ; unsigned int clk_delay ; bool clk_gated ; struct delayed_work clk_gate_work ; unsigned int clk_old ; spinlock_t clk_lock ; struct mutex clk_gate_mutex ; struct device_attribute clkgate_delay_attr ; unsigned long clkgate_delay ; unsigned int max_seg_size ; unsigned short max_segs ; unsigned short unused ; unsigned int max_req_size ; unsigned int max_blk_size ; unsigned int max_blk_count ; unsigned int max_busy_timeout ; spinlock_t lock ; struct mmc_ios ios ; unsigned char use_spi_crc : 1 ; unsigned char claimed : 1 ; unsigned char bus_dead : 1 ; unsigned char removed : 1 ; int rescan_disable ; int rescan_entered ; bool trigger_card_event ; struct mmc_card *card ; wait_queue_head_t wq ; struct task_struct *claimer ; int claim_cnt ; struct delayed_work detect ; int detect_change ; struct mmc_slot slot ; struct mmc_bus_ops const *bus_ops ; unsigned int bus_refs ; unsigned int sdio_irqs ; struct task_struct *sdio_irq_thread ; bool sdio_irq_pending ; atomic_t sdio_irq_thread_abort ; mmc_pm_flag_t pm_flags ; struct led_trigger *led ; bool regulator_enabled ; struct mmc_supply supply ; struct dentry *debugfs_root ; struct mmc_async_req *areq ; struct mmc_context_info context_info ; struct fault_attr fail_mmc_request ; unsigned int actual_clock ; unsigned int slotno ; int dsr_req ; u32 dsr ; unsigned long private[0U] ; }; typedef int ldv_map; struct usb_device; struct urb; struct ldv_thread_set { int number ; struct ldv_thread **threads ; }; struct ldv_thread { int identifier ; void (*function)(void * ) ; }; typedef _Bool ldv_set; long ldv__builtin_expect(long exp , long c ) ; void ldv_assume(int expression ) ; void ldv_linux_alloc_irq_check_alloc_flags(gfp_t flags ) ; void ldv_linux_alloc_irq_check_alloc_nonatomic(void) ; void ldv_linux_alloc_usb_lock_check_alloc_flags(gfp_t flags ) ; void ldv_linux_alloc_usb_lock_check_alloc_nonatomic(void) ; void *ldv_linux_drivers_base_class_create_class(void) ; int ldv_linux_drivers_base_class_register_class(void) ; void ldv_linux_kernel_rcu_update_lock_bh_check_for_read_section(void) ; void ldv_linux_kernel_rcu_update_lock_sched_check_for_read_section(void) ; void ldv_linux_kernel_rcu_update_lock_check_for_read_section(void) ; void ldv_linux_kernel_rcu_srcu_check_for_read_section(void) ; void *ldv_linux_usb_gadget_create_class(void) ; int ldv_linux_usb_gadget_register_class(void) ; void ldv_check_alloc_nonatomic(void) { { { ldv_linux_alloc_irq_check_alloc_nonatomic(); ldv_linux_alloc_usb_lock_check_alloc_nonatomic(); } return; } } void ldv_check_alloc_flags(gfp_t flags ) { { { ldv_linux_alloc_irq_check_alloc_flags(flags); ldv_linux_alloc_usb_lock_check_alloc_flags(flags); } return; } } void ldv_check_for_read_section(void) { { { ldv_linux_kernel_rcu_update_lock_bh_check_for_read_section(); ldv_linux_kernel_rcu_update_lock_sched_check_for_read_section(); ldv_linux_kernel_rcu_update_lock_check_for_read_section(); ldv_linux_kernel_rcu_srcu_check_for_read_section(); } return; } } void *ldv_create_class(void) { void *res1 ; void *tmp ; void *res2 ; void *tmp___0 ; { { tmp = ldv_linux_drivers_base_class_create_class(); res1 = tmp; tmp___0 = ldv_linux_usb_gadget_create_class(); res2 = tmp___0; ldv_assume((unsigned long )res1 == (unsigned long )res2); } return (res1); } } int ldv_register_class(void) { int res1 ; int tmp ; int res2 ; int tmp___0 ; { { tmp = ldv_linux_drivers_base_class_register_class(); res1 = tmp; tmp___0 = ldv_linux_usb_gadget_register_class(); res2 = tmp___0; ldv_assume(res1 == res2); } return (res1); } } void *ldv_err_ptr(long error ) ; long ldv_ptr_err(void const *ptr ) ; void *ldv_kzalloc(size_t size , gfp_t flags ) ; void *ldv_malloc_unknown_size(void) ; void *ldv_alloc_macro(gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static __u32 __fswab32(__u32 val ) { int tmp ; { { tmp = __builtin_bswap32(val); } return ((__u32 )tmp); } } __inline static __u64 __fswab64(__u64 val ) { long tmp ; { { tmp = __builtin_bswap64((unsigned long )val); } return ((__u64 )tmp); } } extern int printk(char const * , ...) ; extern void dump_stack(void) ; extern void __dynamic_pr_debug(struct _ddebug * , char const * , ...) ; extern void ___might_sleep(char const * , int , int ) ; 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; } } extern void __bad_percpu_size(void) ; extern struct task_struct *current_task ; __inline static struct task_struct *get_current(void) { struct task_struct *pfo_ret__ ; { { if (8UL == 1UL) { goto case_1; } else { } if (8UL == 2UL) { goto case_2; } else { } if (8UL == 4UL) { goto case_4; } else { } if (8UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_3658; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3658; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3658; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3658; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_3658: ; return (pfo_ret__); } } extern void *__memcpy(void * , void const * , size_t ) ; extern void *__memset(void * , int , size_t ) ; extern int memcmp(void const * , void const * , size_t ) ; extern int strncmp(char const * , char const * , __kernel_size_t ) ; extern __kernel_size_t strnlen(char const * , __kernel_size_t ) ; __inline static void *ERR_PTR(long error ) ; __inline static long PTR_ERR(void const *ptr ) ; __inline static bool IS_ERR(void const *ptr ) { long tmp ; { { tmp = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); } return (tmp != 0L); } } extern struct rb_node *rb_next(struct rb_node const * ) ; extern struct rb_node *rb_first(struct rb_root const * ) ; static void *ldv_vzalloc_95(unsigned long ldv_func_arg1 ) ; static void *ldv_vzalloc_96(unsigned long ldv_func_arg1 ) ; extern void vfree(void const * ) ; extern u32 crc32_le(u32 , unsigned char const * , size_t ) ; extern int _cond_resched(void) ; extern void kfree(void const * ) ; extern void kmem_cache_free(struct kmem_cache * , void * ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static int mtd_is_eccerr(int err ) { { return (err == -74); } } void ubi_dump_vol_info(struct ubi_volume const *vol ) ; void ubi_dump_vtbl_record(struct ubi_vtbl_record const *r , int idx ) ; void ubi_dump_av(struct ubi_ainf_volume const *av ) ; __inline static int ubi_dbg_chk_gen(struct ubi_device const *ubi ) { { return ((int )ubi->dbg.chk_gen); } } int ubi_add_to_av(struct ubi_device *ubi , struct ubi_attach_info *ai , int pnum , int ec , struct ubi_vid_hdr const *vid_hdr , int bitflips ) ; struct ubi_ainf_volume *ubi_find_av(struct ubi_attach_info const *ai , int vol_id ) ; void ubi_remove_av(struct ubi_attach_info *ai , struct ubi_ainf_volume *av ) ; struct ubi_ainf_peb *ubi_early_get_peb(struct ubi_device *ubi , struct ubi_attach_info *ai ) ; int ubi_change_vtbl_record(struct ubi_device *ubi , int idx , struct ubi_vtbl_record *vtbl_rec ) ; int ubi_vtbl_rename_volumes(struct ubi_device *ubi , struct list_head *rename_list ) ; int ubi_read_volume_table(struct ubi_device *ubi , struct ubi_attach_info *ai ) ; int ubi_eba_atomic_leb_change(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void const *buf , int len ) ; int ubi_io_read(struct ubi_device const *ubi , void *buf , int pnum , int offset , int len ) ; int ubi_io_write(struct ubi_device *ubi , void const *buf , int pnum , int offset , int len ) ; int ubi_io_write_vid_hdr(struct ubi_device *ubi , int pnum , struct ubi_vid_hdr *vid_hdr ) ; __inline static struct ubi_vid_hdr *ubi_zalloc_vid_hdr(struct ubi_device const *ubi , gfp_t gfp_flags ) { void *vid_hdr ; { { vid_hdr = kzalloc((size_t )ubi->vid_hdr_alsize, gfp_flags); } if ((unsigned long )vid_hdr == (unsigned long )((void *)0)) { return ((struct ubi_vid_hdr *)0); } else { } return ((struct ubi_vid_hdr *)vid_hdr + (unsigned long )ubi->vid_hdr_shift); } } __inline static void ubi_free_vid_hdr(struct ubi_device const *ubi , struct ubi_vid_hdr *vid_hdr ) { void *p ; { p = (void *)vid_hdr; if ((unsigned long )p == (unsigned long )((void *)0)) { return; } else { } { kfree((void const *)(p + - ((unsigned long )ubi->vid_hdr_shift))); } return; } } __inline static int ubi_io_read_data(struct ubi_device const *ubi , void *buf , int pnum , int offset , int len ) { struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___0 = ldv__builtin_expect(offset < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read_data", 974, tmp->pid); dump_stack(); } } else { } { tmp___1 = ubi_io_read(ubi, buf, pnum, offset + (int )ubi->leb_start, len); } return (tmp___1); } } __inline static int ubi_io_write_data(struct ubi_device *ubi , void const *buf , int pnum , int offset , int len ) { struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___0 = ldv__builtin_expect(offset < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write_data", 986, tmp->pid); dump_stack(); } } else { } { tmp___1 = ubi_io_write(ubi, buf, pnum, offset + ubi->leb_start, len); } return (tmp___1); } } __inline static int vol_id2idx(struct ubi_device const *ubi , int vol_id ) { { if (vol_id > 2147479550) { return ((vol_id + -2147479551) + (int )ubi->vtbl_slots); } else { return (vol_id); } } } static void self_vtbl_check(struct ubi_device const *ubi ) ; static struct ubi_vtbl_record empty_vtbl_record ; int ubi_change_vtbl_record(struct ubi_device *ubi , int idx , struct ubi_vtbl_record *vtbl_rec ) { int i ; int err ; uint32_t crc ; struct ubi_volume *layout_vol ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; __u32 tmp___3 ; { { tmp___0 = ldv__builtin_expect(idx < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_change_vtbl_record", 90, tmp->pid); dump_stack(); } } else { { tmp___1 = ldv__builtin_expect(idx >= ubi->vtbl_slots, 0L); } if (tmp___1 != 0L) { { tmp = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_change_vtbl_record", 90, tmp->pid); dump_stack(); } } else { } } { tmp___2 = vol_id2idx((struct ubi_device const *)ubi, 2147479551); layout_vol = ubi->volumes[tmp___2]; } if ((unsigned long )vtbl_rec == (unsigned long )((struct ubi_vtbl_record *)0)) { vtbl_rec = & empty_vtbl_record; } else { { crc = crc32_le(4294967295U, (unsigned char const *)vtbl_rec, 168UL); tmp___3 = __fswab32(crc); vtbl_rec->crc = tmp___3; } } { __memcpy((void *)ubi->vtbl + (unsigned long )idx, (void const *)vtbl_rec, 172UL); i = 0; } goto ldv_31420; ldv_31419: { err = ubi_eba_atomic_leb_change(ubi, layout_vol, i, (void const *)ubi->vtbl, ubi->vtbl_size); } if (err != 0) { return (err); } else { } i = i + 1; ldv_31420: ; if (i <= 1) { goto ldv_31419; } else { } { self_vtbl_check((struct ubi_device const *)ubi); } return (0); } } int ubi_vtbl_rename_volumes(struct ubi_device *ubi , struct list_head *rename_list ) { int i ; int err ; struct ubi_rename_entry *re ; struct ubi_volume *layout_vol ; struct list_head const *__mptr ; uint32_t crc ; struct ubi_volume *vol ; struct ubi_vtbl_record *vtbl_rec ; __u16 tmp ; __u32 tmp___0 ; struct list_head const *__mptr___0 ; int tmp___1 ; { __mptr = (struct list_head const *)rename_list->next; re = (struct ubi_rename_entry *)__mptr + 0xffffffffffffff70UL; goto ldv_31439; ldv_31438: vol = (re->desc)->vol; vtbl_rec = ubi->vtbl + (unsigned long )vol->vol_id; if (re->remove != 0) { { __memcpy((void *)vtbl_rec, (void const *)(& empty_vtbl_record), 172UL); } goto ldv_31437; } else { } { tmp = __fswab16((int )((__u16 )re->new_name_len)); vtbl_rec->name_len = tmp; __memcpy((void *)(& vtbl_rec->name), (void const *)(& re->new_name), (size_t )re->new_name_len); __memset((void *)(& vtbl_rec->name) + (unsigned long )re->new_name_len, 0, (size_t )(128 - re->new_name_len)); crc = crc32_le(4294967295U, (unsigned char const *)vtbl_rec, 168UL); tmp___0 = __fswab32(crc); vtbl_rec->crc = tmp___0; } ldv_31437: __mptr___0 = (struct list_head const *)re->list.next; re = (struct ubi_rename_entry *)__mptr___0 + 0xffffffffffffff70UL; ldv_31439: ; if ((unsigned long )(& re->list) != (unsigned long )rename_list) { goto ldv_31438; } else { } { tmp___1 = vol_id2idx((struct ubi_device const *)ubi, 2147479551); layout_vol = ubi->volumes[tmp___1]; i = 0; } goto ldv_31442; ldv_31441: { err = ubi_eba_atomic_leb_change(ubi, layout_vol, i, (void const *)ubi->vtbl, ubi->vtbl_size); } if (err != 0) { return (err); } else { } i = i + 1; ldv_31442: ; if (i <= 1) { goto ldv_31441; } else { } return (0); } } static int vtbl_check(struct ubi_device const *ubi , struct ubi_vtbl_record const *vtbl ) { int i ; int n ; int reserved_pebs ; int alignment ; int data_pad ; int vol_type ; int name_len ; int upd_marker ; int err ; uint32_t crc ; char const *name ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u16 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; int tmp___5 ; __kernel_size_t tmp___6 ; int len1 ; __u16 tmp___7 ; int len2 ; __u16 tmp___8 ; int tmp___9 ; { i = 0; goto ldv_31464; ldv_31463: { ___might_sleep("drivers/mtd/ubi/vtbl.c", 176, 0); _cond_resched(); tmp = __fswab32((vtbl + (unsigned long )i)->reserved_pebs); reserved_pebs = (int )tmp; tmp___0 = __fswab32((vtbl + (unsigned long )i)->alignment); alignment = (int )tmp___0; tmp___1 = __fswab32((vtbl + (unsigned long )i)->data_pad); data_pad = (int )tmp___1; upd_marker = (int )(vtbl + (unsigned long )i)->upd_marker; vol_type = (int )(vtbl + (unsigned long )i)->vol_type; tmp___2 = __fswab16((int )(vtbl + (unsigned long )i)->name_len); name_len = (int )tmp___2; name = (char const *)(& (vtbl + (unsigned long )i)->name); crc = crc32_le(4294967295U, (unsigned char const *)vtbl + (unsigned long )i, 168UL); tmp___4 = __fswab32((vtbl + (unsigned long )i)->crc); } if (tmp___4 != crc) { { tmp___3 = __fswab32((vtbl + (unsigned long )i)->crc); printk("\vubi%d error: %s: bad CRC at record %u: %#08x, not %#08x\n", ubi->ubi_num, "vtbl_check", i, crc, tmp___3); ubi_dump_vtbl_record(vtbl + (unsigned long )i, i); } return (1); } else { } if (reserved_pebs == 0) { { tmp___5 = memcmp((void const *)vtbl + (unsigned long )i, (void const *)(& empty_vtbl_record), 172UL); } if (tmp___5 != 0) { err = 2; goto bad; } else { } goto ldv_31462; } else { } if ((reserved_pebs < 0 || alignment < 0) || (data_pad < 0 || name_len < 0)) { err = 3; goto bad; } else { } if (alignment > (int )ubi->leb_size || alignment == 0) { err = 4; goto bad; } else { } n = alignment & ((int )ubi->min_io_size + -1); if (alignment != 1 && n != 0) { err = 5; goto bad; } else { } n = (int )ubi->leb_size % alignment; if (data_pad != n) { { printk("\vubi%d error: %s: bad data_pad, has to be %d\n", ubi->ubi_num, "vtbl_check", n); err = 6; } goto bad; } else { } if ((unsigned int )vol_type - 1U > 1U) { err = 7; goto bad; } else { } if ((unsigned int )upd_marker > 1U) { err = 8; goto bad; } else { } if (reserved_pebs > (int )ubi->good_peb_count) { { printk("\vubi%d error: %s: too large reserved_pebs %d, good PEBs %d\n", ubi->ubi_num, "vtbl_check", reserved_pebs, ubi->good_peb_count); err = 9; } goto bad; } else { } if (name_len > 127) { err = 10; goto bad; } else { } if ((int )((signed char )*name) == 0) { err = 11; goto bad; } else { } { tmp___6 = strnlen(name, (__kernel_size_t )(name_len + 1)); } if ((__kernel_size_t )name_len != tmp___6) { err = 12; goto bad; } else { } ldv_31462: i = i + 1; ldv_31464: ; if (i < (int )ubi->vtbl_slots) { goto ldv_31463; } else { } i = 0; goto ldv_31472; ldv_31471: n = i + 1; goto ldv_31469; ldv_31468: { tmp___7 = __fswab16((int )(vtbl + (unsigned long )i)->name_len); len1 = (int )tmp___7; tmp___8 = __fswab16((int )(vtbl + (unsigned long )n)->name_len); len2 = (int )tmp___8; } if (len1 > 0 && len1 == len2) { { tmp___9 = strncmp((char const *)(& (vtbl + (unsigned long )i)->name), (char const *)(& (vtbl + (unsigned long )n)->name), (__kernel_size_t )len1); } if (tmp___9 == 0) { { printk("\vubi%d error: %s: volumes %d and %d have the same name \"%s\"\n", ubi->ubi_num, "vtbl_check", i, n, (__u8 const *)(& (vtbl + (unsigned long )i)->name)); ubi_dump_vtbl_record(vtbl + (unsigned long )i, i); ubi_dump_vtbl_record(vtbl + (unsigned long )n, n); } return (-22); } else { } } else { } n = n + 1; ldv_31469: ; if (n < (int )ubi->vtbl_slots) { goto ldv_31468; } else { } i = i + 1; ldv_31472: ; if (i < (int )ubi->vtbl_slots + -1) { goto ldv_31471; } else { } return (0); bad: { printk("\vubi%d error: %s: volume table check failed: record %d, error %d\n", ubi->ubi_num, "vtbl_check", i, err); ubi_dump_vtbl_record(vtbl + (unsigned long )i, i); } return (-22); } } static int create_vtbl(struct ubi_device *ubi , struct ubi_attach_info *ai , int copy , void *vtbl ) { int err ; int tries ; struct ubi_vid_hdr *vid_hdr ; struct ubi_ainf_peb *new_aeb ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; bool tmp___2 ; __be32 tmp___3 ; __be32 tmp___4 ; __u32 tmp___5 ; __u64 tmp___6 ; { { tries = 0; descriptor.modname = "ubi"; descriptor.function = "create_vtbl"; descriptor.filename = "drivers/mtd/ubi/vtbl.c"; descriptor.format = "UBI DBG gen (pid %d): create volume table (copy #%d)\n"; descriptor.lineno = 302U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): create volume table (copy #%d)\n", tmp->pid, copy + 1); } } else { } { vid_hdr = ubi_zalloc_vid_hdr((struct ubi_device const *)ubi, 208U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } retry: { new_aeb = ubi_early_get_peb(ubi, ai); tmp___2 = IS_ERR((void const *)new_aeb); } if ((int )tmp___2) { { tmp___1 = PTR_ERR((void const *)new_aeb); err = (int )tmp___1; } goto out_free; } else { } { vid_hdr->vol_type = 1U; vid_hdr->vol_id = 4293918591U; vid_hdr->compat = 5U; tmp___4 = 0U; vid_hdr->data_pad = tmp___4; tmp___3 = tmp___4; vid_hdr->used_ebs = tmp___3; vid_hdr->data_size = tmp___3; tmp___5 = __fswab32((__u32 )copy); vid_hdr->lnum = tmp___5; ai->max_sqnum = ai->max_sqnum + 1ULL; tmp___6 = __fswab64(ai->max_sqnum); vid_hdr->sqnum = tmp___6; err = ubi_io_write_vid_hdr(ubi, new_aeb->pnum, vid_hdr); } if (err != 0) { goto write_error; } else { } { err = ubi_io_write_data(ubi, (void const *)vtbl, new_aeb->pnum, 0, ubi->vtbl_size); } if (err != 0) { goto write_error; } else { } { err = ubi_add_to_av(ubi, ai, new_aeb->pnum, new_aeb->ec, (struct ubi_vid_hdr const *)vid_hdr, 0); kmem_cache_free(ai->aeb_slab_cache, (void *)new_aeb); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); write_error: ; if (err == -5) { tries = tries + 1; if (tries <= 5) { { list_add(& new_aeb->u.list, & ai->erase); } goto retry; } else { } } else { } { kmem_cache_free(ai->aeb_slab_cache, (void *)new_aeb); } out_free: { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } } static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi , struct ubi_attach_info *ai , struct ubi_ainf_volume *av ) { int err ; struct rb_node *rb ; struct ubi_ainf_peb *aeb ; struct ubi_vtbl_record *leb[2U] ; int leb_corrupted[2U] ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct rb_node const *__mptr ; void *tmp___1 ; int tmp___2 ; struct rb_node const *__mptr___0 ; void *tmp___3 ; { { leb[0] = (struct ubi_vtbl_record *)0; leb[1] = (struct ubi_vtbl_record *)0; leb_corrupted[0] = 1; leb_corrupted[1] = 1; descriptor.modname = "ubi"; descriptor.function = "process_lvol"; descriptor.filename = "drivers/mtd/ubi/vtbl.c"; descriptor.format = "UBI DBG gen (pid %d): check layout volume\n"; descriptor.lineno = 403U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): check layout volume\n", tmp->pid); } } else { } { rb = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31507; ldv_31506: { tmp___1 = ldv_vzalloc_95((unsigned long )ubi->vtbl_size); leb[aeb->lnum] = (struct ubi_vtbl_record *)tmp___1; } if ((unsigned long )leb[aeb->lnum] == (unsigned long )((struct ubi_vtbl_record *)0)) { err = -12; goto out_free; } else { } { err = ubi_io_read_data((struct ubi_device const *)ubi, (void *)leb[aeb->lnum], aeb->pnum, 0, ubi->vtbl_size); } if (err == 5) { aeb->scrub = 1U; } else { { tmp___2 = mtd_is_eccerr(err); } if (tmp___2 != 0) { aeb->scrub = 1U; } else if (err != 0) { goto out_free; } else { } } { rb = rb_next((struct rb_node const *)rb); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr___0 = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31507: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_31506; } else { } err = -22; if ((unsigned long )leb[0] != (unsigned long )((struct ubi_vtbl_record *)0)) { { leb_corrupted[0] = vtbl_check((struct ubi_device const *)ubi, (struct ubi_vtbl_record const *)leb[0]); } if (leb_corrupted[0] < 0) { goto out_free; } else { } } else { } if (leb_corrupted[0] == 0) { if ((unsigned long )leb[1] != (unsigned long )((struct ubi_vtbl_record *)0)) { { leb_corrupted[1] = memcmp((void const *)leb[0], (void const *)leb[1], (size_t )ubi->vtbl_size); } } else { } if (leb_corrupted[1] != 0) { { printk("\fubi%d warning: %s: volume table copy #2 is corrupted\n", ubi->ubi_num, "process_lvol"); err = create_vtbl(ubi, ai, 1, (void *)leb[0]); } if (err != 0) { goto out_free; } else { } { printk("\rubi%d: volume table was restored\n", ubi->ubi_num); } } else { } { vfree((void const *)leb[1]); } return (leb[0]); } else { if ((unsigned long )leb[1] != (unsigned long )((struct ubi_vtbl_record *)0)) { { leb_corrupted[1] = vtbl_check((struct ubi_device const *)ubi, (struct ubi_vtbl_record const *)leb[1]); } if (leb_corrupted[1] < 0) { goto out_free; } else { } } else { } if (leb_corrupted[1] != 0) { { printk("\vubi%d error: %s: both volume tables are corrupted\n", ubi->ubi_num, "process_lvol"); } goto out_free; } else { } { printk("\fubi%d warning: %s: volume table copy #1 is corrupted\n", ubi->ubi_num, "process_lvol"); err = create_vtbl(ubi, ai, 0, (void *)leb[1]); } if (err != 0) { goto out_free; } else { } { printk("\rubi%d: volume table was restored\n", ubi->ubi_num); vfree((void const *)leb[0]); } return (leb[1]); } out_free: { vfree((void const *)leb[0]); vfree((void const *)leb[1]); tmp___3 = ERR_PTR((long )err); } return ((struct ubi_vtbl_record *)tmp___3); } } static struct ubi_vtbl_record *create_empty_lvol(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int i ; struct ubi_vtbl_record *vtbl ; void *tmp ; void *tmp___0 ; int err ; void *tmp___1 ; { { tmp = ldv_vzalloc_96((unsigned long )ubi->vtbl_size); vtbl = (struct ubi_vtbl_record *)tmp; } if ((unsigned long )vtbl == (unsigned long )((struct ubi_vtbl_record *)0)) { { tmp___0 = ERR_PTR(-12L); } return ((struct ubi_vtbl_record *)tmp___0); } else { } i = 0; goto ldv_31516; ldv_31515: { __memcpy((void *)vtbl + (unsigned long )i, (void const *)(& empty_vtbl_record), 172UL); i = i + 1; } ldv_31516: ; if (i < ubi->vtbl_slots) { goto ldv_31515; } else { } i = 0; goto ldv_31520; ldv_31519: { err = create_vtbl(ubi, ai, i, (void *)vtbl); } if (err != 0) { { vfree((void const *)vtbl); tmp___1 = ERR_PTR((long )err); } return ((struct ubi_vtbl_record *)tmp___1); } else { } i = i + 1; ldv_31520: ; if (i <= 1) { goto ldv_31519; } else { } return (vtbl); } } static int init_volumes(struct ubi_device *ubi , struct ubi_attach_info const *ai , struct ubi_vtbl_record const *vtbl ) { int i ; int reserved_pebs ; struct ubi_ainf_volume *av ; struct ubi_volume *vol ; __u32 tmp ; void *tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u16 tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; void *tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; int tmp___10 ; { reserved_pebs = 0; i = 0; goto ldv_31535; ldv_31534: { ___might_sleep("drivers/mtd/ubi/vtbl.c", 536, 0); _cond_resched(); tmp = __fswab32((vtbl + (unsigned long )i)->reserved_pebs); } if (tmp == 0U) { goto ldv_31532; } else { } { tmp___0 = kzalloc(2000UL, 208U); vol = (struct ubi_volume *)tmp___0; } if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { return (-12); } else { } { tmp___1 = __fswab32((vtbl + (unsigned long )i)->reserved_pebs); vol->reserved_pebs = (int )tmp___1; tmp___2 = __fswab32((vtbl + (unsigned long )i)->alignment); vol->alignment = (int )tmp___2; tmp___3 = __fswab32((vtbl + (unsigned long )i)->data_pad); vol->data_pad = (int )tmp___3; vol->upd_marker = (unsigned char )(vtbl + (unsigned long )i)->upd_marker; vol->vol_type = (unsigned int )((unsigned char )(vtbl + (unsigned long )i)->vol_type) == 1U ? 3 : 4; tmp___4 = __fswab16((int )(vtbl + (unsigned long )i)->name_len); vol->name_len = (int )tmp___4; vol->usable_leb_size = ubi->leb_size - vol->data_pad; __memcpy((void *)(& vol->name), (void const *)(& (vtbl + (unsigned long )i)->name), (size_t )vol->name_len); vol->name[vol->name_len] = 0; vol->vol_id = i; } if ((int )(vtbl + (unsigned long )i)->flags & 1) { if (ubi->autoresize_vol_id != -1) { { printk("\vubi%d error: %s: more than one auto-resize volume (%d and %d)\n", ubi->ubi_num, "init_volumes", ubi->autoresize_vol_id, i); kfree((void const *)vol); } return (-22); } else { } ubi->autoresize_vol_id = i; } else { } { tmp___6 = ldv__builtin_expect((unsigned long )ubi->volumes[i] != (unsigned long )((struct ubi_volume *)0), 0L); } if (tmp___6 != 0L) { { tmp___5 = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "init_volumes", 569, tmp___5->pid); dump_stack(); } } else { } ubi->volumes[i] = vol; ubi->vol_count = ubi->vol_count + 1; vol->ubi = ubi; reserved_pebs = reserved_pebs + vol->reserved_pebs; if (vol->vol_type == 3) { vol->used_ebs = vol->reserved_pebs; vol->last_eb_bytes = vol->usable_leb_size; vol->used_bytes = (long long )vol->used_ebs * (long long )vol->usable_leb_size; goto ldv_31532; } else { } { av = ubi_find_av(ai, i); } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0) || av->leb_count == 0) { goto ldv_31532; } else { } if (av->leb_count != av->used_ebs) { { printk("\fubi%d warning: %s: static volume %d misses %d LEBs - corrupted\n", ubi->ubi_num, "init_volumes", av->vol_id, av->used_ebs - av->leb_count); vol->corrupted = 1U; } goto ldv_31532; } else { } vol->used_ebs = av->used_ebs; vol->used_bytes = (long long )(vol->used_ebs + -1) * (long long )vol->usable_leb_size; vol->used_bytes = vol->used_bytes + (long long )av->last_data_size; vol->last_eb_bytes = av->last_data_size; ldv_31532: i = i + 1; ldv_31535: ; if (i < ubi->vtbl_slots) { goto ldv_31534; } else { } { tmp___7 = kzalloc(2000UL, 208U); vol = (struct ubi_volume *)tmp___7; } if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { return (-12); } else { } { vol->reserved_pebs = 2; vol->alignment = 1; vol->vol_type = 3; vol->name_len = 13; __memcpy((void *)(& vol->name), (void const *)"layout volume", (size_t )(vol->name_len + 1)); vol->usable_leb_size = ubi->leb_size; vol->used_ebs = vol->reserved_pebs; vol->last_eb_bytes = vol->reserved_pebs; vol->used_bytes = (long long )vol->used_ebs * (long long )(ubi->leb_size - vol->data_pad); vol->vol_id = 2147479551; vol->ref_count = 1; tmp___9 = ldv__builtin_expect((unsigned long )ubi->volumes[i] != (unsigned long )((struct ubi_volume *)0), 0L); } if (tmp___9 != 0L) { { tmp___8 = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "init_volumes", 637, tmp___8->pid); dump_stack(); } } else { } { tmp___10 = vol_id2idx((struct ubi_device const *)ubi, vol->vol_id); ubi->volumes[tmp___10] = vol; reserved_pebs = reserved_pebs + vol->reserved_pebs; ubi->vol_count = ubi->vol_count + 1; vol->ubi = ubi; } if (reserved_pebs > ubi->avail_pebs) { { printk("\vubi%d error: %s: not enough PEBs, required %d, available %d\n", ubi->ubi_num, "init_volumes", reserved_pebs, ubi->avail_pebs); } if (ubi->corr_peb_count != 0) { { printk("\vubi%d error: %s: %d PEBs are corrupted and not used\n", ubi->ubi_num, "init_volumes", ubi->corr_peb_count); } } else { } } else { } ubi->rsvd_pebs = ubi->rsvd_pebs + reserved_pebs; ubi->avail_pebs = ubi->avail_pebs - reserved_pebs; return (0); } } static int check_av(struct ubi_volume const *vol , struct ubi_ainf_volume const *av ) { int err ; { if ((int )av->highest_lnum >= (int )vol->reserved_pebs) { err = 1; goto bad; } else { } if ((int )av->leb_count > (int )vol->reserved_pebs) { err = 2; goto bad; } else { } if ((int )av->vol_type != (int )vol->vol_type) { err = 3; goto bad; } else { } if ((int )av->used_ebs > (int )vol->reserved_pebs) { err = 4; goto bad; } else { } if ((int )av->data_pad != (int )vol->data_pad) { err = 5; goto bad; } else { } return (0); bad: { printk("\vubi%d error: %s: bad attaching information, error %d\n", (vol->ubi)->ubi_num, "check_av", err); ubi_dump_av(av); ubi_dump_vol_info(vol); } return (-22); } } static int check_attaching_info(struct ubi_device const *ubi , struct ubi_attach_info *ai ) { int err ; int i ; struct ubi_ainf_volume *av ; struct ubi_volume *vol ; struct task_struct *tmp ; long tmp___0 ; { if (ai->vols_found > (int )ubi->vtbl_slots + 1) { { printk("\vubi%d error: %s: found %d volumes while attaching, maximum is %d + %d\n", ubi->ubi_num, "check_attaching_info", ai->vols_found, 1, ubi->vtbl_slots); } return (-22); } else { } if (ai->highest_vol_id >= (int )ubi->vtbl_slots + 1 && ai->highest_vol_id <= 2147479550) { { printk("\vubi%d error: %s: too large volume ID %d found\n", ubi->ubi_num, "check_attaching_info", ai->highest_vol_id); } return (-22); } else { } i = 0; goto ldv_31556; ldv_31555: { ___might_sleep("drivers/mtd/ubi/vtbl.c", 729, 0); _cond_resched(); av = ubi_find_av((struct ubi_attach_info const *)ai, i); vol = ubi->volumes[i]; } if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { if ((unsigned long )av != (unsigned long )((struct ubi_ainf_volume *)0)) { { ubi_remove_av(ai, av); } } else { } goto ldv_31554; } else { } if (vol->reserved_pebs == 0) { { tmp___0 = ldv__builtin_expect(i >= (int )ubi->vtbl_slots, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "check_attaching_info", 740, tmp->pid); dump_stack(); } } else { } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { goto ldv_31554; } else { } { printk("\rubi%d: finish volume %d removal\n", ubi->ubi_num, av->vol_id); ubi_remove_av(ai, av); } } else if ((unsigned long )av != (unsigned long )((struct ubi_ainf_volume *)0)) { { err = check_av((struct ubi_volume const *)vol, (struct ubi_ainf_volume const *)av); } if (err != 0) { return (err); } else { } } else { } ldv_31554: i = i + 1; ldv_31556: ; if (i < (int )ubi->vtbl_slots + 1) { goto ldv_31555; } else { } return (0); } } int ubi_read_volume_table(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int i ; int err ; struct ubi_ainf_volume *av ; long tmp ; bool tmp___0 ; long tmp___1 ; bool tmp___2 ; { empty_vtbl_record.crc = 1807947505U; ubi->vtbl_slots = (int )((unsigned long )ubi->leb_size / 172UL); if (ubi->vtbl_slots > 128) { ubi->vtbl_slots = 128; } else { } { ubi->vtbl_size = (int )((unsigned int )ubi->vtbl_slots * 172U); ubi->vtbl_size = (ubi->vtbl_size + (ubi->min_io_size + -1)) & - ubi->min_io_size; av = ubi_find_av((struct ubi_attach_info const *)ai, 2147479551); } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { if (ai->is_empty != 0) { { ubi->vtbl = create_empty_lvol(ubi, ai); tmp___0 = IS_ERR((void const *)ubi->vtbl); } if ((int )tmp___0) { { tmp = PTR_ERR((void const *)ubi->vtbl); } return ((int )tmp); } else { } } else { { printk("\vubi%d error: %s: the layout volume was not found\n", ubi->ubi_num, "ubi_read_volume_table"); } return (-22); } } else { if (av->leb_count > 2) { { printk("\vubi%d error: %s: too many LEBs (%d) in layout volume\n", ubi->ubi_num, "ubi_read_volume_table", av->leb_count); } return (-22); } else { } { ubi->vtbl = process_lvol(ubi, ai, av); tmp___2 = IS_ERR((void const *)ubi->vtbl); } if ((int )tmp___2) { { tmp___1 = PTR_ERR((void const *)ubi->vtbl); } return ((int )tmp___1); } else { } } { ubi->avail_pebs = ubi->good_peb_count - ubi->corr_peb_count; err = init_volumes(ubi, (struct ubi_attach_info const *)ai, (struct ubi_vtbl_record const *)ubi->vtbl); } if (err != 0) { goto out_free; } else { } { err = check_attaching_info((struct ubi_device const *)ubi, ai); } if (err != 0) { goto out_free; } else { } return (0); out_free: { vfree((void const *)ubi->vtbl); i = 0; } goto ldv_31568; ldv_31567: { kfree((void const *)ubi->volumes[i]); ubi->volumes[i] = (struct ubi_volume *)0; i = i + 1; } ldv_31568: ; if (i < ubi->vtbl_slots + 1) { goto ldv_31567; } else { } return (err); } } static void self_vtbl_check(struct ubi_device const *ubi ) { int tmp ; int tmp___0 ; { { tmp = ubi_dbg_chk_gen(ubi); } if (tmp == 0) { return; } else { } { tmp___0 = vtbl_check(ubi, (struct ubi_vtbl_record const *)ubi->vtbl); } if (tmp___0 != 0) { { printk("\vubi%d error: %s: self-check failed\n", ubi->ubi_num, "self_vtbl_check"); __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 *)"drivers/mtd/ubi/vtbl.c"), "i" (862), "i" (12UL)); __builtin_unreachable(); } } else { } return; } } __inline static void *ERR_PTR(long error ) { void *tmp ; { { tmp = ldv_err_ptr(error); } return (tmp); } } __inline static long PTR_ERR(void const *ptr ) { long tmp ; { { tmp = ldv_ptr_err(ptr); } return (tmp); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { { tmp = ldv_kzalloc(size, flags); } return (tmp); } } static void *ldv_vzalloc_95(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_vzalloc_96(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } int ldv_undef_int(void) ; void ldv_free(void *s ) ; void *ldv_xmalloc(size_t size ) ; extern void ldv_after_alloc(void * ) ; extern struct module __this_module ; extern int sprintf(char * , char const * , ...) ; extern int strcmp(char const * , char const * ) ; __inline static u64 div_u64_rem(u64 dividend , u32 divisor , u32 *remainder ) { { *remainder = (u32 )(dividend % (u64 )divisor); return (dividend / (u64 )divisor); } } __inline static u64 div_u64(u64 dividend , u32 divisor ) { u32 remainder ; u64 tmp ; { { tmp = div_u64_rem(dividend, divisor, & remainder); } return (tmp); } } void ldv_linux_kernel_locking_spinlock_spin_lock_volumes_lock_of_ubi_device(void) ; void ldv_linux_kernel_locking_spinlock_spin_unlock_volumes_lock_of_ubi_device(void) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; __inline static void spin_lock(spinlock_t *lock ) { { { _raw_spin_lock(& lock->__annonCompField18.rlock); } return; } } __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void spin_unlock(spinlock_t *lock ) { { { _raw_spin_unlock(& lock->__annonCompField18.rlock); } return; } } __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; extern void cdev_init(struct cdev * , struct file_operations const * ) ; static void ldv_cdev_init_102(struct cdev *ldv_func_arg1 , struct file_operations const *ldv_func_arg2 ) ; static void ldv_cdev_init_127(struct cdev *ldv_func_arg1 , struct file_operations const *ldv_func_arg2 ) ; extern int cdev_add(struct cdev * , dev_t , unsigned int ) ; extern void cdev_del(struct cdev * ) ; static void ldv_cdev_del_105(struct cdev *ldv_func_arg1 ) ; static void ldv_cdev_del_110(struct cdev *ldv_func_arg1 ) ; static void ldv_cdev_del_128(struct cdev *ldv_func_arg1 ) ; static void ldv_cdev_del_129(struct cdev *ldv_func_arg1 ) ; static void ldv_cdev_del_130(struct cdev *ldv_func_arg1 ) ; extern int device_create_file(struct device * , struct device_attribute const * ) ; extern void device_remove_file(struct device * , struct device_attribute const * ) ; extern int dev_set_name(struct device * , char const * , ...) ; extern int device_register(struct device * ) ; extern void device_unregister(struct device * ) ; extern struct device *get_device(struct device * ) ; extern void put_device(struct device * ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; struct file_operations const ubi_vol_cdev_operations ; struct class *ubi_class ; int ubi_create_volume(struct ubi_device *ubi , struct ubi_mkvol_req *req ) ; int ubi_remove_volume(struct ubi_volume_desc *desc , int no_vtbl ) ; int ubi_resize_volume(struct ubi_volume_desc *desc , int reserved_pebs ) ; int ubi_rename_volumes(struct ubi_device *ubi , struct list_head *rename_list ) ; int ubi_add_volume(struct ubi_device *ubi , struct ubi_volume *vol ) ; void ubi_free_volume(struct ubi_device *ubi , struct ubi_volume *vol ) ; void ubi_update_reserved(struct ubi_device *ubi ) ; int ubi_eba_unmap_leb(struct ubi_device *ubi , struct ubi_volume *vol , int lnum ) ; int ubi_wl_flush(struct ubi_device *ubi , int vol_id , int lnum ) ; struct ubi_device *ubi_get_device(int ubi_num ) ; void ubi_put_device(struct ubi_device *ubi ) ; int ubi_volume_notify(struct ubi_device *ubi , struct ubi_volume *vol , int ntype ) ; static int self_check_volumes(struct ubi_device *ubi ) ; static ssize_t vol_attribute_show(struct device *dev , struct device_attribute *attr , char *buf ) ; static struct device_attribute attr_vol_reserved_ebs = {{"reserved_ebs", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute attr_vol_type = {{"type", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute attr_vol_name = {{"name", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute attr_vol_corrupted = {{"corrupted", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute attr_vol_alignment = {{"alignment", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute attr_vol_usable_eb_size = {{"usable_eb_size", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute attr_vol_data_bytes = {{"data_bytes", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute attr_vol_upd_marker = {{"upd_marker", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & vol_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static ssize_t vol_attribute_show(struct device *dev , struct device_attribute *attr , char *buf ) { int ret ; struct ubi_volume *vol ; struct device const *__mptr ; struct ubi_device *ubi ; char const *tp ; struct task_struct *tmp ; long tmp___0 ; { { __mptr = (struct device const *)dev; vol = (struct ubi_volume *)__mptr; ubi = ubi_get_device((vol->ubi)->ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19L); } else { } { ldv_spin_lock_95(& ubi->volumes_lock); } if ((unsigned long )ubi->volumes[vol->vol_id] == (unsigned long )((struct ubi_volume *)0)) { { ldv_spin_unlock_96(& ubi->volumes_lock); ubi_put_device(ubi); } return (-19L); } else { } { vol->ref_count = vol->ref_count + 1; ldv_spin_unlock_96(& ubi->volumes_lock); } if ((unsigned long )attr == (unsigned long )(& attr_vol_reserved_ebs)) { { ret = sprintf(buf, "%d\n", vol->reserved_pebs); } } else if ((unsigned long )attr == (unsigned long )(& attr_vol_type)) { if (vol->vol_type == 3) { tp = "dynamic"; } else { tp = "static"; } { ret = sprintf(buf, "%s\n", tp); } } else if ((unsigned long )attr == (unsigned long )(& attr_vol_name)) { { ret = sprintf(buf, "%s\n", (char *)(& vol->name)); } } else if ((unsigned long )attr == (unsigned long )(& attr_vol_corrupted)) { { ret = sprintf(buf, "%d\n", (int )vol->corrupted); } } else if ((unsigned long )attr == (unsigned long )(& attr_vol_alignment)) { { ret = sprintf(buf, "%d\n", vol->alignment); } } else if ((unsigned long )attr == (unsigned long )(& attr_vol_usable_eb_size)) { { ret = sprintf(buf, "%d\n", vol->usable_leb_size); } } else if ((unsigned long )attr == (unsigned long )(& attr_vol_data_bytes)) { { ret = sprintf(buf, "%lld\n", vol->used_bytes); } } else if ((unsigned long )attr == (unsigned long )(& attr_vol_upd_marker)) { { ret = sprintf(buf, "%d\n", (int )vol->upd_marker); } } else { ret = -22; } { ldv_spin_lock_95(& ubi->volumes_lock); vol->ref_count = vol->ref_count + -1; tmp___0 = ldv__builtin_expect(vol->ref_count < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "vol_attribute_show", 117, tmp->pid); dump_stack(); } } else { } { ldv_spin_unlock_96(& ubi->volumes_lock); ubi_put_device(ubi); } return ((ssize_t )ret); } } static void vol_release(struct device *dev ) { struct ubi_volume *vol ; struct device const *__mptr ; { { __mptr = (struct device const *)dev; vol = (struct ubi_volume *)__mptr; kfree((void const *)vol->eba_tbl); kfree((void const *)vol); } return; } } static int volume_sysfs_init(struct ubi_device *ubi , struct ubi_volume *vol ) { int err ; { { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_reserved_ebs)); } if (err != 0) { return (err); } else { } { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_type)); } if (err != 0) { return (err); } else { } { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_name)); } if (err != 0) { return (err); } else { } { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_corrupted)); } if (err != 0) { return (err); } else { } { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_alignment)); } if (err != 0) { return (err); } else { } { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_usable_eb_size)); } if (err != 0) { return (err); } else { } { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_data_bytes)); } if (err != 0) { return (err); } else { } { err = device_create_file(& vol->dev, (struct device_attribute const *)(& attr_vol_upd_marker)); } return (err); } } static void volume_sysfs_close(struct ubi_volume *vol ) { { { device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_upd_marker)); device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_data_bytes)); device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_usable_eb_size)); device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_alignment)); device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_corrupted)); device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_name)); device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_type)); device_remove_file(& vol->dev, (struct device_attribute const *)(& attr_vol_reserved_ebs)); device_unregister(& vol->dev); } return; } } int ubi_create_volume(struct ubi_device *ubi , struct ubi_mkvol_req *req ) { int i ; int err ; int vol_id ; int do_free ; struct ubi_volume *vol ; struct ubi_vtbl_record vtbl_rec ; dev_t dev ; void *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; int tmp___4 ; u64 tmp___5 ; void *tmp___6 ; u64 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u16 tmp___11 ; { vol_id = req->vol_id; do_free = 1; if (ubi->ro_mode != 0) { return (-30); } else { } { tmp = kzalloc(2000UL, 208U); vol = (struct ubi_volume *)tmp; } if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { return (-12); } else { } { ldv_spin_lock_95(& ubi->volumes_lock); } if (vol_id == -1) { { descriptor.modname = "ubi"; descriptor.function = "ubi_create_volume"; descriptor.filename = "drivers/mtd/ubi/vmt.c"; descriptor.format = "UBI DBG gen (pid %d): search for vacant volume ID\n"; descriptor.lineno = 218U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): search for vacant volume ID\n", tmp___0->pid); } } else { } i = 0; goto ldv_31692; ldv_31691: ; if ((unsigned long )ubi->volumes[i] == (unsigned long )((struct ubi_volume *)0)) { vol_id = i; goto ldv_31690; } else { } i = i + 1; ldv_31692: ; if (i < ubi->vtbl_slots) { goto ldv_31691; } else { } ldv_31690: ; if (vol_id == -1) { { printk("\vubi%d error: %s: out of volume IDs\n", ubi->ubi_num, "ubi_create_volume"); err = -23; } goto out_unlock; } else { } req->vol_id = vol_id; } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_create_volume"; descriptor___0.filename = "drivers/mtd/ubi/vmt.c"; descriptor___0.format = "UBI DBG gen (pid %d): create device %d, volume %d, %llu bytes, type %d, name %s\n"; descriptor___0.lineno = 235U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): create device %d, volume %d, %llu bytes, type %d, name %s\n", tmp___2->pid, ubi->ubi_num, vol_id, (unsigned long long )req->bytes, (int )req->vol_type, (char *)(& req->name)); } } else { } err = -17; if ((unsigned long )ubi->volumes[vol_id] != (unsigned long )((struct ubi_volume *)0)) { { printk("\vubi%d error: %s: volume %d already exists\n", ubi->ubi_num, "ubi_create_volume", vol_id); } goto out_unlock; } else { } i = 0; goto ldv_31696; ldv_31695: ; if ((unsigned long )ubi->volumes[i] != (unsigned long )((struct ubi_volume *)0) && (ubi->volumes[i])->name_len == (int )req->name_len) { { tmp___4 = strcmp((char const *)(& (ubi->volumes[i])->name), (char const *)(& req->name)); } if (tmp___4 == 0) { { printk("\vubi%d error: %s: volume \"%s\" exists (ID %d)\n", ubi->ubi_num, "ubi_create_volume", (char *)(& req->name), i); } goto out_unlock; } else { } } else { } i = i + 1; ldv_31696: ; if (i < ubi->vtbl_slots) { goto ldv_31695; } else { } { vol->usable_leb_size = ubi->leb_size - ubi->leb_size % req->alignment; tmp___5 = div_u64((u64 )((req->bytes + (__s64 )vol->usable_leb_size) + -1LL), (u32 )vol->usable_leb_size); vol->reserved_pebs = (int )((unsigned int )vol->reserved_pebs + (unsigned int )tmp___5); } if (vol->reserved_pebs > ubi->avail_pebs) { { printk("\vubi%d error: %s: not enough PEBs, only %d available\n", ubi->ubi_num, "ubi_create_volume", ubi->avail_pebs); } if (ubi->corr_peb_count != 0) { { printk("\vubi%d error: %s: %d PEBs are corrupted and not used\n", ubi->ubi_num, "ubi_create_volume", ubi->corr_peb_count); } } else { } err = -28; goto out_unlock; } else { } { ubi->avail_pebs = ubi->avail_pebs - vol->reserved_pebs; ubi->rsvd_pebs = ubi->rsvd_pebs + vol->reserved_pebs; ldv_spin_unlock_96(& ubi->volumes_lock); vol->vol_id = vol_id; vol->alignment = req->alignment; vol->data_pad = ubi->leb_size % vol->alignment; vol->vol_type = (int )req->vol_type; vol->name_len = (int )req->name_len; __memcpy((void *)(& vol->name), (void const *)(& req->name), (size_t )vol->name_len); vol->ubi = ubi; err = ubi_wl_flush(ubi, vol_id, -1); } if (err != 0) { goto out_acc; } else { } { tmp___6 = kmalloc((unsigned long )vol->reserved_pebs * 4UL, 208U); vol->eba_tbl = (int *)tmp___6; } if ((unsigned long )vol->eba_tbl == (unsigned long )((int *)0)) { err = -12; goto out_acc; } else { } i = 0; goto ldv_31700; ldv_31699: *(vol->eba_tbl + (unsigned long )i) = -1; i = i + 1; ldv_31700: ; if (i < vol->reserved_pebs) { goto ldv_31699; } else { } if (vol->vol_type == 3) { vol->used_ebs = vol->reserved_pebs; vol->last_eb_bytes = vol->usable_leb_size; vol->used_bytes = (long long )vol->used_ebs * (long long )vol->usable_leb_size; } else { { tmp___7 = div_u64_rem((u64 )vol->used_bytes, (u32 )vol->usable_leb_size, (u32 *)(& vol->last_eb_bytes)); vol->used_ebs = (int )tmp___7; } if (vol->last_eb_bytes != 0) { vol->used_ebs = vol->used_ebs + 1; } else { vol->last_eb_bytes = vol->usable_leb_size; } } { ldv_cdev_init_102(& vol->cdev, & ubi_vol_cdev_operations); vol->cdev.owner = & __this_module; dev = (ubi->cdev.dev & 4293918720U) | (dev_t )(vol_id + 1); err = cdev_add(& vol->cdev, dev, 1U); } if (err != 0) { { printk("\vubi%d error: %s: cannot add character device\n", ubi->ubi_num, "ubi_create_volume"); } goto out_mapping; } else { } { vol->dev.release = & vol_release; vol->dev.parent = & ubi->dev; vol->dev.devt = dev; vol->dev.class = ubi_class; dev_set_name(& vol->dev, "%s_%d", (char *)(& ubi->ubi_name), vol->vol_id); err = device_register(& vol->dev); } if (err != 0) { { printk("\vubi%d error: %s: cannot register device\n", ubi->ubi_num, "ubi_create_volume"); } goto out_cdev; } else { } { err = volume_sysfs_init(ubi, vol); } if (err != 0) { goto out_sysfs; } else { } { __memset((void *)(& vtbl_rec), 0, 172UL); tmp___8 = __fswab32((__u32 )vol->reserved_pebs); vtbl_rec.reserved_pebs = tmp___8; tmp___9 = __fswab32((__u32 )vol->alignment); vtbl_rec.alignment = tmp___9; tmp___10 = __fswab32((__u32 )vol->data_pad); vtbl_rec.data_pad = tmp___10; tmp___11 = __fswab16((int )((__u16 )vol->name_len)); vtbl_rec.name_len = tmp___11; } if (vol->vol_type == 3) { vtbl_rec.vol_type = 1U; } else { vtbl_rec.vol_type = 2U; } { __memcpy((void *)(& vtbl_rec.name), (void const *)(& vol->name), (size_t )vol->name_len); err = ubi_change_vtbl_record(ubi, vol_id, & vtbl_rec); } if (err != 0) { goto out_sysfs; } else { } { ldv_spin_lock_95(& ubi->volumes_lock); ubi->volumes[vol_id] = vol; ubi->vol_count = ubi->vol_count + 1; ldv_spin_unlock_96(& ubi->volumes_lock); ubi_volume_notify(ubi, vol, 0); self_check_volumes(ubi); } return (err); out_sysfs: { do_free = 0; get_device(& vol->dev); volume_sysfs_close(vol); } out_cdev: { ldv_cdev_del_105(& vol->cdev); } out_mapping: ; if (do_free != 0) { { kfree((void const *)vol->eba_tbl); } } else { } out_acc: { ldv_spin_lock_95(& ubi->volumes_lock); ubi->rsvd_pebs = ubi->rsvd_pebs - vol->reserved_pebs; ubi->avail_pebs = ubi->avail_pebs + vol->reserved_pebs; } out_unlock: { ldv_spin_unlock_96(& ubi->volumes_lock); } if (do_free != 0) { { kfree((void const *)vol); } } else { { put_device(& vol->dev); } } { printk("\vubi%d error: %s: cannot create volume %d, error %d\n", ubi->ubi_num, "ubi_create_volume", vol_id, err); } return (err); } } int ubi_remove_volume(struct ubi_volume_desc *desc , int no_vtbl ) { struct ubi_volume *vol ; struct ubi_device *ubi ; int i ; int err ; int vol_id ; int reserved_pebs ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; { { vol = desc->vol; ubi = vol->ubi; vol_id = vol->vol_id; reserved_pebs = vol->reserved_pebs; descriptor.modname = "ubi"; descriptor.function = "ubi_remove_volume"; descriptor.filename = "drivers/mtd/ubi/vmt.c"; descriptor.format = "UBI DBG gen (pid %d): remove device %d, volume %d\n"; descriptor.lineno = 411U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): remove device %d, volume %d\n", tmp->pid, ubi->ubi_num, vol_id); } } else { } { tmp___2 = ldv__builtin_expect(desc->mode != 3, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_remove_volume", 412, tmp___1->pid); dump_stack(); } } else { } { tmp___4 = ldv__builtin_expect((unsigned long )vol != (unsigned long )ubi->volumes[vol_id], 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_remove_volume", 413, tmp___3->pid); dump_stack(); } } else { } if (ubi->ro_mode != 0) { return (-30); } else { } { ldv_spin_lock_95(& ubi->volumes_lock); } if (vol->ref_count > 1) { err = -16; goto out_unlock; } else { } { ubi->volumes[vol_id] = (struct ubi_volume *)0; ldv_spin_unlock_96(& ubi->volumes_lock); } if (no_vtbl == 0) { { err = ubi_change_vtbl_record(ubi, vol_id, (struct ubi_vtbl_record *)0); } if (err != 0) { goto out_err; } else { } } else { } i = 0; goto ldv_31720; ldv_31719: { err = ubi_eba_unmap_leb(ubi, vol, i); } if (err != 0) { goto out_err; } else { } i = i + 1; ldv_31720: ; if (i < vol->reserved_pebs) { goto ldv_31719; } else { } { ldv_cdev_del_110(& vol->cdev); volume_sysfs_close(vol); ldv_spin_lock_95(& ubi->volumes_lock); ubi->rsvd_pebs = ubi->rsvd_pebs - reserved_pebs; ubi->avail_pebs = ubi->avail_pebs + reserved_pebs; ubi_update_reserved(ubi); ubi->vol_count = ubi->vol_count + -1; ldv_spin_unlock_96(& ubi->volumes_lock); ubi_volume_notify(ubi, vol, 1); } if (no_vtbl == 0) { { self_check_volumes(ubi); } } else { } return (err); out_err: { printk("\vubi%d error: %s: cannot remove volume %d, error %d\n", ubi->ubi_num, "ubi_remove_volume", vol_id, err); ldv_spin_lock_95(& ubi->volumes_lock); ubi->volumes[vol_id] = vol; } out_unlock: { ldv_spin_unlock_96(& ubi->volumes_lock); } return (err); } } int ubi_resize_volume(struct ubi_volume_desc *desc , int reserved_pebs ) { int i ; int err ; int pebs ; int *new_mapping ; struct ubi_volume *vol ; struct ubi_device *ubi ; struct ubi_vtbl_record vtbl_rec ; int vol_id ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; __u32 tmp___2 ; { vol = desc->vol; ubi = vol->ubi; vol_id = vol->vol_id; if (ubi->ro_mode != 0) { return (-30); } else { } { descriptor.modname = "ubi"; descriptor.function = "ubi_resize_volume"; descriptor.filename = "drivers/mtd/ubi/vmt.c"; descriptor.format = "UBI DBG gen (pid %d): re-size device %d, volume %d to from %d to %d PEBs\n"; descriptor.lineno = 488U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): re-size device %d, volume %d to from %d to %d PEBs\n", tmp->pid, ubi->ubi_num, vol_id, vol->reserved_pebs, reserved_pebs); } } else { } if (vol->vol_type == 4 && reserved_pebs < vol->used_ebs) { { printk("\vubi%d error: %s: too small size %d, %d LEBs contain data\n", ubi->ubi_num, "ubi_resize_volume", reserved_pebs, vol->used_ebs); } return (-22); } else { } if (reserved_pebs == vol->reserved_pebs) { return (0); } else { } { tmp___1 = kmalloc((unsigned long )reserved_pebs * 4UL, 208U); new_mapping = (int *)tmp___1; } if ((unsigned long )new_mapping == (unsigned long )((int *)0)) { return (-12); } else { } i = 0; goto ldv_31737; ldv_31736: *(new_mapping + (unsigned long )i) = -1; i = i + 1; ldv_31737: ; if (i < reserved_pebs) { goto ldv_31736; } else { } { ldv_spin_lock_95(& ubi->volumes_lock); } if (vol->ref_count > 1) { { ldv_spin_unlock_96(& ubi->volumes_lock); err = -16; } goto out_free; } else { } { ldv_spin_unlock_96(& ubi->volumes_lock); pebs = reserved_pebs - vol->reserved_pebs; } if (pebs > 0) { { ldv_spin_lock_95(& ubi->volumes_lock); } if (pebs > ubi->avail_pebs) { { printk("\vubi%d error: %s: not enough PEBs: requested %d, available %d\n", ubi->ubi_num, "ubi_resize_volume", pebs, ubi->avail_pebs); } if (ubi->corr_peb_count != 0) { { printk("\vubi%d error: %s: %d PEBs are corrupted and not used\n", ubi->ubi_num, "ubi_resize_volume", ubi->corr_peb_count); } } else { } { ldv_spin_unlock_96(& ubi->volumes_lock); err = -28; } goto out_free; } else { } ubi->avail_pebs = ubi->avail_pebs - pebs; ubi->rsvd_pebs = ubi->rsvd_pebs + pebs; i = 0; goto ldv_31741; ldv_31740: *(new_mapping + (unsigned long )i) = *(vol->eba_tbl + (unsigned long )i); i = i + 1; ldv_31741: ; if (i < vol->reserved_pebs) { goto ldv_31740; } else { } { kfree((void const *)vol->eba_tbl); vol->eba_tbl = new_mapping; ldv_spin_unlock_96(& ubi->volumes_lock); } } else { } { vtbl_rec = *(ubi->vtbl + (unsigned long )vol_id); tmp___2 = __fswab32((__u32 )reserved_pebs); vtbl_rec.reserved_pebs = tmp___2; err = ubi_change_vtbl_record(ubi, vol_id, & vtbl_rec); } if (err != 0) { goto out_acc; } else { } if (pebs < 0) { i = 0; goto ldv_31745; ldv_31744: { err = ubi_eba_unmap_leb(ubi, vol, reserved_pebs + i); } if (err != 0) { goto out_acc; } else { } i = i + 1; ldv_31745: ; if (i < - pebs) { goto ldv_31744; } else { } { ldv_spin_lock_95(& ubi->volumes_lock); ubi->rsvd_pebs = ubi->rsvd_pebs + pebs; ubi->avail_pebs = ubi->avail_pebs - pebs; ubi_update_reserved(ubi); i = 0; } goto ldv_31748; ldv_31747: *(new_mapping + (unsigned long )i) = *(vol->eba_tbl + (unsigned long )i); i = i + 1; ldv_31748: ; if (i < reserved_pebs) { goto ldv_31747; } else { } { kfree((void const *)vol->eba_tbl); vol->eba_tbl = new_mapping; ldv_spin_unlock_96(& ubi->volumes_lock); } } else { } vol->reserved_pebs = reserved_pebs; if (vol->vol_type == 3) { vol->used_ebs = reserved_pebs; vol->last_eb_bytes = vol->usable_leb_size; vol->used_bytes = (long long )vol->used_ebs * (long long )vol->usable_leb_size; } else { } { ubi_volume_notify(ubi, vol, 2); self_check_volumes(ubi); } return (err); out_acc: ; if (pebs > 0) { { ldv_spin_lock_95(& ubi->volumes_lock); ubi->rsvd_pebs = ubi->rsvd_pebs - pebs; ubi->avail_pebs = ubi->avail_pebs + pebs; ldv_spin_unlock_96(& ubi->volumes_lock); } } else { } out_free: { kfree((void const *)new_mapping); } return (err); } } int ubi_rename_volumes(struct ubi_device *ubi , struct list_head *rename_list ) { int err ; struct ubi_rename_entry *re ; struct list_head const *__mptr ; struct ubi_volume *vol ; struct list_head const *__mptr___0 ; { { err = ubi_vtbl_rename_volumes(ubi, rename_list); } if (err != 0) { return (err); } else { } __mptr = (struct list_head const *)rename_list->next; re = (struct ubi_rename_entry *)__mptr + 0xffffffffffffff70UL; goto ldv_31763; ldv_31762: ; if (re->remove != 0) { { err = ubi_remove_volume(re->desc, 1); } if (err != 0) { goto ldv_31760; } else { } } else { { vol = (re->desc)->vol; ldv_spin_lock_95(& ubi->volumes_lock); vol->name_len = re->new_name_len; __memcpy((void *)(& vol->name), (void const *)(& re->new_name), (size_t )(re->new_name_len + 1)); ldv_spin_unlock_96(& ubi->volumes_lock); ubi_volume_notify(ubi, vol, 3); } } __mptr___0 = (struct list_head const *)re->list.next; re = (struct ubi_rename_entry *)__mptr___0 + 0xffffffffffffff70UL; ldv_31763: ; if ((unsigned long )(& re->list) != (unsigned long )rename_list) { goto ldv_31762; } else { } ldv_31760: ; if (err == 0) { { self_check_volumes(ubi); } } else { } return (err); } } int ubi_add_volume(struct ubi_device *ubi , struct ubi_volume *vol ) { int err ; int vol_id ; dev_t dev ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { { vol_id = vol->vol_id; descriptor.modname = "ubi"; descriptor.function = "ubi_add_volume"; descriptor.filename = "drivers/mtd/ubi/vmt.c"; descriptor.format = "UBI DBG gen (pid %d): add volume %d\n"; descriptor.lineno = 640U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): add volume %d\n", tmp->pid, vol_id); } } else { } { ldv_cdev_init_127(& vol->cdev, & ubi_vol_cdev_operations); vol->cdev.owner = & __this_module; dev = (ubi->cdev.dev & 4293918720U) | (dev_t )(vol->vol_id + 1); err = cdev_add(& vol->cdev, dev, 1U); } if (err != 0) { { printk("\vubi%d error: %s: cannot add character device for volume %d, error %d\n", ubi->ubi_num, "ubi_add_volume", vol_id, err); } return (err); } else { } { vol->dev.release = & vol_release; vol->dev.parent = & ubi->dev; vol->dev.devt = dev; vol->dev.class = ubi_class; dev_set_name(& vol->dev, "%s_%d", (char *)(& ubi->ubi_name), vol->vol_id); err = device_register(& vol->dev); } if (err != 0) { goto out_cdev; } else { } { err = volume_sysfs_init(ubi, vol); } if (err != 0) { { ldv_cdev_del_128(& vol->cdev); volume_sysfs_close(vol); } return (err); } else { } { self_check_volumes(ubi); } return (err); out_cdev: { ldv_cdev_del_129(& vol->cdev); } return (err); } } void ubi_free_volume(struct ubi_device *ubi , struct ubi_volume *vol ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_free_volume"; descriptor.filename = "drivers/mtd/ubi/vmt.c"; descriptor.format = "UBI DBG gen (pid %d): free volume %d\n"; descriptor.lineno = 687U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): free volume %d\n", tmp->pid, vol->vol_id); } } else { } { ubi->volumes[vol->vol_id] = (struct ubi_volume *)0; ldv_cdev_del_130(& vol->cdev); volume_sysfs_close(vol); } return; } } static int self_check_volume(struct ubi_device *ubi , int vol_id ) { int idx ; int tmp ; int reserved_pebs ; int alignment ; int data_pad ; int vol_type ; int name_len ; int upd_marker ; struct ubi_volume const *vol ; long long n ; char const *name ; __u32 tmp___0 ; __kernel_size_t tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u16 tmp___4 ; int tmp___5 ; { { tmp = vol_id2idx((struct ubi_device const *)ubi, vol_id); idx = tmp; ldv_spin_lock_95(& ubi->volumes_lock); tmp___0 = __fswab32((ubi->vtbl + (unsigned long )vol_id)->reserved_pebs); reserved_pebs = (int )tmp___0; vol = (struct ubi_volume const *)ubi->volumes[idx]; } if ((unsigned long )vol == (unsigned long )((struct ubi_volume const *)0)) { if (reserved_pebs != 0) { { printk("\vubi%d error: %s: no volume info, but volume exists\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } { ldv_spin_unlock_96(& ubi->volumes_lock); } return (0); } else { } if ((((int )vol->reserved_pebs < 0 || (int )vol->alignment < 0) || (int )vol->data_pad < 0) || (int )vol->name_len < 0) { { printk("\vubi%d error: %s: negative values\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if ((int )vol->alignment > ubi->leb_size || (int )vol->alignment == 0) { { printk("\vubi%d error: %s: bad alignment\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } n = (long long )((int )vol->alignment & (ubi->min_io_size + -1)); if ((int )vol->alignment != 1 && n != 0LL) { { printk("\vubi%d error: %s: alignment is not multiple of min I/O unit\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } n = (long long )(ubi->leb_size % (int )vol->alignment); if ((long long )vol->data_pad != n) { { printk("\vubi%d error: %s: bad data_pad, has to be %lld\n", ubi->ubi_num, "self_check_volume", n); } goto fail; } else { } if ((unsigned int )vol->vol_type - 3U > 1U) { { printk("\vubi%d error: %s: bad vol_type\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) == 6U) { { printk("\vubi%d error: %s: update marker and corrupted simultaneously\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if ((int )vol->reserved_pebs > ubi->good_peb_count) { { printk("\vubi%d error: %s: too large reserved_pebs\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } n = (long long )(ubi->leb_size - (int )vol->data_pad); if ((int )vol->usable_leb_size != ubi->leb_size - (int )vol->data_pad) { { printk("\vubi%d error: %s: bad usable_leb_size, has to be %lld\n", ubi->ubi_num, "self_check_volume", n); } goto fail; } else { } if ((int )vol->name_len > 127) { { printk("\vubi%d error: %s: too long volume name, max is %d\n", ubi->ubi_num, "self_check_volume", 127); } goto fail; } else { } { tmp___1 = strnlen((char const *)(& vol->name), (__kernel_size_t )((int )vol->name_len + 1)); n = (long long )tmp___1; } if (n != (long long )vol->name_len) { { printk("\vubi%d error: %s: bad name_len %lld\n", ubi->ubi_num, "self_check_volume", n); } goto fail; } else { } n = (long long )vol->used_ebs * (long long )vol->usable_leb_size; if ((int )vol->vol_type == 3) { if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { printk("\vubi%d error: %s: corrupted dynamic volume\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if ((int )vol->used_ebs != (int )vol->reserved_pebs) { { printk("\vubi%d error: %s: bad used_ebs\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if ((int )vol->last_eb_bytes != (int )vol->usable_leb_size) { { printk("\vubi%d error: %s: bad last_eb_bytes\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if ((long long )vol->used_bytes != n) { { printk("\vubi%d error: %s: bad used_bytes\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } } else { if ((int )vol->used_ebs < 0 || (int )vol->used_ebs > (int )vol->reserved_pebs) { { printk("\vubi%d error: %s: bad used_ebs\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if ((int )vol->last_eb_bytes < 0 || (int )vol->last_eb_bytes > (int )vol->usable_leb_size) { { printk("\vubi%d error: %s: bad last_eb_bytes\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } if (((long long )vol->used_bytes < 0LL || (long long )vol->used_bytes > n) || (long long )vol->used_bytes < n - (long long )vol->usable_leb_size) { { printk("\vubi%d error: %s: bad used_bytes\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } } { tmp___2 = __fswab32((ubi->vtbl + (unsigned long )vol_id)->alignment); alignment = (int )tmp___2; tmp___3 = __fswab32((ubi->vtbl + (unsigned long )vol_id)->data_pad); data_pad = (int )tmp___3; tmp___4 = __fswab16((int )(ubi->vtbl + (unsigned long )vol_id)->name_len); name_len = (int )tmp___4; upd_marker = (int )(ubi->vtbl + (unsigned long )vol_id)->upd_marker; name = (char const *)(& (ubi->vtbl + (unsigned long )vol_id)->name); } if ((unsigned int )(ubi->vtbl + (unsigned long )vol_id)->vol_type == 1U) { vol_type = 3; } else { vol_type = 4; } if ((((alignment != (int )vol->alignment || data_pad != (int )vol->data_pad) || upd_marker != (int )vol->upd_marker) || vol_type != (int )vol->vol_type) || name_len != (int )vol->name_len) { { printk("\vubi%d error: %s: volume info is different\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { { tmp___5 = strncmp(name, (char const *)(& vol->name), (__kernel_size_t )name_len); } if (tmp___5 != 0) { { printk("\vubi%d error: %s: volume info is different\n", ubi->ubi_num, "self_check_volume"); } goto fail; } else { } } { ldv_spin_unlock_96(& ubi->volumes_lock); } return (0); fail: { printk("\vubi%d error: %s: self-check failed for volume %d\n", ubi->ubi_num, "self_check_volume", vol_id); } if ((unsigned long )vol != (unsigned long )((struct ubi_volume const *)0)) { { ubi_dump_vol_info(vol); } } else { } { ubi_dump_vtbl_record((struct ubi_vtbl_record const *)ubi->vtbl + (unsigned long )vol_id, vol_id); dump_stack(); ldv_spin_unlock_96(& ubi->volumes_lock); } return (-22); } } static int self_check_volumes(struct ubi_device *ubi ) { int i ; int err ; int tmp ; { { err = 0; tmp = ubi_dbg_chk_gen((struct ubi_device const *)ubi); } if (tmp == 0) { return (0); } else { } i = 0; goto ldv_31803; ldv_31802: { err = self_check_volume(ubi, i); } if (err != 0) { goto ldv_31801; } else { } i = i + 1; ldv_31803: ; if (i < ubi->vtbl_slots) { goto ldv_31802; } else { } ldv_31801: ; return (err); } } void ldv_cdev_del(void *arg0 , struct cdev *arg1 ) ; void ldv_cdev_init(void *arg0 , struct cdev *arg1 , struct file_operations *arg2 ) ; void ldv_dummy_resourceless_instance_callback_4_3(long (*arg0)(struct device * , struct device_attribute * , char * ) , struct device *arg1 , struct device_attribute *arg2 , char *arg3 ) ; void ldv_struct_device_attribute_dummy_resourceless_instance_4(void *arg0 ) ; struct ldv_thread ldv_thread_4 ; void ldv_dummy_resourceless_instance_callback_4_3(long (*arg0)(struct device * , struct device_attribute * , char * ) , struct device *arg1 , struct device_attribute *arg2 , char *arg3 ) { { { vol_attribute_show(arg1, arg2, arg3); } return; } } void ldv_struct_device_attribute_dummy_resourceless_instance_4(void *arg0 ) { long (*ldv_4_callback_show)(struct device * , struct device_attribute * , char * ) ; struct device_attribute *ldv_4_container_struct_device_attribute ; struct device *ldv_4_container_struct_device_ptr ; char *ldv_4_ldv_param_3_2_default ; void *tmp ; int tmp___0 ; { goto ldv_call_4; return; ldv_call_4: { tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { { tmp = ldv_xmalloc(1UL); ldv_4_ldv_param_3_2_default = (char *)tmp; ldv_dummy_resourceless_instance_callback_4_3(ldv_4_callback_show, ldv_4_container_struct_device_ptr, ldv_4_container_struct_device_attribute, ldv_4_ldv_param_3_2_default); ldv_free((void *)ldv_4_ldv_param_3_2_default); } goto ldv_call_4; } else { return; } return; } } __inline static void *kmalloc(size_t size , gfp_t flags ) { void *res ; { { ldv_check_alloc_flags(flags); res = ldv_malloc_unknown_size(); ldv_after_alloc(res); } return (res); } } __inline static void ldv_spin_lock_95(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_lock_volumes_lock_of_ubi_device(); spin_lock(lock); } return; } } __inline static void ldv_spin_unlock_96(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_unlock_volumes_lock_of_ubi_device(); spin_unlock(lock); } return; } } static void ldv_cdev_init_102(struct cdev *ldv_func_arg1 , struct file_operations const *ldv_func_arg2 ) { { { cdev_init(ldv_func_arg1, ldv_func_arg2); ldv_cdev_init((void *)0, ldv_func_arg1, (struct file_operations *)ldv_func_arg2); } return; } } static void ldv_cdev_del_105(struct cdev *ldv_func_arg1 ) { { { cdev_del(ldv_func_arg1); ldv_cdev_del((void *)0, ldv_func_arg1); } return; } } static void ldv_cdev_del_110(struct cdev *ldv_func_arg1 ) { { { cdev_del(ldv_func_arg1); ldv_cdev_del((void *)0, ldv_func_arg1); } return; } } static void ldv_cdev_init_127(struct cdev *ldv_func_arg1 , struct file_operations const *ldv_func_arg2 ) { { { cdev_init(ldv_func_arg1, ldv_func_arg2); ldv_cdev_init((void *)0, ldv_func_arg1, (struct file_operations *)ldv_func_arg2); } return; } } static void ldv_cdev_del_128(struct cdev *ldv_func_arg1 ) { { { cdev_del(ldv_func_arg1); ldv_cdev_del((void *)0, ldv_func_arg1); } return; } } static void ldv_cdev_del_129(struct cdev *ldv_func_arg1 ) { { { cdev_del(ldv_func_arg1); ldv_cdev_del((void *)0, ldv_func_arg1); } return; } } static void ldv_cdev_del_130(struct cdev *ldv_func_arg1 ) { { { cdev_del(ldv_func_arg1); ldv_cdev_del((void *)0, ldv_func_arg1); } return; } } static void ldv_mutex_lock_95(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_97(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(struct mutex *lock ) ; extern void might_fault(void) ; __inline static struct task_struct *get_current___1(void) { struct task_struct *pfo_ret__ ; { { if (8UL == 1UL) { goto case_1; } else { } if (8UL == 2UL) { goto case_2; } else { } if (8UL == 4UL) { goto case_4; } else { } if (8UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_3666; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3666; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3666; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3666; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_3666: ; return (pfo_ret__); } } static void ldv_mutex_unlock_96(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_98(struct mutex *ldv_func_arg1 ) ; static void *ldv_vmalloc_99(unsigned long ldv_func_arg1 ) ; static void *ldv_vmalloc_100(unsigned long ldv_func_arg1 ) ; extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; extern void __copy_from_user_overflow(void) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; long tmp ; long tmp___0 ; { { sz = -1; might_fault(); tmp = ldv__builtin_expect(sz < 0, 1L); } if (tmp != 0L) { { n = _copy_from_user(to, from, (unsigned int )n); } } else { { tmp___0 = ldv__builtin_expect((unsigned long )sz >= n, 1L); } if (tmp___0 != 0L) { { n = _copy_from_user(to, from, (unsigned int )n); } } else { { __copy_from_user_overflow(); } } } return (n); } } int ubi_start_update(struct ubi_device *ubi , struct ubi_volume *vol , long long bytes ) ; int ubi_more_update_data(struct ubi_device *ubi , struct ubi_volume *vol , void const *buf , int count ) ; int ubi_start_leb_change(struct ubi_device *ubi , struct ubi_volume *vol , struct ubi_leb_change_req const *req ) ; int ubi_more_leb_change_data(struct ubi_device *ubi , struct ubi_volume *vol , void const *buf , int count ) ; int ubi_calc_data_len(struct ubi_device const *ubi , void const *buf , int length ) ; int ubi_eba_write_leb(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void const *buf , int offset , int len ) ; int ubi_eba_write_leb_st(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void const *buf , int len , int used_ebs ) ; static int set_update_marker(struct ubi_device *ubi , struct ubi_volume *vol ) { int err ; struct ubi_vtbl_record vtbl_rec ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; { { descriptor.modname = "ubi"; descriptor.function = "set_update_marker"; descriptor.filename = "drivers/mtd/ubi/upd.c"; descriptor.format = "UBI DBG gen (pid %d): set update marker for volume %d\n"; descriptor.lineno = 59U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): set update marker for volume %d\n", tmp->pid, vol->vol_id); } } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { tmp___2 = ldv__builtin_expect((unsigned int )(ubi->vtbl + (unsigned long )vol->vol_id)->upd_marker == 0U, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "set_update_marker", 62, tmp___1->pid); dump_stack(); } } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "set_update_marker"; descriptor___0.filename = "drivers/mtd/ubi/upd.c"; descriptor___0.format = "UBI DBG gen (pid %d): already set\n"; descriptor___0.lineno = 63U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): already set\n", tmp___3->pid); } } else { } return (0); } else { } { vtbl_rec = *(ubi->vtbl + (unsigned long )vol->vol_id); vtbl_rec.upd_marker = 1U; ldv_mutex_lock_95(& ubi->device_mutex); err = ubi_change_vtbl_record(ubi, vol->vol_id, & vtbl_rec); vol->upd_marker = 1U; ldv_mutex_unlock_96(& ubi->device_mutex); } return (err); } } static int clear_update_marker(struct ubi_device *ubi , struct ubi_volume *vol , long long bytes ) { int err ; struct ubi_vtbl_record vtbl_rec ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; u64 tmp___4 ; { { descriptor.modname = "ubi"; descriptor.function = "clear_update_marker"; descriptor.filename = "drivers/mtd/ubi/upd.c"; descriptor.format = "UBI DBG gen (pid %d): clear update marker for volume %d\n"; descriptor.lineno = 93U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): clear update marker for volume %d\n", tmp->pid, vol->vol_id); } } else { } { vtbl_rec = *(ubi->vtbl + (unsigned long )vol->vol_id); tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)vol + 1992UL) == 0U, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "clear_update_marker", 96, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect((unsigned int )vtbl_rec.upd_marker == 0U, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "clear_update_marker", 96, tmp___1->pid); dump_stack(); } } else { } } vtbl_rec.upd_marker = 0U; if (vol->vol_type == 4) { { vol->corrupted = 0U; vol->used_bytes = bytes; tmp___4 = div_u64_rem((u64 )bytes, (u32 )vol->usable_leb_size, (u32 *)(& vol->last_eb_bytes)); vol->used_ebs = (int )tmp___4; } if (vol->last_eb_bytes != 0) { vol->used_ebs = vol->used_ebs + 1; } else { vol->last_eb_bytes = vol->usable_leb_size; } } else { } { ldv_mutex_lock_97(& ubi->device_mutex); err = ubi_change_vtbl_record(ubi, vol->vol_id, & vtbl_rec); vol->upd_marker = 0U; ldv_mutex_unlock_98(& ubi->device_mutex); } return (err); } } int ubi_start_update(struct ubi_device *ubi , struct ubi_volume *vol , long long bytes ) { int i ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; u64 tmp___3 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_start_update"; descriptor.filename = "drivers/mtd/ubi/upd.c"; descriptor.format = "UBI DBG gen (pid %d): start update of volume %d, %llu bytes\n"; descriptor.lineno = 132U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): start update of volume %d, %llu bytes\n", tmp->pid, vol->vol_id, bytes); } } else { } { tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)vol + 1992UL) != 0U, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_start_update", 133, tmp___1->pid); dump_stack(); } } else { } { vol->updating = 1U; vol->upd_buf = ldv_vmalloc_99((unsigned long )ubi->leb_size); } if ((unsigned long )vol->upd_buf == (unsigned long )((void *)0)) { return (-12); } else { } { err = set_update_marker(ubi, vol); } if (err != 0) { return (err); } else { } i = 0; goto ldv_31412; ldv_31411: { err = ubi_eba_unmap_leb(ubi, vol, i); } if (err != 0) { return (err); } else { } i = i + 1; ldv_31412: ; if (i < vol->reserved_pebs) { goto ldv_31411; } else { } if (bytes == 0LL) { { err = ubi_wl_flush(ubi, -1, -1); } if (err != 0) { return (err); } else { } { err = clear_update_marker(ubi, vol, 0LL); } if (err != 0) { return (err); } else { } { vfree((void const *)vol->upd_buf); vol->updating = 0U; } return (0); } else { } { tmp___3 = div_u64((u64 )((bytes + (long long )vol->usable_leb_size) + -1LL), (u32 )vol->usable_leb_size); vol->upd_ebs = (int )tmp___3; vol->upd_bytes = bytes; vol->upd_received = 0LL; } return (0); } } int ubi_start_leb_change(struct ubi_device *ubi , struct ubi_volume *vol , struct ubi_leb_change_req const *req ) { struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; int tmp___3 ; { { tmp___0 = ldv__builtin_expect((unsigned int )*((unsigned char *)vol + 1992UL) != 0U, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_start_leb_change", 184, tmp->pid); dump_stack(); } } else { } { descriptor.modname = "ubi"; descriptor.function = "ubi_start_leb_change"; descriptor.filename = "drivers/mtd/ubi/upd.c"; descriptor.format = "UBI DBG gen (pid %d): start changing LEB %d:%d, %u bytes\n"; descriptor.lineno = 187U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): start changing LEB %d:%d, %u bytes\n", tmp___1->pid, vol->vol_id, req->lnum, req->bytes); } } else { } if ((int )req->bytes == 0) { { tmp___3 = ubi_eba_atomic_leb_change(ubi, vol, req->lnum, (void const *)0, 0); } return (tmp___3); } else { } { vol->upd_bytes = (long long )req->bytes; vol->upd_received = 0LL; vol->changing_leb = 1U; vol->ch_lnum = req->lnum; vol->upd_buf = ldv_vmalloc_100((unsigned long )req->bytes); } if ((unsigned long )vol->upd_buf == (unsigned long )((void *)0)) { return (-12); } else { } return (0); } } static int write_leb(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void *buf , int len , int used_ebs ) { int err ; int l ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { if (vol->vol_type == 3) { { l = (len + (ubi->min_io_size + -1)) & - ubi->min_io_size; __memset(buf + (unsigned long )len, 255, (size_t )(l - len)); len = ubi_calc_data_len((struct ubi_device const *)ubi, (void const *)buf, l); } if (len == 0) { { descriptor.modname = "ubi"; descriptor.function = "write_leb"; descriptor.filename = "drivers/mtd/ubi/upd.c"; descriptor.format = "UBI DBG gen (pid %d): all %d bytes contain 0xFF - skip\n"; descriptor.lineno = 243U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): all %d bytes contain 0xFF - skip\n", tmp->pid, len); } } else { } return (0); } else { } { err = ubi_eba_write_leb(ubi, vol, lnum, (void const *)buf, 0, len); } } else { { __memset(buf + (unsigned long )len, 0, (size_t )(vol->usable_leb_size - len)); err = ubi_eba_write_leb_st(ubi, vol, lnum, (void const *)buf, len, used_ebs); } } return (err); } } int ubi_more_update_data(struct ubi_device *ubi , struct ubi_volume *vol , void const *buf , int count ) { int lnum ; int offs ; int err ; int len ; int to_write ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; u64 tmp___1 ; unsigned long tmp___2 ; int flush_len ; struct task_struct *tmp___3 ; long tmp___4 ; unsigned long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; { { err = 0; to_write = count; descriptor.modname = "ubi"; descriptor.function = "ubi_more_update_data"; descriptor.filename = "drivers/mtd/ubi/upd.c"; descriptor.format = "UBI DBG gen (pid %d): write %d of %lld bytes, %lld already passed\n"; descriptor.lineno = 284U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): write %d of %lld bytes, %lld already passed\n", tmp->pid, count, vol->upd_bytes, vol->upd_received); } } else { } if (ubi->ro_mode != 0) { return (-30); } else { } { tmp___1 = div_u64_rem((u64 )vol->upd_received, (u32 )vol->usable_leb_size, (u32 *)(& offs)); lnum = (int )tmp___1; } if (vol->upd_received + (long long )count > vol->upd_bytes) { count = (int )((unsigned int )vol->upd_bytes - (unsigned int )vol->upd_received); to_write = count; } else { } if (offs != 0) { len = vol->usable_leb_size - offs; if (len > count) { len = count; } else { } { tmp___2 = copy_from_user(vol->upd_buf + (unsigned long )offs, buf, (unsigned long )len); err = (int )tmp___2; } if (err != 0) { return (-14); } else { } if (offs + len == vol->usable_leb_size || vol->upd_received + (long long )len == vol->upd_bytes) { { flush_len = offs + len; tmp___4 = ldv__builtin_expect(flush_len > vol->usable_leb_size, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_more_update_data", 321, tmp___3->pid); dump_stack(); } } else { } { err = write_leb(ubi, vol, lnum, vol->upd_buf, flush_len, vol->upd_ebs); } if (err != 0) { return (err); } else { } } else { } vol->upd_received = vol->upd_received + (long long )len; count = count - len; buf = buf + (unsigned long )len; lnum = lnum + 1; } else { } goto ldv_31449; ldv_31448: ; if (count > vol->usable_leb_size) { len = vol->usable_leb_size; } else { len = count; } { tmp___5 = copy_from_user(vol->upd_buf, buf, (unsigned long )len); err = (int )tmp___5; } if (err != 0) { return (-14); } else { } if (len == vol->usable_leb_size || vol->upd_received + (long long )len == vol->upd_bytes) { { err = write_leb(ubi, vol, lnum, vol->upd_buf, len, vol->upd_ebs); } if (err != 0) { goto ldv_31447; } else { } } else { } vol->upd_received = vol->upd_received + (long long )len; count = count - len; lnum = lnum + 1; buf = buf + (unsigned long )len; ldv_31449: ; if (count != 0) { goto ldv_31448; } else { } ldv_31447: { tmp___7 = ldv__builtin_expect(vol->upd_received > vol->upd_bytes, 0L); } if (tmp___7 != 0L) { { tmp___6 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_more_update_data", 362, tmp___6->pid); dump_stack(); } } else { } if (vol->upd_received == vol->upd_bytes) { { err = ubi_wl_flush(ubi, -1, -1); } if (err != 0) { return (err); } else { } { err = clear_update_marker(ubi, vol, vol->upd_bytes); } if (err != 0) { return (err); } else { } { vol->updating = 0U; err = to_write; vfree((void const *)vol->upd_buf); } } else { } return (err); } } int ubi_more_leb_change_data(struct ubi_device *ubi , struct ubi_volume *vol , void const *buf , int count ) { int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; unsigned long tmp___1 ; int len ; struct task_struct *tmp___2 ; long tmp___3 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_more_leb_change_data"; descriptor.filename = "drivers/mtd/ubi/upd.c"; descriptor.format = "UBI DBG gen (pid %d): write %d of %lld bytes, %lld already passed\n"; descriptor.lineno = 399U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): write %d of %lld bytes, %lld already passed\n", tmp->pid, count, vol->upd_bytes, vol->upd_received); } } else { } if (ubi->ro_mode != 0) { return (-30); } else { } if (vol->upd_received + (long long )count > vol->upd_bytes) { count = (int )((unsigned int )vol->upd_bytes - (unsigned int )vol->upd_received); } else { } { tmp___1 = copy_from_user(vol->upd_buf + (unsigned long )vol->upd_received, buf, (unsigned long )count); err = (int )tmp___1; } if (err != 0) { return (-14); } else { } vol->upd_received = vol->upd_received + (long long )count; if (vol->upd_received == vol->upd_bytes) { { len = ((int )vol->upd_bytes + (ubi->min_io_size + -1)) & - ubi->min_io_size; __memset(vol->upd_buf + (unsigned long )vol->upd_bytes, 255, (size_t )((long long )len - vol->upd_bytes)); len = ubi_calc_data_len((struct ubi_device const *)ubi, (void const *)vol->upd_buf, len); err = ubi_eba_atomic_leb_change(ubi, vol, vol->ch_lnum, (void const *)vol->upd_buf, len); } if (err != 0) { return (err); } else { } } else { } { tmp___3 = ldv__builtin_expect(vol->upd_received > vol->upd_bytes, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_more_leb_change_data", 425, tmp___2->pid); dump_stack(); } } else { } if (vol->upd_received == vol->upd_bytes) { { vol->changing_leb = 0U; err = count; vfree((void const *)vol->upd_buf); } } else { } return (err); } } static void ldv_mutex_lock_95(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_96(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_97(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_98(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void *ldv_vmalloc_99(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_vmalloc_100(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } void ldv_stop(void) ; void ldv_linux_arch_io_check_final_state(void) ; void ldv_linux_block_genhd_check_final_state(void) ; void ldv_linux_block_queue_check_final_state(void) ; void ldv_linux_block_request_check_final_state(void) ; void ldv_linux_drivers_base_class_destroy_class(struct class *cls ) ; void ldv_linux_drivers_base_class_check_final_state(void) ; int ldv_linux_fs_char_dev_register_chrdev_region(void) ; void ldv_linux_fs_char_dev_unregister_chrdev_region(void) ; void ldv_linux_fs_char_dev_check_final_state(void) ; void ldv_linux_fs_sysfs_check_final_state(void) ; void ldv_linux_kernel_locking_rwlock_check_final_state(void) ; void ldv_linux_kernel_module_check_final_state(void) ; void ldv_linux_kernel_rcu_update_lock_bh_check_final_state(void) ; void ldv_linux_kernel_rcu_update_lock_sched_check_final_state(void) ; void ldv_linux_kernel_rcu_update_lock_check_final_state(void) ; void ldv_linux_kernel_rcu_srcu_check_final_state(void) ; void ldv_linux_lib_find_bit_initialize(void) ; void ldv_linux_lib_idr_check_final_state(void) ; void ldv_linux_mmc_sdio_func_check_final_state(void) ; void ldv_linux_net_register_reset_error_counter(void) ; void ldv_linux_net_rtnetlink_check_final_state(void) ; void ldv_linux_net_sock_check_final_state(void) ; void ldv_linux_usb_coherent_check_final_state(void) ; void ldv_linux_usb_gadget_destroy_class(struct class *cls ) ; int ldv_linux_usb_gadget_register_chrdev_region(void) ; void ldv_linux_usb_gadget_unregister_chrdev_region(void) ; void ldv_linux_usb_gadget_check_final_state(void) ; void ldv_linux_usb_register_reset_error_counter(void) ; void ldv_linux_usb_urb_check_final_state(void) ; static void ldv_ldv_initialize_133(void) ; int ldv_post_init(int init_ret_val ) ; static int ldv_ldv_post_init_130(int ldv_func_arg1 ) ; static void ldv_ldv_check_final_state_131(void) ; static void ldv_ldv_check_final_state_132(void) ; static void ldv_mutex_lock_95___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_120(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_122(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_126(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(struct mutex *lock ) ; __inline static bool is_power_of_2(unsigned long n ) { { return ((bool )(n != 0UL && (n & (n - 1UL)) == 0UL)); } } extern int kstrtoint(char const * , unsigned int , int * ) ; extern unsigned long simple_strtoul(char const * , char ** , unsigned int ) ; __inline static struct task_struct *get_current___2(void) { struct task_struct *pfo_ret__ ; { { if (8UL == 1UL) { goto case_1; } else { } if (8UL == 2UL) { goto case_2; } else { } if (8UL == 4UL) { goto case_4; } else { } if (8UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_3690; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3690; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3690; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3690; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_3690: ; return (pfo_ret__); } } extern char *strcpy(char * , char const * ) ; extern char *strsep(char ** , char const * ) ; __inline static void *ERR_PTR(long error ) ; __inline static long PTR_ERR(void const *ptr ) ; void ldv_linux_kernel_locking_spinlock_spin_lock_ubi_devices_lock(void) ; void ldv_linux_kernel_locking_spinlock_spin_unlock_ubi_devices_lock(void) ; void ldv_linux_kernel_locking_spinlock_spin_lock_wl_lock_of_ubi_device(void) ; void ldv_linux_kernel_locking_spinlock_spin_unlock_wl_lock_of_ubi_device(void) ; extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; static void ldv_mutex_unlock_96___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_121(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_123(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_127(struct mutex *ldv_func_arg1 ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->__annonCompField18.rlock); } } __inline static void ldv_spin_lock_97(spinlock_t *lock ) ; __inline static void ldv_spin_lock_97(spinlock_t *lock ) ; __inline static void ldv_spin_lock_97(spinlock_t *lock ) ; __inline static void ldv_spin_lock_97(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_97(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_98(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_98(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_98(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_98(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_98(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_98(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_98(spinlock_t *lock ) ; static void ldv_cdev_init_107(struct cdev *ldv_func_arg1 , struct file_operations const *ldv_func_arg2 ) ; static void ldv_cdev_del_108(struct cdev *ldv_func_arg1 ) ; static void ldv_cdev_del_110___0(struct cdev *ldv_func_arg1 ) ; extern void __init_rwsem(struct rw_semaphore * , char const * , struct lock_class_key * ) ; extern int blocking_notifier_call_chain(struct blocking_notifier_head * , unsigned long , void * ) ; static void *ldv_vmalloc_112(unsigned long ldv_func_arg1 ) ; static void *ldv_vzalloc_113(unsigned long ldv_func_arg1 ) ; extern int class_create_file_ns(struct class * , struct class_attribute const * , void const * ) ; __inline static int class_create_file(struct class *class , struct class_attribute const *attr ) { int tmp ; { { tmp = class_create_file_ns(class, attr, (void const *)0); } return (tmp); } } __inline static void class_remove_file(struct class *class , struct class_attribute const *attr ) { { return; } } static void ldv_class_destroy_125(struct class *cls ) ; static void ldv_class_destroy_129(struct class *cls ) ; extern void path_put(struct path const * ) ; __inline static unsigned int iminor(struct inode const *inode ) { { return ((unsigned int )inode->i_rdev & 1048575U); } } __inline static unsigned int imajor(struct inode const *inode ) { { return ((unsigned int )(inode->i_rdev >> 20)); } } extern int alloc_chrdev_region(dev_t * , unsigned int , unsigned int , char const * ) ; static int ldv_alloc_chrdev_region_106(dev_t *ldv_func_arg1 , unsigned int ldv_func_arg2 , unsigned int ldv_func_arg3 , char const *ldv_func_arg4 ) ; extern void unregister_chrdev_region(dev_t , unsigned int ) ; static void ldv_unregister_chrdev_region_109(dev_t ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; static void ldv_unregister_chrdev_region_111(dev_t ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; extern int kern_path(char const * , unsigned int , struct path * ) ; extern int misc_register(struct miscdevice * ) ; static int ldv_misc_register_119(struct miscdevice *ldv_func_arg1 ) ; extern int misc_deregister(struct miscdevice * ) ; static int ldv_misc_deregister_124(struct miscdevice *ldv_func_arg1 ) ; static int ldv_misc_deregister_128(struct miscdevice *ldv_func_arg1 ) ; extern uint64_t mtd_get_device_size(struct mtd_info const * ) ; extern int wake_up_process(struct task_struct * ) ; extern struct task_struct *kthread_create_on_node(int (*)(void * ) , void * , int , char const * , ...) ; extern int kthread_stop(struct task_struct * ) ; extern struct kmem_cache *kmem_cache_create(char const * , size_t , size_t , unsigned long , void (*)(void * ) ) ; extern void kmem_cache_destroy(struct kmem_cache * ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static uint32_t mtd_div_by_eb(uint64_t sz , struct mtd_info *mtd ) { uint32_t __base ; uint32_t __rem ; { if (mtd->erasesize_shift != 0U) { return ((uint32_t )(sz >> (int )mtd->erasesize_shift)); } else { } __base = mtd->erasesize; __rem = (uint32_t )(sz % (uint64_t )__base); sz = sz / (uint64_t )__base; return ((uint32_t )sz); } } __inline static int mtd_can_have_bb(struct mtd_info const *mtd ) { { return ((unsigned long )mtd->_block_isbad != (unsigned long )((int (*/* const */)(struct mtd_info * , loff_t ))0)); } } extern struct mtd_info *get_mtd_device(struct mtd_info * , int ) ; extern struct mtd_info *get_mtd_device_nm(char const * ) ; extern void put_mtd_device(struct mtd_info * ) ; int ubi_debugfs_init(void) ; void ubi_debugfs_exit(void) ; int ubi_debugfs_init_dev(struct ubi_device *ubi ) ; void ubi_debugfs_exit_dev(struct ubi_device *ubi ) ; struct kmem_cache *ubi_wl_entry_slab ; struct file_operations const ubi_ctrl_cdev_operations ; struct file_operations const ubi_cdev_operations ; struct class *ubi_class ; struct mutex ubi_devices_mutex ; struct blocking_notifier_head ubi_notifiers ; int ubi_attach(struct ubi_device *ubi , int force_scan ) ; void ubi_wl_close(struct ubi_device *ubi ) ; int ubi_thread(void *u ) ; int ubi_attach_mtd_dev(struct mtd_info *mtd , int ubi_num , int vid_hdr_offset , int max_beb_per1024 ) ; int ubi_detach_mtd_dev(int ubi_num , int anyway ) ; struct ubi_device *ubi_get_by_major(int major ) ; int ubi_major2num(int major ) ; int ubi_notify_all(struct ubi_device *ubi , int ntype , struct notifier_block *nb ) ; int ubi_enumerate_volumes(struct notifier_block *nb ) ; void ubi_free_internal_volumes(struct ubi_device *ubi ) ; void ubi_do_get_device_info(struct ubi_device *ubi , struct ubi_device_info *di ) ; void ubi_do_get_volume_info(struct ubi_device *ubi , struct ubi_volume *vol , struct ubi_volume_info *vi ) ; size_t ubi_calc_fm_size(struct ubi_device *ubi ) ; int ubi_update_fastmap(struct ubi_device *ubi ) ; int ubiblock_init(void) ; void ubiblock_exit(void) ; __inline static void ubi_ro_mode(struct ubi_device *ubi ) { { if (ubi->ro_mode == 0) { { ubi->ro_mode = 1; printk("\fubi%d warning: %s: switch to read-only mode\n", ubi->ubi_num, "ubi_ro_mode"); dump_stack(); } } else { } return; } } static int mtd_devs ; static struct mtd_dev_param mtd_dev_param[32U] ; static bool fm_autoconvert ; static struct miscdevice ubi_ctrl_cdev = {255, "ubi_ctrl", & ubi_ctrl_cdev_operations, {0, 0}, 0, 0, 0, (unsigned short)0}; static struct ubi_device *ubi_devices[32U] ; struct mutex ubi_devices_mutex = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, (void *)-1, {0, {0, 0}, "ubi_devices_mutex.wait_lock", 0, 0UL}}}}, {& ubi_devices_mutex.wait_list, & ubi_devices_mutex.wait_list}, 0, (void *)(& ubi_devices_mutex), {0, {0, 0}, "ubi_devices_mutex", 0, 0UL}}; static spinlock_t ubi_devices_lock = {{{{{0U}}, 3735899821U, 4294967295U, (void *)-1, {0, {0, 0}, "ubi_devices_lock", 0, 0UL}}}}; static ssize_t ubi_version_show(struct class *class , struct class_attribute *attr , char *buf ) { int tmp ; { { tmp = sprintf(buf, "%d\n", 1); } return ((ssize_t )tmp); } } static struct class_attribute ubi_version = {{"version", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & ubi_version_show, (ssize_t (*)(struct class * , struct class_attribute * , char const * , size_t ))0}; static ssize_t dev_attribute_show(struct device *dev , struct device_attribute *attr , char *buf ) ; static struct device_attribute dev_eraseblock_size = {{"eraseblock_size", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_avail_eraseblocks = {{"avail_eraseblocks", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_total_eraseblocks = {{"total_eraseblocks", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_volumes_count = {{"volumes_count", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_max_ec = {{"max_ec", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_reserved_for_bad = {{"reserved_for_bad", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_bad_peb_count = {{"bad_peb_count", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_max_vol_count = {{"max_vol_count", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_min_io_size = {{"min_io_size", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_bgt_enabled = {{"bgt_enabled", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; static struct device_attribute dev_mtd_num = {{"mtd_num", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & dev_attribute_show, (ssize_t (*)(struct device * , struct device_attribute * , char const * , size_t ))0}; int ubi_volume_notify(struct ubi_device *ubi , struct ubi_volume *vol , int ntype ) { struct ubi_notification nt ; int tmp ; int tmp___0 ; { { ubi_do_get_device_info(ubi, & nt.di); ubi_do_get_volume_info(ubi, vol, & nt.vi); } { if (ntype == 0) { goto case_0; } else { } if (ntype == 1) { goto case_1; } else { } if (ntype == 2) { goto case_2; } else { } if (ntype == 3) { goto case_3; } else { } goto switch_break; case_0: /* CIL Label */ ; case_1: /* CIL Label */ ; case_2: /* CIL Label */ ; case_3: /* CIL Label */ { tmp = ubi_update_fastmap(ubi); } if (tmp != 0) { { printk("\vubi%d error: %s: Unable to update fastmap!\n", ubi->ubi_num, "ubi_volume_notify"); ubi_ro_mode(ubi); } } else { } switch_break: /* CIL Label */ ; } { tmp___0 = blocking_notifier_call_chain(& ubi_notifiers, (unsigned long )ntype, (void *)(& nt)); } return (tmp___0); } } int ubi_notify_all(struct ubi_device *ubi , int ntype , struct notifier_block *nb ) { struct ubi_notification nt ; int i ; int count ; { { count = 0; ubi_do_get_device_info(ubi, & nt.di); ldv_mutex_lock_95___0(& ubi->device_mutex); i = 0; } goto ldv_32682; ldv_32681: ; if ((unsigned long )ubi->volumes[i] == (unsigned long )((struct ubi_volume *)0)) { goto ldv_32680; } else { } { ubi_do_get_volume_info(ubi, ubi->volumes[i], & nt.vi); } if ((unsigned long )nb != (unsigned long )((struct notifier_block *)0)) { { (*(nb->notifier_call))(nb, (unsigned long )ntype, (void *)(& nt)); } } else { { blocking_notifier_call_chain(& ubi_notifiers, (unsigned long )ntype, (void *)(& nt)); } } count = count + 1; ldv_32680: i = i + 1; ldv_32682: ; if (i < ubi->vtbl_slots) { goto ldv_32681; } else { } { ldv_mutex_unlock_96___0(& ubi->device_mutex); } return (count); } } int ubi_enumerate_volumes(struct notifier_block *nb ) { int i ; int count ; struct ubi_device *ubi ; int tmp ; { count = 0; i = 0; goto ldv_32692; ldv_32691: ubi = ubi_devices[i]; if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { goto ldv_32690; } else { } { tmp = ubi_notify_all(ubi, 0, nb); count = count + tmp; } ldv_32690: i = i + 1; ldv_32692: ; if (i <= 31) { goto ldv_32691; } else { } return (count); } } struct ubi_device *ubi_get_device(int ubi_num ) { struct ubi_device *ubi ; struct task_struct *tmp ; long tmp___0 ; { { ldv_spin_lock_97(& ubi_devices_lock); ubi = ubi_devices[ubi_num]; } if ((unsigned long )ubi != (unsigned long )((struct ubi_device *)0)) { { tmp___0 = ldv__builtin_expect(ubi->ref_count < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_get_device", 262, tmp->pid); dump_stack(); } } else { } { ubi->ref_count = ubi->ref_count + 1; get_device(& ubi->dev); } } else { } { ldv_spin_unlock_98(& ubi_devices_lock); } return (ubi); } } void ubi_put_device(struct ubi_device *ubi ) { { { ldv_spin_lock_97(& ubi_devices_lock); ubi->ref_count = ubi->ref_count + -1; put_device(& ubi->dev); ldv_spin_unlock_98(& ubi_devices_lock); } return; } } struct ubi_device *ubi_get_by_major(int major ) { int i ; struct ubi_device *ubi ; struct task_struct *tmp ; long tmp___0 ; { { ldv_spin_lock_97(& ubi_devices_lock); i = 0; } goto ldv_32709; ldv_32708: ubi = ubi_devices[i]; if ((unsigned long )ubi != (unsigned long )((struct ubi_device *)0) && ubi->cdev.dev >> 20 == (dev_t )major) { { tmp___0 = ldv__builtin_expect(ubi->ref_count < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_get_by_major", 299, tmp->pid); dump_stack(); } } else { } { ubi->ref_count = ubi->ref_count + 1; get_device(& ubi->dev); ldv_spin_unlock_98(& ubi_devices_lock); } return (ubi); } else { } i = i + 1; ldv_32709: ; if (i <= 31) { goto ldv_32708; } else { } { ldv_spin_unlock_98(& ubi_devices_lock); } return ((struct ubi_device *)0); } } int ubi_major2num(int major ) { int i ; int ubi_num ; struct ubi_device *ubi ; { { ubi_num = -19; ldv_spin_lock_97(& ubi_devices_lock); i = 0; } goto ldv_32719; ldv_32718: ubi = ubi_devices[i]; if ((unsigned long )ubi != (unsigned long )((struct ubi_device *)0) && ubi->cdev.dev >> 20 == (dev_t )major) { ubi_num = ubi->ubi_num; goto ldv_32717; } else { } i = i + 1; ldv_32719: ; if (i <= 31) { goto ldv_32718; } else { } ldv_32717: { ldv_spin_unlock_98(& ubi_devices_lock); } return (ubi_num); } } static ssize_t dev_attribute_show(struct device *dev , struct device_attribute *attr , char *buf ) { ssize_t ret ; struct ubi_device *ubi ; struct device const *__mptr ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; { { __mptr = (struct device const *)dev; ubi = (struct ubi_device *)__mptr + 0xfffffffffffffeb0UL; ubi = ubi_get_device(ubi->ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19L); } else { } if ((unsigned long )attr == (unsigned long )(& dev_eraseblock_size)) { { tmp = sprintf(buf, "%d\n", ubi->leb_size); ret = (ssize_t )tmp; } } else if ((unsigned long )attr == (unsigned long )(& dev_avail_eraseblocks)) { { tmp___0 = sprintf(buf, "%d\n", ubi->avail_pebs); ret = (ssize_t )tmp___0; } } else if ((unsigned long )attr == (unsigned long )(& dev_total_eraseblocks)) { { tmp___1 = sprintf(buf, "%d\n", ubi->good_peb_count); ret = (ssize_t )tmp___1; } } else if ((unsigned long )attr == (unsigned long )(& dev_volumes_count)) { { tmp___2 = sprintf(buf, "%d\n", ubi->vol_count + -1); ret = (ssize_t )tmp___2; } } else if ((unsigned long )attr == (unsigned long )(& dev_max_ec)) { { tmp___3 = sprintf(buf, "%d\n", ubi->max_ec); ret = (ssize_t )tmp___3; } } else if ((unsigned long )attr == (unsigned long )(& dev_reserved_for_bad)) { { tmp___4 = sprintf(buf, "%d\n", ubi->beb_rsvd_pebs); ret = (ssize_t )tmp___4; } } else if ((unsigned long )attr == (unsigned long )(& dev_bad_peb_count)) { { tmp___5 = sprintf(buf, "%d\n", ubi->bad_peb_count); ret = (ssize_t )tmp___5; } } else if ((unsigned long )attr == (unsigned long )(& dev_max_vol_count)) { { tmp___6 = sprintf(buf, "%d\n", ubi->vtbl_slots); ret = (ssize_t )tmp___6; } } else if ((unsigned long )attr == (unsigned long )(& dev_min_io_size)) { { tmp___7 = sprintf(buf, "%d\n", ubi->min_io_size); ret = (ssize_t )tmp___7; } } else if ((unsigned long )attr == (unsigned long )(& dev_bgt_enabled)) { { tmp___8 = sprintf(buf, "%d\n", ubi->thread_enabled); ret = (ssize_t )tmp___8; } } else if ((unsigned long )attr == (unsigned long )(& dev_mtd_num)) { { tmp___9 = sprintf(buf, "%d\n", (ubi->mtd)->index); ret = (ssize_t )tmp___9; } } else { ret = -22L; } { ubi_put_device(ubi); } return (ret); } } static void dev_release(struct device *dev ) { struct ubi_device *ubi ; struct device const *__mptr ; { { __mptr = (struct device const *)dev; ubi = (struct ubi_device *)__mptr + 0xfffffffffffffeb0UL; kfree((void const *)ubi); } return; } } static int ubi_sysfs_init(struct ubi_device *ubi , int *ref ) { int err ; { { ubi->dev.release = & dev_release; ubi->dev.devt = ubi->cdev.dev; ubi->dev.class = ubi_class; dev_set_name(& ubi->dev, "ubi%d", ubi->ubi_num); err = device_register(& ubi->dev); } if (err != 0) { return (err); } else { } { *ref = 1; err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_eraseblock_size)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_avail_eraseblocks)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_total_eraseblocks)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_volumes_count)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_max_ec)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_reserved_for_bad)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_bad_peb_count)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_max_vol_count)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_min_io_size)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_bgt_enabled)); } if (err != 0) { return (err); } else { } { err = device_create_file(& ubi->dev, (struct device_attribute const *)(& dev_mtd_num)); } return (err); } } static void ubi_sysfs_close(struct ubi_device *ubi ) { { { device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_mtd_num)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_bgt_enabled)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_min_io_size)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_max_vol_count)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_bad_peb_count)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_reserved_for_bad)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_max_ec)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_volumes_count)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_total_eraseblocks)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_avail_eraseblocks)); device_remove_file(& ubi->dev, (struct device_attribute const *)(& dev_eraseblock_size)); device_unregister(& ubi->dev); } return; } } static void kill_volumes(struct ubi_device *ubi ) { int i ; { i = 0; goto ldv_32748; ldv_32747: ; if ((unsigned long )ubi->volumes[i] != (unsigned long )((struct ubi_volume *)0)) { { ubi_free_volume(ubi, ubi->volumes[i]); } } else { } i = i + 1; ldv_32748: ; if (i < ubi->vtbl_slots) { goto ldv_32747; } else { } return; } } static int uif_init(struct ubi_device *ubi , int *ref ) { int i ; int err ; dev_t dev ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { { *ref = 0; sprintf((char *)(& ubi->ubi_name), "ubi%d", ubi->ubi_num); err = ldv_alloc_chrdev_region_106(& dev, 0U, (unsigned int )(ubi->vtbl_slots + 1), (char const *)(& ubi->ubi_name)); } if (err != 0) { { printk("\vubi%d error: %s: cannot register UBI character devices\n", ubi->ubi_num, "uif_init"); } return (err); } else { } { tmp___0 = ldv__builtin_expect((dev & 1048575U) != 0U, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "uif_init", 524, tmp->pid); dump_stack(); } } else { } { ldv_cdev_init_107(& ubi->cdev, & ubi_cdev_operations); descriptor.modname = "ubi"; descriptor.function = "uif_init"; descriptor.filename = "drivers/mtd/ubi/build.c"; descriptor.format = "UBI DBG gen (pid %d): %s major is %u\n"; descriptor.lineno = 526U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): %s major is %u\n", tmp___1->pid, (char *)(& ubi->ubi_name), dev >> 20); } } else { } { ubi->cdev.owner = & __this_module; err = cdev_add(& ubi->cdev, dev, 1U); } if (err != 0) { { printk("\vubi%d error: %s: cannot add character device\n", ubi->ubi_num, "uif_init"); } goto out_unreg; } else { } { err = ubi_sysfs_init(ubi, ref); } if (err != 0) { goto out_sysfs; } else { } i = 0; goto ldv_32763; ldv_32762: ; if ((unsigned long )ubi->volumes[i] != (unsigned long )((struct ubi_volume *)0)) { { err = ubi_add_volume(ubi, ubi->volumes[i]); } if (err != 0) { { printk("\vubi%d error: %s: cannot add volume %d\n", ubi->ubi_num, "uif_init", i); } goto out_volumes; } else { } } else { } i = i + 1; ldv_32763: ; if (i < ubi->vtbl_slots) { goto ldv_32762; } else { } return (0); out_volumes: { kill_volumes(ubi); } out_sysfs: ; if (*ref != 0) { { get_device(& ubi->dev); } } else { } { ubi_sysfs_close(ubi); ldv_cdev_del_108(& ubi->cdev); } out_unreg: { ldv_unregister_chrdev_region_109(ubi->cdev.dev, (unsigned int )(ubi->vtbl_slots + 1)); printk("\vubi%d error: %s: cannot initialize UBI %s, error %d\n", ubi->ubi_num, "uif_init", (char *)(& ubi->ubi_name), err); } return (err); } } static void uif_close(struct ubi_device *ubi ) { { { kill_volumes(ubi); ubi_sysfs_close(ubi); ldv_cdev_del_110___0(& ubi->cdev); ldv_unregister_chrdev_region_111(ubi->cdev.dev, (unsigned int )(ubi->vtbl_slots + 1)); } return; } } void ubi_free_internal_volumes(struct ubi_device *ubi ) { int i ; { i = ubi->vtbl_slots; goto ldv_32773; ldv_32772: { kfree((void const *)(ubi->volumes[i])->eba_tbl); kfree((void const *)ubi->volumes[i]); i = i + 1; } ldv_32773: ; if (i < ubi->vtbl_slots + 1) { goto ldv_32772; } else { } return; } } static int get_bad_peb_limit(struct ubi_device const *ubi , int max_beb_per1024 ) { int limit ; int device_pebs ; uint64_t device_size ; uint32_t tmp ; int quot ; int rem ; int quot___0 ; int rem___0 ; { if (max_beb_per1024 == 0) { return (0); } else { } { device_size = mtd_get_device_size((struct mtd_info const *)ubi->mtd); tmp = mtd_div_by_eb(device_size, ubi->mtd); device_pebs = (int )tmp; quot = device_pebs / 1024; rem = device_pebs % 1024; limit = quot * max_beb_per1024 + (rem * max_beb_per1024) / 1024; quot___0 = limit / max_beb_per1024; rem___0 = limit % max_beb_per1024; } if (quot___0 * 1024 + (rem___0 * 1024) / max_beb_per1024 < device_pebs) { limit = limit + 1; } else { } return (limit); } } static int io_init(struct ubi_device *ubi , int max_beb_per1024 ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; uint32_t tmp___3 ; int tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; bool tmp___7 ; int tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; bool tmp___15 ; int tmp___16 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___17 ; long tmp___18 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___19 ; long tmp___20 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___21 ; long tmp___22 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___23 ; long tmp___24 ; struct _ddebug descriptor___5 ; struct task_struct *tmp___25 ; long tmp___26 ; int tmp___27 ; struct _ddebug descriptor___6 ; struct task_struct *tmp___28 ; long tmp___29 ; struct _ddebug descriptor___7 ; struct task_struct *tmp___30 ; long tmp___31 ; struct _ddebug descriptor___8 ; struct task_struct *tmp___32 ; long tmp___33 ; struct _ddebug descriptor___9 ; struct task_struct *tmp___34 ; long tmp___35 ; struct _ddebug descriptor___10 ; struct task_struct *tmp___36 ; long tmp___37 ; { { descriptor.modname = "ubi"; descriptor.function = "io_init"; descriptor.filename = "drivers/mtd/ubi/build.c"; descriptor.format = "UBI DBG gen (pid %d): sizeof(struct ubi_ainf_peb) %zu\n"; descriptor.lineno = 641U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): sizeof(struct ubi_ainf_peb) %zu\n", tmp->pid, 56UL); } } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "io_init"; descriptor___0.filename = "drivers/mtd/ubi/build.c"; descriptor___0.format = "UBI DBG gen (pid %d): sizeof(struct ubi_wl_entry) %zu\n"; descriptor___0.lineno = 642U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___2(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): sizeof(struct ubi_wl_entry) %zu\n", tmp___1->pid, 32UL); } } else { } if ((ubi->mtd)->numeraseregions != 0) { { printk("\vubi%d error: %s: multiple regions, not implemented\n", ubi->ubi_num, "io_init"); } return (-22); } else { } if (ubi->vid_hdr_offset < 0) { return (-22); } else { } { ubi->peb_size = (int )(ubi->mtd)->erasesize; tmp___3 = mtd_div_by_eb((ubi->mtd)->size, ubi->mtd); ubi->peb_count = (int )tmp___3; ubi->flash_size = (long long )(ubi->mtd)->size; tmp___4 = mtd_can_have_bb((struct mtd_info const *)ubi->mtd); } if (tmp___4 != 0) { { ubi->bad_allowed = 1U; ubi->bad_peb_limit = get_bad_peb_limit((struct ubi_device const *)ubi, max_beb_per1024); } } else { } if ((unsigned int )(ubi->mtd)->type == 3U) { { tmp___6 = ldv__builtin_expect((ubi->mtd)->writesize != 1U, 0L); } if (tmp___6 != 0L) { { tmp___5 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "io_init", 676, tmp___5->pid); dump_stack(); } } else { } ubi->nor_flash = 1U; } else { } { ubi->min_io_size = (int )(ubi->mtd)->writesize; ubi->hdrs_min_io_size = (int )((ubi->mtd)->writesize >> (ubi->mtd)->subpage_sft); tmp___7 = is_power_of_2((unsigned long )ubi->min_io_size); } if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { { printk("\vubi%d error: %s: min. I/O unit (%d) is not power of 2\n", ubi->ubi_num, "io_init", ubi->min_io_size); } return (-22); } else { } { tmp___10 = ldv__builtin_expect(ubi->hdrs_min_io_size <= 0, 0L); } if (tmp___10 != 0L) { { tmp___9 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "io_init", 694, tmp___9->pid); dump_stack(); } } else { } { tmp___12 = ldv__builtin_expect(ubi->hdrs_min_io_size > ubi->min_io_size, 0L); } if (tmp___12 != 0L) { { tmp___11 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "io_init", 695, tmp___11->pid); dump_stack(); } } else { } { tmp___14 = ldv__builtin_expect(ubi->min_io_size % ubi->hdrs_min_io_size != 0, 0L); } if (tmp___14 != 0L) { { tmp___13 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "io_init", 696, tmp___13->pid); dump_stack(); } } else { } ubi->max_write_size = (int )(ubi->mtd)->writebufsize; if (ubi->max_write_size < ubi->min_io_size || ubi->max_write_size % ubi->min_io_size != 0) { { printk("\vubi%d error: %s: bad write buffer size %d for %d min. I/O unit\n", ubi->ubi_num, "io_init", ubi->max_write_size, ubi->min_io_size); } return (-22); } else { { tmp___15 = is_power_of_2((unsigned long )ubi->max_write_size); } if (tmp___15) { tmp___16 = 0; } else { tmp___16 = 1; } if (tmp___16) { { printk("\vubi%d error: %s: bad write buffer size %d for %d min. I/O unit\n", ubi->ubi_num, "io_init", ubi->max_write_size, ubi->min_io_size); } return (-22); } else { } } { ubi->ec_hdr_alsize = (int )(((unsigned int )ubi->hdrs_min_io_size + 63U) & - ((unsigned int )ubi->hdrs_min_io_size)); ubi->vid_hdr_alsize = (int )(((unsigned int )ubi->hdrs_min_io_size + 63U) & - ((unsigned int )ubi->hdrs_min_io_size)); descriptor___1.modname = "ubi"; descriptor___1.function = "io_init"; descriptor___1.filename = "drivers/mtd/ubi/build.c"; descriptor___1.format = "UBI DBG gen (pid %d): min_io_size %d\n"; descriptor___1.lineno = 715U; descriptor___1.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___18 != 0L) { { tmp___17 = get_current___2(); __dynamic_pr_debug(& descriptor___1, "UBI DBG gen (pid %d): min_io_size %d\n", tmp___17->pid, ubi->min_io_size); } } else { } { descriptor___2.modname = "ubi"; descriptor___2.function = "io_init"; descriptor___2.filename = "drivers/mtd/ubi/build.c"; descriptor___2.format = "UBI DBG gen (pid %d): max_write_size %d\n"; descriptor___2.lineno = 716U; descriptor___2.flags = 0U; tmp___20 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); } if (tmp___20 != 0L) { { tmp___19 = get_current___2(); __dynamic_pr_debug(& descriptor___2, "UBI DBG gen (pid %d): max_write_size %d\n", tmp___19->pid, ubi->max_write_size); } } else { } { descriptor___3.modname = "ubi"; descriptor___3.function = "io_init"; descriptor___3.filename = "drivers/mtd/ubi/build.c"; descriptor___3.format = "UBI DBG gen (pid %d): hdrs_min_io_size %d\n"; descriptor___3.lineno = 717U; descriptor___3.flags = 0U; tmp___22 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); } if (tmp___22 != 0L) { { tmp___21 = get_current___2(); __dynamic_pr_debug(& descriptor___3, "UBI DBG gen (pid %d): hdrs_min_io_size %d\n", tmp___21->pid, ubi->hdrs_min_io_size); } } else { } { descriptor___4.modname = "ubi"; descriptor___4.function = "io_init"; descriptor___4.filename = "drivers/mtd/ubi/build.c"; descriptor___4.format = "UBI DBG gen (pid %d): ec_hdr_alsize %d\n"; descriptor___4.lineno = 718U; descriptor___4.flags = 0U; tmp___24 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); } if (tmp___24 != 0L) { { tmp___23 = get_current___2(); __dynamic_pr_debug(& descriptor___4, "UBI DBG gen (pid %d): ec_hdr_alsize %d\n", tmp___23->pid, ubi->ec_hdr_alsize); } } else { } { descriptor___5.modname = "ubi"; descriptor___5.function = "io_init"; descriptor___5.filename = "drivers/mtd/ubi/build.c"; descriptor___5.format = "UBI DBG gen (pid %d): vid_hdr_alsize %d\n"; descriptor___5.lineno = 719U; descriptor___5.flags = 0U; tmp___26 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); } if (tmp___26 != 0L) { { tmp___25 = get_current___2(); __dynamic_pr_debug(& descriptor___5, "UBI DBG gen (pid %d): vid_hdr_alsize %d\n", tmp___25->pid, ubi->vid_hdr_alsize); } } else { } if (ubi->vid_hdr_offset == 0) { tmp___27 = ubi->ec_hdr_alsize; ubi->vid_hdr_aloffset = tmp___27; ubi->vid_hdr_offset = tmp___27; } else { ubi->vid_hdr_aloffset = ubi->vid_hdr_offset & - ubi->hdrs_min_io_size; ubi->vid_hdr_shift = ubi->vid_hdr_offset - ubi->vid_hdr_aloffset; } { ubi->leb_start = (int )((unsigned int )ubi->vid_hdr_offset + 64U); ubi->leb_start = (ubi->leb_start + (ubi->min_io_size + -1)) & - ubi->min_io_size; descriptor___6.modname = "ubi"; descriptor___6.function = "io_init"; descriptor___6.filename = "drivers/mtd/ubi/build.c"; descriptor___6.format = "UBI DBG gen (pid %d): vid_hdr_offset %d\n"; descriptor___6.lineno = 736U; descriptor___6.flags = 0U; tmp___29 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); } if (tmp___29 != 0L) { { tmp___28 = get_current___2(); __dynamic_pr_debug(& descriptor___6, "UBI DBG gen (pid %d): vid_hdr_offset %d\n", tmp___28->pid, ubi->vid_hdr_offset); } } else { } { descriptor___7.modname = "ubi"; descriptor___7.function = "io_init"; descriptor___7.filename = "drivers/mtd/ubi/build.c"; descriptor___7.format = "UBI DBG gen (pid %d): vid_hdr_aloffset %d\n"; descriptor___7.lineno = 737U; descriptor___7.flags = 0U; tmp___31 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); } if (tmp___31 != 0L) { { tmp___30 = get_current___2(); __dynamic_pr_debug(& descriptor___7, "UBI DBG gen (pid %d): vid_hdr_aloffset %d\n", tmp___30->pid, ubi->vid_hdr_aloffset); } } else { } { descriptor___8.modname = "ubi"; descriptor___8.function = "io_init"; descriptor___8.filename = "drivers/mtd/ubi/build.c"; descriptor___8.format = "UBI DBG gen (pid %d): vid_hdr_shift %d\n"; descriptor___8.lineno = 738U; descriptor___8.flags = 0U; tmp___33 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); } if (tmp___33 != 0L) { { tmp___32 = get_current___2(); __dynamic_pr_debug(& descriptor___8, "UBI DBG gen (pid %d): vid_hdr_shift %d\n", tmp___32->pid, ubi->vid_hdr_shift); } } else { } { descriptor___9.modname = "ubi"; descriptor___9.function = "io_init"; descriptor___9.filename = "drivers/mtd/ubi/build.c"; descriptor___9.format = "UBI DBG gen (pid %d): leb_start %d\n"; descriptor___9.lineno = 739U; descriptor___9.flags = 0U; tmp___35 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); } if (tmp___35 != 0L) { { tmp___34 = get_current___2(); __dynamic_pr_debug(& descriptor___9, "UBI DBG gen (pid %d): leb_start %d\n", tmp___34->pid, ubi->leb_start); } } else { } if (((unsigned int )ubi->vid_hdr_shift & 3U) != 0U) { { printk("\vubi%d error: %s: unaligned VID header shift %d\n", ubi->ubi_num, "io_init", ubi->vid_hdr_shift); } return (-22); } else { } if ((((unsigned int )ubi->vid_hdr_offset <= 63U || (unsigned long )ubi->leb_start < (unsigned long )ubi->vid_hdr_offset + 64UL) || (unsigned long )ubi->leb_start > (unsigned long )ubi->peb_size - 64UL) || (ubi->leb_start & (ubi->min_io_size + -1)) != 0) { { printk("\vubi%d error: %s: bad VID header (%d) or data offsets (%d)\n", ubi->ubi_num, "io_init", ubi->vid_hdr_offset, ubi->leb_start); } return (-22); } else { } ubi->max_erroneous = ubi->peb_count / 10; if (ubi->max_erroneous <= 15) { ubi->max_erroneous = 16; } else { } { descriptor___10.modname = "ubi"; descriptor___10.function = "io_init"; descriptor___10.filename = "drivers/mtd/ubi/build.c"; descriptor___10.format = "UBI DBG gen (pid %d): max_erroneous %d\n"; descriptor___10.lineno = 765U; descriptor___10.flags = 0U; tmp___37 = ldv__builtin_expect((long )descriptor___10.flags & 1L, 0L); } if (tmp___37 != 0L) { { tmp___36 = get_current___2(); __dynamic_pr_debug(& descriptor___10, "UBI DBG gen (pid %d): max_erroneous %d\n", tmp___36->pid, ubi->max_erroneous); } } else { } if ((unsigned long )ubi->vid_hdr_offset + 64UL <= (unsigned long )ubi->hdrs_min_io_size) { { printk("\fubi%d warning: %s: EC and VID headers are in the same minimal I/O unit, switch to read-only mode\n", ubi->ubi_num, "io_init"); ubi->ro_mode = 1; } } else { } ubi->leb_size = ubi->peb_size - ubi->leb_start; if (((ubi->mtd)->flags & 1024U) == 0U) { { printk("\rubi%d: MTD device %d is write-protected, attach in read-only mode\n", ubi->ubi_num, (ubi->mtd)->index); ubi->ro_mode = 1; } } else { } return (0); } } static int autoresize(struct ubi_device *ubi , int vol_id ) { struct ubi_volume_desc desc ; struct ubi_volume *vol ; int err ; int old_reserved_pebs ; struct ubi_vtbl_record vtbl_rec ; { vol = ubi->volumes[vol_id]; old_reserved_pebs = vol->reserved_pebs; if (ubi->ro_mode != 0) { { printk("\fubi%d warning: %s: skip auto-resize because of R/O mode\n", ubi->ubi_num, "autoresize"); } return (0); } else { } (ubi->vtbl + (unsigned long )vol_id)->flags = (unsigned int )(ubi->vtbl + (unsigned long )vol_id)->flags & 254U; if (ubi->avail_pebs == 0) { { vtbl_rec = *(ubi->vtbl + (unsigned long )vol_id); err = ubi_change_vtbl_record(ubi, vol_id, & vtbl_rec); } if (err != 0) { { printk("\vubi%d error: %s: cannot clean auto-resize flag for volume %d\n", ubi->ubi_num, "autoresize", vol_id); } } else { } } else { { desc.vol = vol; err = ubi_resize_volume(& desc, old_reserved_pebs + ubi->avail_pebs); } if (err != 0) { { printk("\vubi%d error: %s: cannot auto-resize volume %d\n", ubi->ubi_num, "autoresize", vol_id); } } else { } } if (err != 0) { return (err); } else { } { printk("\rubi%d: volume %d (\"%s\") re-sized from %d to %d LEBs\n", ubi->ubi_num, vol_id, (char *)(& vol->name), old_reserved_pebs, vol->reserved_pebs); } return (0); } } int ubi_attach_mtd_dev(struct mtd_info *mtd , int ubi_num , int vid_hdr_offset , int max_beb_per1024 ) { struct ubi_device *ubi ; int i ; int err ; int ref ; void *tmp ; int tmp___0 ; int tmp___1 ; int _min1 ; uint32_t tmp___2 ; int _min2 ; uint32_t tmp___3 ; 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 ; long tmp___4 ; bool tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; { ref = 0; if ((unsigned int )max_beb_per1024 > 768U) { return (-22); } else { } if (max_beb_per1024 == 0) { max_beb_per1024 = 20; } else { } i = 0; goto ldv_32827; ldv_32826: ubi = ubi_devices[i]; if ((unsigned long )ubi != (unsigned long )((struct ubi_device *)0) && mtd->index == (ubi->mtd)->index) { { printk("\vubi%d error: %s: mtd%d is already attached to ubi%d\n", ubi->ubi_num, "ubi_attach_mtd_dev", mtd->index, i); } return (-17); } else { } i = i + 1; ldv_32827: ; if (i <= 31) { goto ldv_32826; } else { } if ((unsigned int )mtd->type == 7U) { { printk("\vubi%d error: %s: refuse attaching mtd%d - it is already emulated on top of UBI\n", ubi->ubi_num, "ubi_attach_mtd_dev", mtd->index); } return (-22); } else { } if (ubi_num == -1) { ubi_num = 0; goto ldv_32831; ldv_32830: ; if ((unsigned long )ubi_devices[ubi_num] == (unsigned long )((struct ubi_device *)0)) { goto ldv_32829; } else { } ubi_num = ubi_num + 1; ldv_32831: ; if (ubi_num <= 31) { goto ldv_32830; } else { } ldv_32829: ; if (ubi_num == 32) { { printk("\vubi%d error: %s: only %d UBI devices may be created\n", ubi->ubi_num, "ubi_attach_mtd_dev", 32); } return (-23); } else { } } else { if (ubi_num > 31) { return (-22); } else { } if ((unsigned long )ubi_devices[ubi_num] != (unsigned long )((struct ubi_device *)0)) { { printk("\vubi%d error: %s: already exists\n", ubi->ubi_num, "ubi_attach_mtd_dev"); } return (-17); } else { } } { tmp = kzalloc(7016UL, 208U); ubi = (struct ubi_device *)tmp; } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-12); } else { } { ubi->mtd = mtd; ubi->ubi_num = ubi_num; ubi->vid_hdr_offset = vid_hdr_offset; ubi->autoresize_vol_id = -1; tmp___0 = 0; ubi->fm_pool.size = tmp___0; ubi->fm_pool.used = tmp___0; tmp___1 = 0; ubi->fm_wl_pool.size = tmp___1; ubi->fm_wl_pool.used = tmp___1; tmp___2 = mtd_div_by_eb((ubi->mtd)->size, ubi->mtd); _min1 = ((int )tmp___2 / 100) * 5; _min2 = 256; ubi->fm_pool.max_size = _min1 < _min2 ? _min1 : _min2; } if (ubi->fm_pool.max_size <= 7) { ubi->fm_pool.max_size = 8; } else { } ubi->fm_wl_pool.max_size = 25; ubi->fm_disabled = ! fm_autoconvert; if (ubi->fm_disabled == 0) { { tmp___3 = mtd_div_by_eb((ubi->mtd)->size, ubi->mtd); } if ((int )tmp___3 <= 64) { { printk("\vubi%d error: %s: More than %i PEBs are needed for fastmap, sorry.\n", ubi->ubi_num, "ubi_attach_mtd_dev", 64); ubi->fm_disabled = 1; } } else { } } else { } { printk("\rubi%d: default fastmap pool size: %d\n", ubi->ubi_num, ubi->fm_pool.max_size); printk("\rubi%d: default fastmap WL pool size: %d\n", ubi->ubi_num, ubi->fm_wl_pool.max_size); __mutex_init(& ubi->buf_mutex, "&ubi->buf_mutex", & __key); __mutex_init(& ubi->ckvol_mutex, "&ubi->ckvol_mutex", & __key___0); __mutex_init(& ubi->device_mutex, "&ubi->device_mutex", & __key___1); spinlock_check(& ubi->volumes_lock); __raw_spin_lock_init(& ubi->volumes_lock.__annonCompField18.rlock, "&(&ubi->volumes_lock)->rlock", & __key___2); __mutex_init(& ubi->fm_mutex, "&ubi->fm_mutex", & __key___3); __init_rwsem(& ubi->fm_sem, "&ubi->fm_sem", & __key___4); printk("\rubi%d: attaching mtd%d\n", ubi->ubi_num, mtd->index); err = io_init(ubi, max_beb_per1024); } if (err != 0) { goto out_free; } else { } { err = -12; ubi->peb_buf = ldv_vmalloc_112((unsigned long )ubi->peb_size); } if ((unsigned long )ubi->peb_buf == (unsigned long )((void *)0)) { goto out_free; } else { } { ubi->fm_size = ubi_calc_fm_size(ubi); ubi->fm_buf = ldv_vzalloc_113(ubi->fm_size); } if ((unsigned long )ubi->fm_buf == (unsigned long )((void *)0)) { goto out_free; } else { } { err = ubi_attach(ubi, 0); } if (err != 0) { { printk("\vubi%d error: %s: failed to attach mtd%d, error %d\n", ubi->ubi_num, "ubi_attach_mtd_dev", mtd->index, err); } goto out_free; } else { } if (ubi->autoresize_vol_id != -1) { { err = autoresize(ubi, ubi->autoresize_vol_id); } if (err != 0) { goto out_detach; } else { } } else { } { err = uif_init(ubi, & ref); } if (err != 0) { goto out_detach; } else { } { err = ubi_debugfs_init_dev(ubi); } if (err != 0) { goto out_uif; } else { } { ubi->bgt_thread = kthread_create_on_node(& ubi_thread, (void *)ubi, -1, "%s", (char *)(& ubi->bgt_name)); tmp___5 = IS_ERR((void const *)ubi->bgt_thread); } if ((int )tmp___5) { { tmp___4 = PTR_ERR((void const *)ubi->bgt_thread); err = (int )tmp___4; printk("\vubi%d error: %s: cannot spawn \"%s\", error %d\n", ubi->ubi_num, "ubi_attach_mtd_dev", (char *)(& ubi->bgt_name), err); } goto out_debugfs; } else { } { printk("\rubi%d: attached mtd%d (name \"%s\", size %llu MiB)\n", ubi->ubi_num, mtd->index, mtd->name, ubi->flash_size >> 20); printk("\rubi%d: PEB size: %d bytes (%d KiB), LEB size: %d bytes\n", ubi->ubi_num, ubi->peb_size, ubi->peb_size >> 10, ubi->leb_size); printk("\rubi%d: min./max. I/O unit sizes: %d/%d, sub-page size %d\n", ubi->ubi_num, ubi->min_io_size, ubi->max_write_size, ubi->hdrs_min_io_size); printk("\rubi%d: VID header offset: %d (aligned %d), data offset: %d\n", ubi->ubi_num, ubi->vid_hdr_offset, ubi->vid_hdr_aloffset, ubi->leb_start); printk("\rubi%d: good PEBs: %d, bad PEBs: %d, corrupted PEBs: %d\n", ubi->ubi_num, ubi->good_peb_count, ubi->bad_peb_count, ubi->corr_peb_count); printk("\rubi%d: user volume: %d, internal volumes: %d, max. volumes count: %d\n", ubi->ubi_num, ubi->vol_count + -1, 1, ubi->vtbl_slots); printk("\rubi%d: max/mean erase counter: %d/%d, WL threshold: %d, image sequence number: %u\n", ubi->ubi_num, ubi->max_ec, ubi->mean_ec, 4096, ubi->image_seq); printk("\rubi%d: available PEBs: %d, total reserved PEBs: %d, PEBs reserved for bad PEB handling: %d\n", ubi->ubi_num, ubi->avail_pebs, ubi->rsvd_pebs, ubi->beb_rsvd_pebs); ldv_spin_lock_114(& ubi->wl_lock); ubi->thread_enabled = 1; wake_up_process(ubi->bgt_thread); ldv_spin_unlock_115(& ubi->wl_lock); ubi_devices[ubi_num] = ubi; ubi_notify_all(ubi, 0, (struct notifier_block *)0); } return (ubi_num); out_debugfs: { ubi_debugfs_exit_dev(ubi); } out_uif: { get_device(& ubi->dev); tmp___7 = ldv__builtin_expect(ref == 0, 0L); } if (tmp___7 != 0L) { { tmp___6 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_attach_mtd_dev", 1058, tmp___6->pid); dump_stack(); } } else { } { uif_close(ubi); } out_detach: { ubi_wl_close(ubi); ubi_free_internal_volumes(ubi); vfree((void const *)ubi->vtbl); } out_free: { vfree((void const *)ubi->peb_buf); vfree((void const *)ubi->fm_buf); } if (ref != 0) { { put_device(& ubi->dev); } } else { { kfree((void const *)ubi); } } return (err); } } int ubi_detach_mtd_dev(int ubi_num , int anyway ) { struct ubi_device *ubi ; struct task_struct *tmp ; long tmp___0 ; { if ((unsigned int )ubi_num > 31U) { return (-22); } else { } { ubi = ubi_get_device(ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-22); } else { } { ldv_spin_lock_97(& ubi_devices_lock); put_device(& ubi->dev); ubi->ref_count = ubi->ref_count + -1; } if (ubi->ref_count != 0) { if (anyway == 0) { { ldv_spin_unlock_98(& ubi_devices_lock); } return (-16); } else { } { printk("\vubi%d error: %s: %s reference count %d, destroy anyway\n", ubi->ubi_num, "ubi_detach_mtd_dev", (char *)(& ubi->ubi_name), ubi->ref_count); } } else { } { ubi_devices[ubi_num] = (struct ubi_device *)0; ldv_spin_unlock_98(& ubi_devices_lock); tmp___0 = ldv__builtin_expect(ubi_num != ubi->ubi_num, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_detach_mtd_dev", 1113, tmp->pid); dump_stack(); } } else { } { ubi_notify_all(ubi, 1, (struct notifier_block *)0); printk("\rubi%d: detaching mtd%d\n", ubi->ubi_num, (ubi->mtd)->index); ubi_update_fastmap(ubi); } if ((unsigned long )ubi->bgt_thread != (unsigned long )((struct task_struct *)0)) { { kthread_stop(ubi->bgt_thread); } } else { } { get_device(& ubi->dev); ubi_debugfs_exit_dev(ubi); uif_close(ubi); ubi_wl_close(ubi); ubi_free_internal_volumes(ubi); vfree((void const *)ubi->vtbl); put_mtd_device(ubi->mtd); vfree((void const *)ubi->peb_buf); vfree((void const *)ubi->fm_buf); printk("\rubi%d: mtd%d is detached\n", ubi->ubi_num, (ubi->mtd)->index); put_device(& ubi->dev); } return (0); } } static struct mtd_info *open_mtd_by_chdev(char const *mtd_dev ) { int err ; int major ; int minor ; int mode ; struct path path ; void *tmp ; unsigned int tmp___0 ; unsigned int tmp___1 ; void *tmp___2 ; void *tmp___3 ; struct mtd_info *tmp___4 ; { { err = kern_path(mtd_dev, 1U, & path); } if (err != 0) { { tmp = ERR_PTR((long )err); } return ((struct mtd_info *)tmp); } else { } { tmp___0 = imajor((struct inode const *)(path.dentry)->d_inode); major = (int )tmp___0; tmp___1 = iminor((struct inode const *)(path.dentry)->d_inode); minor = (int )tmp___1; mode = (int )((path.dentry)->d_inode)->i_mode; path_put((struct path const *)(& path)); } if (major != 90 || (mode & 61440) != 8192) { { tmp___2 = ERR_PTR(-22L); } return ((struct mtd_info *)tmp___2); } else { } if (minor & 1) { { tmp___3 = ERR_PTR(-22L); } return ((struct mtd_info *)tmp___3); } else { } { tmp___4 = get_mtd_device((struct mtd_info *)0, minor / 2); } return (tmp___4); } } static struct mtd_info *open_mtd_device(char const *mtd_dev ) { struct mtd_info *mtd ; int mtd_num ; char *endp ; unsigned long tmp ; bool tmp___0 ; long tmp___1 ; { { tmp = simple_strtoul(mtd_dev, & endp, 0U); mtd_num = (int )tmp; } if ((int )((signed char )*endp) != 0 || (unsigned long )mtd_dev == (unsigned long )((char const *)endp)) { { mtd = get_mtd_device_nm(mtd_dev); tmp___0 = IS_ERR((void const *)mtd); } if ((int )tmp___0) { { tmp___1 = PTR_ERR((void const *)mtd); } if (tmp___1 == -19L) { { mtd = open_mtd_by_chdev(mtd_dev); } } else { } } else { } } else { { mtd = get_mtd_device((struct mtd_info *)0, mtd_num); } } return (mtd); } } extern void __compiletime_assert_1221(void) ; extern void __compiletime_assert_1222(void) ; static int ubi_init(void) { int err ; int i ; int k ; bool __cond ; bool __cond___0 ; void *tmp ; long tmp___0 ; bool tmp___1 ; struct mtd_dev_param *p ; struct mtd_info *mtd ; long tmp___2 ; bool tmp___3 ; { __cond = 0; if ((int )__cond) { { __compiletime_assert_1221(); } } else { } __cond___0 = 0; if ((int )__cond___0) { { __compiletime_assert_1222(); } } else { } if (mtd_devs > 32) { { printk("\vUBI error: too many MTD devices, maximum is %d", 32); } return (-22); } else { } { tmp = ldv_create_class(); ubi_class = (struct class *)tmp; tmp___1 = IS_ERR((void const *)ubi_class); } if ((int )tmp___1) { { tmp___0 = PTR_ERR((void const *)ubi_class); err = (int )tmp___0; printk("\vUBI error: cannot create UBI class"); } goto out; } else { } { err = class_create_file(ubi_class, (struct class_attribute const *)(& ubi_version)); } if (err != 0) { { printk("\vUBI error: cannot create sysfs file"); } goto out_class; } else { } { err = ldv_misc_register_119(& ubi_ctrl_cdev); } if (err != 0) { { printk("\vUBI error: cannot register device"); } goto out_version; } else { } { ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab", 32UL, 0UL, 0UL, (void (*)(void * ))0); } if ((unsigned long )ubi_wl_entry_slab == (unsigned long )((struct kmem_cache *)0)) { err = -12; goto out_dev_unreg; } else { } { err = ubi_debugfs_init(); } if (err != 0) { goto out_slab; } else { } i = 0; goto ldv_32890; ldv_32889: { p = (struct mtd_dev_param *)(& mtd_dev_param) + (unsigned long )i; ___might_sleep("drivers/mtd/ubi/build.c", 1268, 0); _cond_resched(); mtd = open_mtd_device((char const *)(& p->name)); tmp___3 = IS_ERR((void const *)mtd); } if ((int )tmp___3) { { tmp___2 = PTR_ERR((void const *)mtd); err = (int )tmp___2; printk("\vUBI error: cannot open mtd %s, error %d", (char *)(& p->name), err); } goto out_detach; goto ldv_32888; } else { } { ldv_mutex_lock_120(& ubi_devices_mutex); err = ubi_attach_mtd_dev(mtd, p->ubi_num, p->vid_hdr_offs, p->max_beb_per1024); ldv_mutex_unlock_121(& ubi_devices_mutex); } if (err < 0) { { printk("\vUBI error: cannot attach mtd%d", mtd->index); put_mtd_device(mtd); } goto out_detach; } else { } ldv_32888: i = i + 1; ldv_32890: ; if (i < mtd_devs) { goto ldv_32889; } else { } { err = ubiblock_init(); } if (err != 0) { { printk("\vUBI error: block: cannot initialize, error %d", err); } goto out_detach; } else { } return (0); out_detach: k = 0; goto ldv_32893; ldv_32892: ; if ((unsigned long )ubi_devices[k] != (unsigned long )((struct ubi_device *)0)) { { ldv_mutex_lock_122(& ubi_devices_mutex); ubi_detach_mtd_dev((ubi_devices[k])->ubi_num, 1); ldv_mutex_unlock_123(& ubi_devices_mutex); } } else { } k = k + 1; ldv_32893: ; if (k < i) { goto ldv_32892; } else { } { ubi_debugfs_exit(); } out_slab: { kmem_cache_destroy(ubi_wl_entry_slab); } out_dev_unreg: { ldv_misc_deregister_124(& ubi_ctrl_cdev); } out_version: { class_remove_file(ubi_class, (struct class_attribute const *)(& ubi_version)); } out_class: { ldv_class_destroy_125(ubi_class); } out: { printk("\vUBI error: cannot initialize UBI, error %d", err); } return (err); } } static void ubi_exit(void) { int i ; { { ubiblock_exit(); i = 0; } goto ldv_32905; ldv_32904: ; if ((unsigned long )ubi_devices[i] != (unsigned long )((struct ubi_device *)0)) { { ldv_mutex_lock_126(& ubi_devices_mutex); ubi_detach_mtd_dev((ubi_devices[i])->ubi_num, 1); ldv_mutex_unlock_127(& ubi_devices_mutex); } } else { } i = i + 1; ldv_32905: ; if (i <= 31) { goto ldv_32904; } else { } { ubi_debugfs_exit(); kmem_cache_destroy(ubi_wl_entry_slab); ldv_misc_deregister_128(& ubi_ctrl_cdev); class_remove_file(ubi_class, (struct class_attribute const *)(& ubi_version)); ldv_class_destroy_129(ubi_class); } return; } } static int bytes_str_to_int(char const *str ) { char *endp ; unsigned long result ; { { result = simple_strtoul(str, & endp, 0U); } if ((unsigned long )str == (unsigned long )((char const *)endp) || result > 2147483646UL) { { printk("\vUBI error: incorrect bytes count: \"%s\"\n", str); } return (-22); } else { } { if ((int )*endp == 71) { goto case_71; } else { } if ((int )*endp == 77) { goto case_77; } else { } if ((int )*endp == 75) { goto case_75; } else { } if ((int )*endp == 0) { goto case_0; } else { } goto switch_default; case_71: /* CIL Label */ result = result * 1024UL; case_77: /* CIL Label */ result = result * 1024UL; case_75: /* CIL Label */ result = result * 1024UL; if ((int )((signed char )*(endp + 1UL)) == 105 && (int )((signed char )*(endp + 2UL)) == 66) { endp = endp + 2UL; } else { } case_0: /* CIL Label */ ; goto ldv_32921; switch_default: /* CIL Label */ { printk("\vUBI error: incorrect bytes count: \"%s\"\n", str); } return (-22); switch_break: /* CIL Label */ ; } ldv_32921: ; return ((int )result); } } static int ubi_mtd_param_parse(char const *val , struct kernel_param *kp ) { int i ; int len ; struct mtd_dev_param *p ; char buf[64U] ; char *pbuf ; char *tokens[4U] ; char *token ; __kernel_size_t tmp ; int err ; int tmp___0 ; int err___0 ; int tmp___1 ; { pbuf = (char *)(& buf); if ((unsigned long )val == (unsigned long )((char const *)0)) { return (-22); } else { } if (mtd_devs == 32) { { printk("\vUBI error: too many parameters, max. is %d\n", 32); } return (-22); } else { } { tmp = strnlen(val, 64UL); len = (int )tmp; } if (len == 64) { { printk("\vUBI error: parameter \"%s\" is too long, max. is %d\n", val, 64); } return (-22); } else { } if (len == 0) { { printk("\fUBI warning: empty \'mtd=\' parameter - ignored\n"); } return (0); } else { } { strcpy((char *)(& buf), val); } if ((int )((signed char )buf[len + -1]) == 10) { buf[len + -1] = 0; } else { } i = 0; goto ldv_32935; ldv_32934: { tokens[i] = strsep(& pbuf, ","); i = i + 1; } ldv_32935: ; if (i <= 3) { goto ldv_32934; } else { } if ((unsigned long )pbuf != (unsigned long )((char *)0)) { { printk("\vUBI error: too many arguments at \"%s\"\n", val); } return (-22); } else { } { p = (struct mtd_dev_param *)(& mtd_dev_param) + (unsigned long )mtd_devs; strcpy((char *)(& p->name), (char const *)tokens[0]); token = tokens[1]; } if ((unsigned long )token != (unsigned long )((char *)0)) { { p->vid_hdr_offs = bytes_str_to_int((char const *)token); } if (p->vid_hdr_offs < 0) { return (p->vid_hdr_offs); } else { } } else { } token = tokens[2]; if ((unsigned long )token != (unsigned long )((char *)0)) { { tmp___0 = kstrtoint((char const *)token, 10U, & p->max_beb_per1024); err = tmp___0; } if (err != 0) { { printk("\vUBI error: bad value for max_beb_per1024 parameter: %s", token); } return (-22); } else { } } else { } token = tokens[3]; if ((unsigned long )token != (unsigned long )((char *)0)) { { tmp___1 = kstrtoint((char const *)token, 10U, & p->ubi_num); err___0 = tmp___1; } if (err___0 != 0) { { printk("\vUBI error: bad value for ubi_num parameter: %s", token); } return (-22); } else { } } else { p->ubi_num = -1; } mtd_devs = mtd_devs + 1; return (0); } } void ldv_EMGentry_exit_ubi_exit_15_2(void (*arg0)(void) ) ; int ldv_EMGentry_init_ubi_init_15_11(int (*arg0)(void) ) ; void ldv_dispatch_deregister_9_1(struct file_operations *arg0 ) ; void ldv_dispatch_deregister_dummy_resourceless_instance_6_15_4(void) ; void ldv_dispatch_deregister_dummy_resourceless_instance_7_15_5(void) ; void ldv_dispatch_register_10_1(struct file_operations *arg0 ) ; void ldv_dispatch_register_dummy_resourceless_instance_6_15_6(void) ; void ldv_dispatch_register_dummy_resourceless_instance_7_15_7(void) ; void ldv_dummy_resourceless_instance_callback_5_3(long (*arg0)(struct device * , struct device_attribute * , char * ) , struct device *arg1 , struct device_attribute *arg2 , char *arg3 ) ; void ldv_dummy_resourceless_instance_callback_6_3(int (*arg0)(char * , struct kernel_param * ) , char *arg1 , struct kernel_param *arg2 ) ; void ldv_dummy_resourceless_instance_callback_7_3(int (*arg0)(char * , struct kernel_param * ) , char *arg1 , struct kernel_param *arg2 ) ; void ldv_entry_EMGentry_15(void *arg0 ) ; int main(void) ; void ldv_file_operations_file_operations_instance_0(void *arg0 ) ; void ldv_file_operations_file_operations_instance_1(void *arg0 ) ; void ldv_file_operations_file_operations_instance_2(void *arg0 ) ; void ldv_file_operations_file_operations_instance_3(void *arg0 ) ; void ldv_file_operations_instance_callback_0_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) ; void ldv_file_operations_instance_callback_0_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; void ldv_file_operations_instance_callback_0_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; void ldv_file_operations_instance_callback_1_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) ; void ldv_file_operations_instance_callback_1_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_file_operations_instance_callback_2_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) ; void ldv_file_operations_instance_callback_2_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; int ldv_file_operations_instance_probe_1_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; int ldv_file_operations_instance_probe_2_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_release_0_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_release_1_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_release_2_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_write_1_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_file_operations_instance_write_2_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_misc_deregister(void *arg0 , struct miscdevice *arg1 ) ; int ldv_misc_register(int arg0 , struct miscdevice *arg1 ) ; void ldv_struct_device_attribute_dummy_resourceless_instance_5(void *arg0 ) ; void ldv_struct_kernel_param_ops_dummy_resourceless_instance_6(void *arg0 ) ; void ldv_struct_kernel_param_ops_dummy_resourceless_instance_7(void *arg0 ) ; struct ldv_thread ldv_thread_15 ; struct ldv_thread ldv_thread_5 ; struct ldv_thread ldv_thread_6 ; struct ldv_thread ldv_thread_7 ; void ldv_EMGentry_exit_ubi_exit_15_2(void (*arg0)(void) ) { { { ubi_exit(); } return; } } int ldv_EMGentry_init_ubi_init_15_11(int (*arg0)(void) ) { int tmp ; { { tmp = ubi_init(); } return (tmp); } } void ldv_cdev_del(void *arg0 , struct cdev *arg1 ) { struct cdev *ldv_9_cdev_cdev ; struct file_operations *ldv_9_file_operations_file_operations ; { { ldv_9_cdev_cdev = arg1; ldv_9_file_operations_file_operations = (struct file_operations *)ldv_9_cdev_cdev->ops; ldv_dispatch_deregister_9_1(ldv_9_file_operations_file_operations); } return; return; } } void ldv_cdev_init(void *arg0 , struct cdev *arg1 , struct file_operations *arg2 ) { struct cdev *ldv_10_cdev_cdev ; struct file_operations *ldv_10_file_operations_file_operations ; { { ldv_10_cdev_cdev = arg1; ldv_10_file_operations_file_operations = arg2; ldv_10_cdev_cdev->ops = (struct file_operations const *)ldv_10_file_operations_file_operations; ldv_dispatch_register_10_1(ldv_10_file_operations_file_operations); } return; return; } } void ldv_dispatch_deregister_9_1(struct file_operations *arg0 ) { int tmp ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } if (tmp == 3) { goto case_3; } else { } goto switch_default; case_0: /* CIL Label */ ; goto ldv_33213; case_1: /* CIL Label */ ; goto ldv_33213; case_2: /* CIL Label */ ; goto ldv_33213; case_3: /* CIL Label */ ; goto ldv_33213; switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_33213: ; return; } } void ldv_dispatch_deregister_dummy_resourceless_instance_6_15_4(void) { { return; } } void ldv_dispatch_deregister_dummy_resourceless_instance_7_15_5(void) { { return; } } void ldv_dispatch_register_10_1(struct file_operations *arg0 ) { struct ldv_struct_file_operations_instance_0 *cf_arg_0 ; struct ldv_struct_file_operations_instance_0 *cf_arg_1 ; struct ldv_struct_file_operations_instance_0 *cf_arg_2 ; struct ldv_struct_file_operations_instance_0 *cf_arg_3 ; int tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; { { tmp = ldv_undef_int(); } { if (tmp == 0) { goto case_0; } else { } if (tmp == 1) { goto case_1; } else { } if (tmp == 2) { goto case_2; } else { } if (tmp == 3) { goto case_3; } else { } goto switch_default; case_0: /* CIL Label */ { tmp___0 = ldv_xmalloc(16UL); cf_arg_0 = (struct ldv_struct_file_operations_instance_0 *)tmp___0; cf_arg_0->arg0 = arg0; ldv_file_operations_file_operations_instance_0((void *)cf_arg_0); } goto ldv_33237; case_1: /* CIL Label */ { tmp___1 = ldv_xmalloc(16UL); cf_arg_1 = (struct ldv_struct_file_operations_instance_0 *)tmp___1; cf_arg_1->arg0 = arg0; ldv_file_operations_file_operations_instance_1((void *)cf_arg_1); } goto ldv_33237; case_2: /* CIL Label */ { tmp___2 = ldv_xmalloc(16UL); cf_arg_2 = (struct ldv_struct_file_operations_instance_0 *)tmp___2; cf_arg_2->arg0 = arg0; ldv_file_operations_file_operations_instance_2((void *)cf_arg_2); } goto ldv_33237; case_3: /* CIL Label */ { tmp___3 = ldv_xmalloc(16UL); cf_arg_3 = (struct ldv_struct_file_operations_instance_0 *)tmp___3; cf_arg_3->arg0 = arg0; ldv_file_operations_file_operations_instance_3((void *)cf_arg_3); } goto ldv_33237; switch_default: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_33237: ; return; } } void ldv_dispatch_register_dummy_resourceless_instance_6_15_6(void) { struct ldv_struct_EMGentry_15 *cf_arg_4 ; struct ldv_struct_EMGentry_15 *cf_arg_5 ; void *tmp ; void *tmp___0 ; { { tmp = ldv_xmalloc(4UL); cf_arg_4 = (struct ldv_struct_EMGentry_15 *)tmp; ldv_struct_device_attribute_dummy_resourceless_instance_4((void *)cf_arg_4); tmp___0 = ldv_xmalloc(4UL); cf_arg_5 = (struct ldv_struct_EMGentry_15 *)tmp___0; ldv_struct_device_attribute_dummy_resourceless_instance_5((void *)cf_arg_5); } return; } } void ldv_dispatch_register_dummy_resourceless_instance_7_15_7(void) { struct ldv_struct_EMGentry_15 *cf_arg_6 ; struct ldv_struct_EMGentry_15 *cf_arg_7 ; void *tmp ; void *tmp___0 ; { { tmp = ldv_xmalloc(4UL); cf_arg_6 = (struct ldv_struct_EMGentry_15 *)tmp; ldv_struct_kernel_param_ops_dummy_resourceless_instance_6((void *)cf_arg_6); tmp___0 = ldv_xmalloc(4UL); cf_arg_7 = (struct ldv_struct_EMGentry_15 *)tmp___0; ldv_struct_kernel_param_ops_dummy_resourceless_instance_7((void *)cf_arg_7); } return; } } void ldv_dummy_resourceless_instance_callback_5_3(long (*arg0)(struct device * , struct device_attribute * , char * ) , struct device *arg1 , struct device_attribute *arg2 , char *arg3 ) { { { dev_attribute_show(arg1, arg2, arg3); } return; } } void ldv_dummy_resourceless_instance_callback_6_3(int (*arg0)(char * , struct kernel_param * ) , char *arg1 , struct kernel_param *arg2 ) { { { ubi_mtd_param_parse((char const *)arg1, arg2); } return; } } void ldv_entry_EMGentry_15(void *arg0 ) { void (*ldv_15_exit_ubi_exit_default)(void) ; int (*ldv_15_init_ubi_init_default)(void) ; int ldv_15_ret_default ; int tmp ; int tmp___0 ; { { ldv_15_ret_default = ldv_EMGentry_init_ubi_init_15_11(ldv_15_init_ubi_init_default); ldv_15_ret_default = ldv_ldv_post_init_130(ldv_15_ret_default); tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { { ldv_assume(ldv_15_ret_default != 0); ldv_ldv_check_final_state_131(); ldv_stop(); } return; } else { { ldv_assume(ldv_15_ret_default == 0); tmp = ldv_undef_int(); } if (tmp != 0) { { ldv_dispatch_register_dummy_resourceless_instance_7_15_7(); ldv_dispatch_register_dummy_resourceless_instance_6_15_6(); ldv_dispatch_deregister_dummy_resourceless_instance_7_15_5(); ldv_dispatch_deregister_dummy_resourceless_instance_6_15_4(); } } else { } { ldv_EMGentry_exit_ubi_exit_15_2(ldv_15_exit_ubi_exit_default); ldv_ldv_check_final_state_132(); ldv_stop(); } return; } return; } } int main(void) { { { ldv_ldv_initialize_133(); ldv_entry_EMGentry_15((void *)0); } return 0; } } void ldv_file_operations_instance_callback_0_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) { { { (*arg0)(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_0_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { (*arg0)(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_0_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { (*arg0)(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_1_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) { { { (*arg0)(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_1_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { (*arg0)(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_2_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) { { { (*arg0)(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_2_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { (*arg0)(arg1, arg2, arg3, arg4); } return; } } int ldv_file_operations_instance_probe_1_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { int tmp ; { { tmp = (*arg0)(arg1, arg2); } return (tmp); } } int ldv_file_operations_instance_probe_2_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { int tmp ; { { tmp = (*arg0)(arg1, arg2); } return (tmp); } } void ldv_file_operations_instance_release_0_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { { { (*arg0)(arg1, arg2); } return; } } void ldv_file_operations_instance_release_1_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { { { (*arg0)(arg1, arg2); } return; } } void ldv_file_operations_instance_release_2_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { { { (*arg0)(arg1, arg2); } return; } } void ldv_file_operations_instance_write_1_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { (*arg0)(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_write_2_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { (*arg0)(arg1, arg2, arg3, arg4); } return; } } void ldv_misc_deregister(void *arg0 , struct miscdevice *arg1 ) { struct file_operations *ldv_11_file_operations_file_operations ; struct miscdevice *ldv_11_miscdevice_miscdevice ; { ldv_11_miscdevice_miscdevice = arg1; ldv_11_file_operations_file_operations = (struct file_operations *)ldv_11_miscdevice_miscdevice->fops; return; return; } } int ldv_misc_register(int arg0 , struct miscdevice *arg1 ) { struct file_operations *ldv_12_file_operations_file_operations ; struct miscdevice *ldv_12_miscdevice_miscdevice ; int tmp ; { { tmp = ldv_undef_int(); } if (tmp != 0) { { ldv_assume(arg0 == 0); ldv_12_miscdevice_miscdevice = arg1; ldv_12_file_operations_file_operations = (struct file_operations *)ldv_12_miscdevice_miscdevice->fops; } return (arg0); } else { { ldv_assume(arg0 != 0); } return (arg0); } return (arg0); } } void ldv_struct_device_attribute_dummy_resourceless_instance_5(void *arg0 ) { long (*ldv_5_callback_show)(struct device * , struct device_attribute * , char * ) ; struct device_attribute *ldv_5_container_struct_device_attribute ; struct device *ldv_5_container_struct_device_ptr ; char *ldv_5_ldv_param_3_2_default ; void *tmp ; int tmp___0 ; { goto ldv_call_5; return; ldv_call_5: { tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { { tmp = ldv_xmalloc(1UL); ldv_5_ldv_param_3_2_default = (char *)tmp; ldv_dummy_resourceless_instance_callback_5_3(ldv_5_callback_show, ldv_5_container_struct_device_ptr, ldv_5_container_struct_device_attribute, ldv_5_ldv_param_3_2_default); ldv_free((void *)ldv_5_ldv_param_3_2_default); } goto ldv_call_5; } else { return; } return; } } void ldv_struct_kernel_param_ops_dummy_resourceless_instance_6(void *arg0 ) { int (*ldv_6_callback_set)(char * , struct kernel_param * ) ; struct kernel_param *ldv_6_container_struct_kernel_param ; char *ldv_6_ldv_param_3_0_default ; void *tmp ; int tmp___0 ; { goto ldv_call_6; return; ldv_call_6: { tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { { tmp = ldv_xmalloc(1UL); ldv_6_ldv_param_3_0_default = (char *)tmp; ldv_dummy_resourceless_instance_callback_6_3(ldv_6_callback_set, ldv_6_ldv_param_3_0_default, ldv_6_container_struct_kernel_param); ldv_free((void *)ldv_6_ldv_param_3_0_default); } goto ldv_call_6; } else { return; } return; } } void ldv_struct_kernel_param_ops_dummy_resourceless_instance_7(void *arg0 ) { int (*ldv_7_callback_set)(char * , struct kernel_param * ) ; struct kernel_param *ldv_7_container_struct_kernel_param ; char *ldv_7_ldv_param_3_0_default ; void *tmp ; int tmp___0 ; { goto ldv_call_7; return; ldv_call_7: { tmp___0 = ldv_undef_int(); } if (tmp___0 != 0) { { tmp = ldv_xmalloc(1UL); ldv_7_ldv_param_3_0_default = (char *)tmp; ldv_dummy_resourceless_instance_callback_7_3(ldv_7_callback_set, ldv_7_ldv_param_3_0_default, ldv_7_container_struct_kernel_param); ldv_free((void *)ldv_7_ldv_param_3_0_default); } goto ldv_call_7; } else { return; } return; } } static void ldv_mutex_lock_95___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_96___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } __inline static void ldv_spin_lock_97(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_lock_ubi_devices_lock(); spin_lock(lock); } return; } } __inline static void ldv_spin_unlock_98(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_unlock_ubi_devices_lock(); spin_unlock(lock); } return; } } static int ldv_alloc_chrdev_region_106(dev_t *ldv_func_arg1 , unsigned int ldv_func_arg2 , unsigned int ldv_func_arg3 , char const *ldv_func_arg4 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int res1 ; int tmp___0 ; int res2 ; int tmp___1 ; { { tmp = alloc_chrdev_region(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, ldv_func_arg4); ldv_func_res = tmp; tmp___0 = ldv_linux_fs_char_dev_register_chrdev_region(); res1 = tmp___0; tmp___1 = ldv_linux_usb_gadget_register_chrdev_region(); res2 = tmp___1; ldv_assume(res1 == res2); } return (res1); return (ldv_func_res); } } static void ldv_cdev_init_107(struct cdev *ldv_func_arg1 , struct file_operations const *ldv_func_arg2 ) { { { cdev_init(ldv_func_arg1, ldv_func_arg2); ldv_cdev_init((void *)0, ldv_func_arg1, (struct file_operations *)ldv_func_arg2); } return; } } static void ldv_cdev_del_108(struct cdev *ldv_func_arg1 ) { { { cdev_del(ldv_func_arg1); ldv_cdev_del((void *)0, ldv_func_arg1); } return; } } static void ldv_unregister_chrdev_region_109(dev_t ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { { unregister_chrdev_region(ldv_func_arg1, ldv_func_arg2); ldv_linux_fs_char_dev_unregister_chrdev_region(); ldv_linux_usb_gadget_unregister_chrdev_region(); } return; } } static void ldv_cdev_del_110___0(struct cdev *ldv_func_arg1 ) { { { cdev_del(ldv_func_arg1); ldv_cdev_del((void *)0, ldv_func_arg1); } return; } } static void ldv_unregister_chrdev_region_111(dev_t ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { { unregister_chrdev_region(ldv_func_arg1, ldv_func_arg2); ldv_linux_fs_char_dev_unregister_chrdev_region(); ldv_linux_usb_gadget_unregister_chrdev_region(); } return; } } static void *ldv_vmalloc_112(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_vzalloc_113(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } __inline static void ldv_spin_lock_114(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_lock_wl_lock_of_ubi_device(); spin_lock(lock); } return; } } __inline static void ldv_spin_unlock_115(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_unlock_wl_lock_of_ubi_device(); spin_unlock(lock); } return; } } static int ldv_misc_register_119(struct miscdevice *ldv_func_arg1 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = misc_register(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_misc_register(ldv_func_res, ldv_func_arg1); } return (tmp___0); return (ldv_func_res); } } static void ldv_mutex_lock_120(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_121(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_lock_122(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_123(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(ldv_func_arg1); } return; } } static int ldv_misc_deregister_124(struct miscdevice *ldv_func_arg1 ) { ldv_func_ret_type___2 ldv_func_res ; int tmp ; { { tmp = misc_deregister(ldv_func_arg1); ldv_func_res = tmp; ldv_misc_deregister((void *)0, ldv_func_arg1); } return (ldv_func_res); } } static void ldv_class_destroy_125(struct class *cls ) { { { ldv_linux_drivers_base_class_destroy_class(cls); ldv_linux_usb_gadget_destroy_class(cls); } return; } } static void ldv_mutex_lock_126(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_127(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(ldv_func_arg1); } return; } } static int ldv_misc_deregister_128(struct miscdevice *ldv_func_arg1 ) { ldv_func_ret_type___3 ldv_func_res ; int tmp ; { { tmp = misc_deregister(ldv_func_arg1); ldv_func_res = tmp; ldv_misc_deregister((void *)0, ldv_func_arg1); } return (ldv_func_res); } } static void ldv_class_destroy_129(struct class *cls ) { { { ldv_linux_drivers_base_class_destroy_class(cls); ldv_linux_usb_gadget_destroy_class(cls); } return; } } static int ldv_ldv_post_init_130(int ldv_func_arg1 ) { int tmp ; { { ldv_linux_net_register_reset_error_counter(); ldv_linux_usb_register_reset_error_counter(); tmp = ldv_post_init(ldv_func_arg1); } return (tmp); } } static void ldv_ldv_check_final_state_131(void) { { { ldv_linux_arch_io_check_final_state(); ldv_linux_block_genhd_check_final_state(); ldv_linux_block_queue_check_final_state(); ldv_linux_block_request_check_final_state(); ldv_linux_drivers_base_class_check_final_state(); ldv_linux_fs_char_dev_check_final_state(); ldv_linux_fs_sysfs_check_final_state(); ldv_linux_kernel_locking_rwlock_check_final_state(); ldv_linux_kernel_module_check_final_state(); ldv_linux_kernel_rcu_update_lock_bh_check_final_state(); ldv_linux_kernel_rcu_update_lock_sched_check_final_state(); ldv_linux_kernel_rcu_update_lock_check_final_state(); ldv_linux_kernel_rcu_srcu_check_final_state(); ldv_linux_lib_idr_check_final_state(); ldv_linux_mmc_sdio_func_check_final_state(); ldv_linux_net_rtnetlink_check_final_state(); ldv_linux_net_sock_check_final_state(); ldv_linux_usb_coherent_check_final_state(); ldv_linux_usb_gadget_check_final_state(); ldv_linux_usb_urb_check_final_state(); } return; } } static void ldv_ldv_check_final_state_132(void) { { { ldv_linux_arch_io_check_final_state(); ldv_linux_block_genhd_check_final_state(); ldv_linux_block_queue_check_final_state(); ldv_linux_block_request_check_final_state(); ldv_linux_drivers_base_class_check_final_state(); ldv_linux_fs_char_dev_check_final_state(); ldv_linux_fs_sysfs_check_final_state(); ldv_linux_kernel_locking_rwlock_check_final_state(); ldv_linux_kernel_module_check_final_state(); ldv_linux_kernel_rcu_update_lock_bh_check_final_state(); ldv_linux_kernel_rcu_update_lock_sched_check_final_state(); ldv_linux_kernel_rcu_update_lock_check_final_state(); ldv_linux_kernel_rcu_srcu_check_final_state(); ldv_linux_lib_idr_check_final_state(); ldv_linux_mmc_sdio_func_check_final_state(); ldv_linux_net_rtnetlink_check_final_state(); ldv_linux_net_sock_check_final_state(); ldv_linux_usb_coherent_check_final_state(); ldv_linux_usb_gadget_check_final_state(); ldv_linux_usb_urb_check_final_state(); } return; } } static void ldv_ldv_initialize_133(void) { { { ldv_linux_lib_find_bit_initialize(); } return; } } int ldv_filter_err_code(int ret_val ) ; static void ldv_mutex_lock_99(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_103(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_105(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_107(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_109(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_111(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_113(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_115(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_i_mutex_of_inode(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_i_mutex_of_inode(struct mutex *lock ) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; 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(struct list_head * ) ; __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } extern size_t strlen(char const * ) ; __inline static long PTR_ERR(void const *ptr ) ; static void ldv_mutex_unlock_100(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_104(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_106(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_108(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_110(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_112(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_114(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_116(struct mutex *ldv_func_arg1 ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; static void *ldv_vmalloc_101(unsigned long ldv_func_arg1 ) ; static void *ldv_vmalloc_102(unsigned long ldv_func_arg1 ) ; extern bool capable(int ) ; __inline static struct inode *file_inode(struct file const *f ) { { return ((struct inode *)f->f_inode); } } extern loff_t no_llseek(struct file * , loff_t , int ) ; extern loff_t fixed_size_llseek(struct file * , loff_t , int , loff_t ) ; extern unsigned long _copy_to_user(void * , void const * , unsigned int ) ; extern void __copy_to_user_overflow(void) ; __inline static unsigned long copy_to_user(void *to , void const *from , unsigned long n ) { int sz ; long tmp ; long tmp___0 ; { { sz = -1; might_fault(); tmp = ldv__builtin_expect(sz < 0, 1L); } if (tmp != 0L) { { n = _copy_to_user(to, from, (unsigned int )n); } } else { { tmp___0 = ldv__builtin_expect((unsigned long )sz >= n, 1L); } if (tmp___0 != 0L) { { n = _copy_to_user(to, from, (unsigned int )n); } } else { { __copy_to_user_overflow(); } } } return (n); } } __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static void *compat_ptr(compat_uptr_t uptr ) { { return ((void *)((unsigned long )uptr)); } } void ubi_get_volume_info(struct ubi_volume_desc *desc , struct ubi_volume_info *vi ) ; struct ubi_volume_desc *ubi_open_volume(int ubi_num , int vol_id , int mode ) ; struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num , char const *name , int mode ) ; void ubi_close_volume(struct ubi_volume_desc *desc ) ; int ubi_leb_unmap(struct ubi_volume_desc *desc , int lnum ) ; int ubi_leb_map(struct ubi_volume_desc *desc , int lnum ) ; int ubi_is_mapped(struct ubi_volume_desc *desc , int lnum ) ; int ubi_sync(int ubi_num ) ; void ubi_dump_mkvol_req(struct ubi_mkvol_req const *req ) ; int ubi_check_volume(struct ubi_device *ubi , int vol_id ) ; int ubi_eba_read_leb(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void *buf , int offset , int len , int check ) ; int ubiblock_create(struct ubi_volume_info *vi ) ; int ubiblock_remove(struct ubi_volume_info *vi ) ; static int get_exclusive(struct ubi_volume_desc *desc ) { int users ; int err ; struct ubi_volume *vol ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; { { vol = desc->vol; ldv_spin_lock_95(& (vol->ubi)->volumes_lock); users = ((vol->readers + vol->writers) + vol->exclusive) + vol->metaonly; tmp___0 = ldv__builtin_expect(users <= 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "get_exclusive", 64, tmp->pid); dump_stack(); } } else { } if (users > 1) { { printk("\vubi%d error: %s: %d users for volume %d\n", (vol->ubi)->ubi_num, "get_exclusive", users, vol->vol_id); err = -16; } } else { tmp___2 = 0; vol->metaonly = tmp___2; tmp___1 = tmp___2; vol->writers = tmp___1; vol->readers = tmp___1; vol->exclusive = 1; err = desc->mode; desc->mode = 3; } { ldv_spin_unlock_96(& (vol->ubi)->volumes_lock); } return (err); } } static void revoke_exclusive(struct ubi_volume_desc *desc , int mode ) { struct ubi_volume *vol ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; { { vol = desc->vol; ldv_spin_lock_95(& (vol->ubi)->volumes_lock); tmp___0 = ldv__builtin_expect(((unsigned long )*((long *)vol + 220UL) & 0xffffffffffffffffUL) != 0UL, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "revoke_exclusive", 89, tmp->pid); dump_stack(); } } else { { tmp___1 = ldv__builtin_expect(vol->metaonly != 0, 0L); } if (tmp___1 != 0L) { { tmp = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "revoke_exclusive", 89, tmp->pid); dump_stack(); } } else { } } { tmp___3 = ldv__builtin_expect(vol->exclusive != 1, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "revoke_exclusive", 90, tmp___2->pid); dump_stack(); } } else { { tmp___4 = ldv__builtin_expect(desc->mode != 3, 0L); } if (tmp___4 != 0L) { { tmp___2 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "revoke_exclusive", 90, tmp___2->pid); dump_stack(); } } else { } } vol->exclusive = 0; if (mode == 1) { vol->readers = 1; } else if (mode == 2) { vol->writers = 1; } else if (mode == 4) { vol->metaonly = 1; } else { vol->exclusive = 1; } { ldv_spin_unlock_96(& (vol->ubi)->volumes_lock); desc->mode = mode; } return; } } static int vol_cdev_open(struct inode *inode , struct file *file ) { struct ubi_volume_desc *desc ; int vol_id ; unsigned int tmp ; int mode ; int ubi_num ; unsigned int tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; bool tmp___4 ; { { tmp = iminor((struct inode const *)inode); vol_id = (int )(tmp - 1U); tmp___0 = imajor((struct inode const *)inode); ubi_num = ubi_major2num((int )tmp___0); } if (ubi_num < 0) { return (ubi_num); } else { } if ((file->f_mode & 2U) != 0U) { mode = 2; } else { mode = 1; } { descriptor.modname = "ubi"; descriptor.function = "vol_cdev_open"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): open device %d, volume %d, mode %d\n"; descriptor.lineno = 120U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): open device %d, volume %d, mode %d\n", tmp___1->pid, ubi_num, vol_id, mode); } } else { } { desc = ubi_open_volume(ubi_num, vol_id, mode); tmp___4 = IS_ERR((void const *)desc); } if ((int )tmp___4) { { tmp___3 = PTR_ERR((void const *)desc); } return ((int )tmp___3); } else { } file->private_data = (void *)desc; return (0); } } static int vol_cdev_release(struct inode *inode , struct file *file ) { struct ubi_volume_desc *desc ; struct ubi_volume *vol ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; { { desc = (struct ubi_volume_desc *)file->private_data; vol = desc->vol; descriptor.modname = "ubi"; descriptor.function = "vol_cdev_release"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): release device %d, volume %d, mode %d\n"; descriptor.lineno = 136U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): release device %d, volume %d, mode %d\n", tmp->pid, (vol->ubi)->ubi_num, vol->vol_id, desc->mode); } } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { printk("\fubi%d warning: %s: update of volume %d not finished, volume is damaged\n", (vol->ubi)->ubi_num, "vol_cdev_release", vol->vol_id); tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)vol + 1992UL) != 0U, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___2(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "vol_cdev_release", 141, tmp___1->pid); dump_stack(); } } else { } { vol->updating = 0U; vfree((void const *)vol->upd_buf); } } else if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { descriptor___0.modname = "ubi"; descriptor___0.function = "vol_cdev_release"; descriptor___0.filename = "drivers/mtd/ubi/cdev.c"; descriptor___0.format = "UBI DBG gen (pid %d): only %lld of %lld bytes received for atomic LEB change for volume %d:%d, cancel\n"; descriptor___0.lineno = 147U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___2(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): only %lld of %lld bytes received for atomic LEB change for volume %d:%d, cancel\n", tmp___3->pid, vol->upd_received, vol->upd_bytes, (vol->ubi)->ubi_num, vol->vol_id); } } else { } { vol->changing_leb = 0U; vfree((void const *)vol->upd_buf); } } else { } { ubi_close_volume(desc); } return (0); } } static loff_t vol_cdev_llseek(struct file *file , loff_t offset , int origin ) { struct ubi_volume_desc *desc ; struct ubi_volume *vol ; loff_t tmp ; { desc = (struct ubi_volume_desc *)file->private_data; vol = desc->vol; if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { printk("\vubi%d error: %s: updating\n", (vol->ubi)->ubi_num, "vol_cdev_llseek"); } return (-16LL); } else { } { tmp = fixed_size_llseek(file, offset, origin, vol->used_bytes); } return (tmp); } } static int vol_cdev_fsync(struct file *file , loff_t start , loff_t end , int datasync ) { struct ubi_volume_desc *desc ; struct ubi_device *ubi ; struct inode *inode ; struct inode *tmp ; int err ; { { desc = (struct ubi_volume_desc *)file->private_data; ubi = (desc->vol)->ubi; tmp = file_inode((struct file const *)file); inode = tmp; ldv_mutex_lock_99(& inode->i_mutex); err = ubi_sync(ubi->ubi_num); ldv_mutex_unlock_100(& inode->i_mutex); } return (err); } } static ssize_t vol_cdev_read(struct file *file , char *buf , size_t count , loff_t *offp ) { struct ubi_volume_desc *desc ; struct ubi_volume *vol ; struct ubi_device *ubi ; int err ; int lnum ; int off ; int len ; int tbuf_size ; size_t count_save ; void *tbuf ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; u64 tmp___3 ; unsigned long tmp___4 ; { { desc = (struct ubi_volume_desc *)file->private_data; vol = desc->vol; ubi = vol->ubi; count_save = count; descriptor.modname = "ubi"; descriptor.function = "vol_cdev_read"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): read %zd bytes from offset %lld of volume %d\n"; descriptor.lineno = 195U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): read %zd bytes from offset %lld of volume %d\n", tmp->pid, count, *offp, vol->vol_id); } } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { printk("\vubi%d error: %s: updating\n", (vol->ubi)->ubi_num, "vol_cdev_read"); } return (-16L); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { printk("\vubi%d error: %s: damaged volume, update marker is set\n", (vol->ubi)->ubi_num, "vol_cdev_read"); } return (-9L); } else { } if (*offp == vol->used_bytes || count == 0UL) { return (0L); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { descriptor___0.modname = "ubi"; descriptor___0.function = "vol_cdev_read"; descriptor___0.filename = "drivers/mtd/ubi/cdev.c"; descriptor___0.format = "UBI DBG gen (pid %d): read from corrupted volume %d\n"; descriptor___0.lineno = 209U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___2(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): read from corrupted volume %d\n", tmp___1->pid, vol->vol_id); } } else { } } else { } if ((unsigned long long )*offp + (unsigned long long )count > (unsigned long long )vol->used_bytes) { count = (size_t )(vol->used_bytes - *offp); count_save = count; } else { } tbuf_size = vol->usable_leb_size; if (count < (size_t )tbuf_size) { tbuf_size = (int )((((unsigned int )count + (unsigned int )ubi->min_io_size) - 1U) & - ((unsigned int )ubi->min_io_size)); } else { } { tbuf = ldv_vmalloc_101((unsigned long )tbuf_size); } if ((unsigned long )tbuf == (unsigned long )((void *)0)) { return (-12L); } else { } { len = (int )((size_t )tbuf_size < count ? (size_t )tbuf_size : count); tmp___3 = div_u64_rem((u64 )*offp, (u32 )vol->usable_leb_size, (u32 *)(& off)); lnum = (int )tmp___3; } ldv_33605: { ___might_sleep("drivers/mtd/ubi/cdev.c", 225, 0); _cond_resched(); } if (off + len >= vol->usable_leb_size) { len = vol->usable_leb_size - off; } else { } { err = ubi_eba_read_leb(ubi, vol, lnum, tbuf, off, len, 0); } if (err != 0) { goto ldv_33604; } else { } off = off + len; if (off == vol->usable_leb_size) { lnum = lnum + 1; off = off - vol->usable_leb_size; } else { } { count = count - (size_t )len; *offp = *offp + (loff_t )len; tmp___4 = copy_to_user((void *)buf, (void const *)tbuf, (unsigned long )len); err = (int )tmp___4; } if (err != 0) { err = -14; goto ldv_33604; } else { } buf = buf + (unsigned long )len; len = (int )((size_t )tbuf_size < count ? (size_t )tbuf_size : count); if (count != 0UL) { goto ldv_33605; } else { } ldv_33604: { vfree((void const *)tbuf); } return ((ssize_t )(err != 0 ? (size_t )err : count_save - count)); } } static ssize_t vol_cdev_direct_write(struct file *file , char const *buf , size_t count , loff_t *offp ) { struct ubi_volume_desc *desc ; struct ubi_volume *vol ; struct ubi_device *ubi ; int lnum ; int off ; int len ; int tbuf_size ; int err ; size_t count_save ; char *tbuf ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; u64 tmp___1 ; void *tmp___2 ; unsigned long tmp___3 ; { desc = (struct ubi_volume_desc *)file->private_data; vol = desc->vol; ubi = vol->ubi; err = 0; count_save = count; if ((unsigned int )*((unsigned char *)vol + 1992UL) == 0U) { return (-1L); } else { } { descriptor.modname = "ubi"; descriptor.function = "vol_cdev_direct_write"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): requested: write %zd bytes to offset %lld of volume %u\n"; descriptor.lineno = 275U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): requested: write %zd bytes to offset %lld of volume %u\n", tmp->pid, count, *offp, vol->vol_id); } } else { } if (vol->vol_type == 4) { return (-30L); } else { } { tmp___1 = div_u64_rem((u64 )*offp, (u32 )vol->usable_leb_size, (u32 *)(& off)); lnum = (int )tmp___1; } if ((off & (ubi->min_io_size + -1)) != 0) { { printk("\vubi%d error: %s: unaligned position\n", ubi->ubi_num, "vol_cdev_direct_write"); } return (-22L); } else { } if ((unsigned long long )*offp + (unsigned long long )count > (unsigned long long )vol->used_bytes) { count = (size_t )(vol->used_bytes - *offp); count_save = count; } else { } if ((count & (size_t )(ubi->min_io_size + -1)) != 0UL) { { printk("\vubi%d error: %s: unaligned write length\n", ubi->ubi_num, "vol_cdev_direct_write"); } return (-22L); } else { } tbuf_size = vol->usable_leb_size; if (count < (size_t )tbuf_size) { tbuf_size = (int )((((unsigned int )count + (unsigned int )ubi->min_io_size) - 1U) & - ((unsigned int )ubi->min_io_size)); } else { } { tmp___2 = ldv_vmalloc_102((unsigned long )tbuf_size); tbuf = (char *)tmp___2; } if ((unsigned long )tbuf == (unsigned long )((char *)0)) { return (-12L); } else { } len = (int )((size_t )tbuf_size < count ? (size_t )tbuf_size : count); goto ldv_33627; ldv_33626: { ___might_sleep("drivers/mtd/ubi/cdev.c", 305, 0); _cond_resched(); } if (off + len >= vol->usable_leb_size) { len = vol->usable_leb_size - off; } else { } { tmp___3 = copy_from_user((void *)tbuf, (void const *)buf, (unsigned long )len); err = (int )tmp___3; } if (err != 0) { err = -14; goto ldv_33625; } else { } { err = ubi_eba_write_leb(ubi, vol, lnum, (void const *)tbuf, off, len); } if (err != 0) { goto ldv_33625; } else { } off = off + len; if (off == vol->usable_leb_size) { lnum = lnum + 1; off = off - vol->usable_leb_size; } else { } count = count - (size_t )len; *offp = *offp + (loff_t )len; buf = buf + (unsigned long )len; len = (int )((size_t )tbuf_size < count ? (size_t )tbuf_size : count); ldv_33627: ; if (count != 0UL) { goto ldv_33626; } else { } ldv_33625: { vfree((void const *)tbuf); } return ((ssize_t )(err != 0 ? (size_t )err : count_save - count)); } } static ssize_t vol_cdev_write(struct file *file , char const *buf , size_t count , loff_t *offp ) { int err ; struct ubi_volume_desc *desc ; struct ubi_volume *vol ; struct ubi_device *ubi ; ssize_t tmp ; { err = 0; desc = (struct ubi_volume_desc *)file->private_data; vol = desc->vol; ubi = vol->ubi; if ((unsigned int )*((unsigned char *)vol + 1992UL) == 0U) { { tmp = vol_cdev_direct_write(file, buf, count, offp); } return (tmp); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { err = ubi_more_update_data(ubi, vol, (void const *)buf, (int )count); } } else { { err = ubi_more_leb_change_data(ubi, vol, (void const *)buf, (int )count); } } if (err < 0) { { printk("\vubi%d error: %s: cannot accept more %zd bytes of data, error %d\n", ubi->ubi_num, "vol_cdev_write", count, err); } return ((ssize_t )err); } else { } if (err != 0) { count = (size_t )err; if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { { revoke_exclusive(desc, 2); } return ((ssize_t )count); } else { } { err = ubi_check_volume(ubi, vol->vol_id); } if (err < 0) { return ((ssize_t )err); } else { } if (err != 0) { { printk("\fubi%d warning: %s: volume %d on UBI device %d is corrupted\n", ubi->ubi_num, "vol_cdev_write", vol->vol_id, ubi->ubi_num); vol->corrupted = 1U; } } else { } { vol->checked = 1U; ubi_volume_notify(ubi, vol, 4); revoke_exclusive(desc, 2); } } else { } return ((ssize_t )count); } } static long vol_cdev_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { int err ; struct ubi_volume_desc *desc ; struct ubi_volume *vol ; struct ubi_device *ubi ; void *argp ; int64_t bytes ; int64_t rsvd_bytes ; bool tmp ; int tmp___0 ; unsigned long tmp___1 ; struct ubi_leb_change_req req ; unsigned long tmp___2 ; int32_t lnum ; int __ret_gu ; register unsigned long __val_gu ; struct _ddebug descriptor ; struct task_struct *tmp___3 ; long tmp___4 ; struct ubi_map_req req___0 ; unsigned long tmp___5 ; int32_t lnum___0 ; int __ret_gu___0 ; register unsigned long __val_gu___0 ; int32_t lnum___1 ; int __ret_gu___1 ; register unsigned long __val_gu___1 ; struct ubi_set_vol_prop_req req___1 ; unsigned long tmp___6 ; struct ubi_volume_info vi ; struct ubi_volume_info vi___0 ; { err = 0; desc = (struct ubi_volume_desc *)file->private_data; vol = desc->vol; ubi = vol->ubi; argp = (void *)arg; { if (cmd == 1074286336U) { goto case_1074286336; } else { } if (cmd == 1074024194U) { goto case_1074024194; } else { } if (cmd == 1074024193U) { goto case_1074024193; } else { } if (cmd == 1074286339U) { goto case_1074286339; } else { } if (cmd == 1074024196U) { goto case_1074024196; } else { } if (cmd == 2147766021U) { goto case_2147766021; } else { } if (cmd == 1074810630U) { goto case_1074810630; } else { } if (cmd == 1082150663U) { goto case_1082150663; } else { } if (cmd == 20232U) { goto case_20232; } else { } goto switch_default___0; case_1074286336: /* CIL Label */ { tmp = capable(24); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { err = -1; goto ldv_33652; } else { } { tmp___1 = copy_from_user((void *)(& bytes), (void const *)argp, 8UL); err = (int )tmp___1; } if (err != 0) { err = -14; goto ldv_33652; } else { } if (desc->mode == 1) { err = -30; goto ldv_33652; } else { } rsvd_bytes = (long long )vol->reserved_pebs * (long long )ubi->leb_size - (long long )vol->data_pad; if (bytes < 0LL || bytes > rsvd_bytes) { err = -22; goto ldv_33652; } else { } { err = get_exclusive(desc); } if (err < 0) { goto ldv_33652; } else { } { err = ubi_start_update(ubi, vol, bytes); } if (bytes == 0LL) { { ubi_volume_notify(ubi, vol, 4); revoke_exclusive(desc, 2); } } else { } goto ldv_33652; case_1074024194: /* CIL Label */ { tmp___2 = copy_from_user((void *)(& req), (void const *)argp, 16UL); err = (int )tmp___2; } if (err != 0) { err = -14; goto ldv_33652; } else { } if (desc->mode == 1 || vol->vol_type == 4) { err = -30; goto ldv_33652; } else { } err = -22; if (((req.lnum < 0 || req.lnum >= vol->reserved_pebs) || req.bytes < 0) || req.lnum >= vol->usable_leb_size) { goto ldv_33652; } else { } { err = get_exclusive(desc); } if (err < 0) { goto ldv_33652; } else { } { err = ubi_start_leb_change(ubi, vol, (struct ubi_leb_change_req const *)(& req)); } if (req.bytes == 0) { { revoke_exclusive(desc, 2); } } else { } goto ldv_33652; case_1074024193: /* CIL Label */ { might_fault(); __asm__ volatile ("call __get_user_%P3": "=a" (__ret_gu), "=r" (__val_gu): "0" ((int32_t *)argp), "i" (4UL)); lnum = (int )__val_gu; err = __ret_gu; } if (err != 0) { err = -14; goto ldv_33652; } else { } if (desc->mode == 1 || vol->vol_type == 4) { err = -30; goto ldv_33652; } else { } if (lnum < 0 || lnum >= vol->reserved_pebs) { err = -22; goto ldv_33652; } else { } { descriptor.modname = "ubi"; descriptor.function = "vol_cdev_ioctl"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): erase LEB %d:%d\n"; descriptor.lineno = 493U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): erase LEB %d:%d\n", tmp___3->pid, vol->vol_id, lnum); } } else { } { err = ubi_eba_unmap_leb(ubi, vol, lnum); } if (err != 0) { goto ldv_33652; } else { } { err = ubi_wl_flush(ubi, -1, -1); } goto ldv_33652; case_1074286339: /* CIL Label */ { tmp___5 = copy_from_user((void *)(& req___0), (void const *)argp, 8UL); err = (int )tmp___5; } if (err != 0) { err = -14; goto ldv_33652; } else { } { err = ubi_leb_map(desc, req___0.lnum); } goto ldv_33652; case_1074024196: /* CIL Label */ { might_fault(); __asm__ volatile ("call __get_user_%P3": "=a" (__ret_gu___0), "=r" (__val_gu___0): "0" ((int32_t *)argp), "i" (4UL)); lnum___0 = (int )__val_gu___0; err = __ret_gu___0; } if (err != 0) { err = -14; goto ldv_33652; } else { } { err = ubi_leb_unmap(desc, lnum___0); } goto ldv_33652; case_2147766021: /* CIL Label */ { might_fault(); __asm__ volatile ("call __get_user_%P3": "=a" (__ret_gu___1), "=r" (__val_gu___1): "0" ((int32_t *)argp), "i" (4UL)); lnum___1 = (int )__val_gu___1; err = __ret_gu___1; } if (err != 0) { err = -14; goto ldv_33652; } else { } { err = ubi_is_mapped(desc, lnum___1); } goto ldv_33652; case_1074810630: /* CIL Label */ { tmp___6 = copy_from_user((void *)(& req___1), (void const *)argp, 16UL); err = (int )tmp___6; } if (err != 0) { err = -14; goto ldv_33652; } else { } { if ((int )req___1.property == 1) { goto case_1; } else { } goto switch_default; case_1: /* CIL Label */ { ldv_mutex_lock_103(& ubi->device_mutex); (desc->vol)->direct_writes = req___1.value != 0ULL; ldv_mutex_unlock_104(& ubi->device_mutex); } goto ldv_33677; switch_default: /* CIL Label */ err = -22; goto ldv_33677; switch_break___0: /* CIL Label */ ; } ldv_33677: ; goto ldv_33652; case_1082150663: /* CIL Label */ { ubi_get_volume_info(desc, & vi); err = ubiblock_create(& vi); } goto ldv_33652; case_20232: /* CIL Label */ { ubi_get_volume_info(desc, & vi___0); err = ubiblock_remove(& vi___0); } goto ldv_33652; switch_default___0: /* CIL Label */ err = -25; goto ldv_33652; switch_break: /* CIL Label */ ; } ldv_33652: ; return ((long )err); } } static int verify_mkvol_req(struct ubi_device const *ubi , struct ubi_mkvol_req const *req ) { int n ; int err ; __kernel_size_t tmp ; { err = -22; if ((((long long )req->bytes < 0LL || (int )req->alignment < 0) || (int )((signed char )req->vol_type) < 0) || (int )((short )req->name_len) < 0) { goto bad; } else { } if (((int )req->vol_id < 0 || (int )req->vol_id >= (int )ubi->vtbl_slots) && (int )req->vol_id != -1) { goto bad; } else { } if ((int )req->alignment == 0) { goto bad; } else { } if ((long long )req->bytes == 0LL) { goto bad; } else { } if ((unsigned int )((unsigned char )req->vol_type) - 3U > 1U) { goto bad; } else { } if ((int )req->alignment > (int )ubi->leb_size) { goto bad; } else { } n = (int )req->alignment & ((int )ubi->min_io_size + -1); if ((int )req->alignment != 1 && n != 0) { goto bad; } else { } if ((int )((signed char )req->name[0]) == 0 || (int )((short )req->name_len) == 0) { goto bad; } else { } if ((int )((short )req->name_len) > 127) { err = -36; goto bad; } else { } { tmp = strnlen((char const *)(& req->name), (__kernel_size_t )((int )req->name_len + 1)); n = (int )tmp; } if (n != (int )req->name_len) { goto bad; } else { } return (0); bad: { printk("\vubi%d error: %s: bad volume creation request\n", ubi->ubi_num, "verify_mkvol_req"); ubi_dump_mkvol_req(req); } return (err); } } static int verify_rsvol_req(struct ubi_device const *ubi , struct ubi_rsvol_req const *req ) { { if ((long long )req->bytes <= 0LL) { return (-22); } else { } if ((int )req->vol_id < 0 || (int )req->vol_id >= (int )ubi->vtbl_slots) { return (-22); } else { } return (0); } } static int rename_volumes(struct ubi_device *ubi , struct ubi_rnvol_req *req ) { int i ; int n ; int err ; struct list_head rename_list ; struct ubi_rename_entry *re ; struct ubi_rename_entry *re1 ; size_t tmp ; int tmp___0 ; int vol_id ; int name_len ; char const *name ; void *tmp___1 ; long tmp___2 ; bool tmp___3 ; int tmp___4 ; struct _ddebug descriptor ; struct task_struct *tmp___5 ; long tmp___6 ; int tmp___7 ; struct list_head const *__mptr ; struct ubi_volume_desc *desc ; int no_remove_needed ; struct list_head const *__mptr___0 ; int tmp___8 ; struct list_head const *__mptr___1 ; long tmp___9 ; bool tmp___10 ; void *tmp___11 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___12 ; long tmp___13 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; struct list_head const *__mptr___4 ; struct list_head const *__mptr___5 ; { if ((unsigned int )req->count > 32U) { return (-22); } else { } if (req->count == 0) { return (0); } else { } i = 0; goto ldv_33707; ldv_33706: ; if (req->ents[i].vol_id < 0 || req->ents[i].vol_id >= ubi->vtbl_slots) { return (-22); } else { } if ((int )req->ents[i].name_len < 0) { return (-22); } else { } if ((int )req->ents[i].name_len > 127) { return (-36); } else { } { req->ents[i].name[(int )req->ents[i].name_len] = 0; tmp = strlen((char const *)(& req->ents[i].name)); n = (int )tmp; } if (n != (int )req->ents[i].name_len) { return (-22); } else { } i = i + 1; ldv_33707: ; if (i < req->count) { goto ldv_33706; } else { } i = 0; goto ldv_33714; ldv_33713: n = i + 1; goto ldv_33711; ldv_33710: ; if (req->ents[i].vol_id == req->ents[n].vol_id) { { printk("\vubi%d error: %s: duplicated volume id %d\n", ubi->ubi_num, "rename_volumes", req->ents[i].vol_id); } return (-22); } else { } { tmp___0 = strcmp((char const *)(& req->ents[i].name), (char const *)(& req->ents[n].name)); } if (tmp___0 == 0) { { printk("\vubi%d error: %s: duplicated volume name \"%s\"\n", ubi->ubi_num, "rename_volumes", (char *)(& req->ents[i].name)); } return (-22); } else { } n = n + 1; ldv_33711: ; if (n < req->count) { goto ldv_33710; } else { } i = i + 1; ldv_33714: ; if (i < req->count + -1) { goto ldv_33713; } else { } { INIT_LIST_HEAD(& rename_list); i = 0; } goto ldv_33723; ldv_33722: { vol_id = req->ents[i].vol_id; name_len = (int )req->ents[i].name_len; name = (char const *)(& req->ents[i].name); tmp___1 = kzalloc(160UL, 208U); re = (struct ubi_rename_entry *)tmp___1; } if ((unsigned long )re == (unsigned long )((struct ubi_rename_entry *)0)) { err = -12; goto out_free; } else { } { re->desc = ubi_open_volume(ubi->ubi_num, vol_id, 4); tmp___3 = IS_ERR((void const *)re->desc); } if ((int )tmp___3) { { tmp___2 = PTR_ERR((void const *)re->desc); err = (int )tmp___2; printk("\vubi%d error: %s: cannot open volume %d, error %d\n", ubi->ubi_num, "rename_volumes", vol_id, err); kfree((void const *)re); } goto out_free; } else { } if (((re->desc)->vol)->name_len == name_len) { { tmp___4 = memcmp((void const *)(& ((re->desc)->vol)->name), (void const *)name, (size_t )name_len); } if (tmp___4 == 0) { { ubi_close_volume(re->desc); kfree((void const *)re); } goto ldv_33720; } else { } } else { } { re->new_name_len = name_len; __memcpy((void *)(& re->new_name), (void const *)name, (size_t )name_len); list_add_tail(& re->list, & rename_list); descriptor.modname = "ubi"; descriptor.function = "rename_volumes"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): will rename volume %d from \"%s\" to \"%s\"\n"; descriptor.lineno = 759U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___6 != 0L) { { tmp___5 = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): will rename volume %d from \"%s\" to \"%s\"\n", tmp___5->pid, vol_id, (char *)(& ((re->desc)->vol)->name), name); } } else { } ldv_33720: i = i + 1; ldv_33723: ; if (i < req->count) { goto ldv_33722; } else { } { tmp___7 = list_empty((struct list_head const *)(& rename_list)); } if (tmp___7 != 0) { return (0); } else { } __mptr = (struct list_head const *)rename_list.next; re = (struct ubi_rename_entry *)__mptr + 0xffffffffffffff70UL; goto ldv_33741; ldv_33740: no_remove_needed = 0; __mptr___0 = (struct list_head const *)rename_list.next; re1 = (struct ubi_rename_entry *)__mptr___0 + 0xffffffffffffff70UL; goto ldv_33737; ldv_33736: ; if (re->new_name_len == ((re1->desc)->vol)->name_len) { { tmp___8 = memcmp((void const *)(& re->new_name), (void const *)(& ((re1->desc)->vol)->name), (size_t )((re1->desc)->vol)->name_len); } if (tmp___8 == 0) { no_remove_needed = 1; goto ldv_33735; } else { } } else { } __mptr___1 = (struct list_head const *)re1->list.next; re1 = (struct ubi_rename_entry *)__mptr___1 + 0xffffffffffffff70UL; ldv_33737: ; if ((unsigned long )(& re1->list) != (unsigned long )(& rename_list)) { goto ldv_33736; } else { } ldv_33735: ; if (no_remove_needed != 0) { goto ldv_33738; } else { } { desc = ubi_open_volume_nm(ubi->ubi_num, (char const *)(& re->new_name), 3); tmp___10 = IS_ERR((void const *)desc); } if ((int )tmp___10) { { tmp___9 = PTR_ERR((void const *)desc); err = (int )tmp___9; } if (err == -19) { goto ldv_33738; } else { } { printk("\vubi%d error: %s: cannot open volume \"%s\", error %d\n", ubi->ubi_num, "rename_volumes", (char *)(& re->new_name), err); } goto out_free; } else { } { tmp___11 = kzalloc(160UL, 208U); re1 = (struct ubi_rename_entry *)tmp___11; } if ((unsigned long )re1 == (unsigned long )((struct ubi_rename_entry *)0)) { { err = -12; ubi_close_volume(desc); } goto out_free; } else { } { re1->remove = 1; re1->desc = desc; list_add(& re1->list, & rename_list); descriptor___0.modname = "ubi"; descriptor___0.function = "rename_volumes"; descriptor___0.filename = "drivers/mtd/ubi/cdev.c"; descriptor___0.format = "UBI DBG gen (pid %d): will remove volume %d, name \"%s\"\n"; descriptor___0.lineno = 817U; descriptor___0.flags = 0U; tmp___13 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___13 != 0L) { { tmp___12 = get_current___2(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): will remove volume %d, name \"%s\"\n", tmp___12->pid, ((re1->desc)->vol)->vol_id, (char *)(& ((re1->desc)->vol)->name)); } } else { } ldv_33738: __mptr___2 = (struct list_head const *)re->list.next; re = (struct ubi_rename_entry *)__mptr___2 + 0xffffffffffffff70UL; ldv_33741: ; if ((unsigned long )(& re->list) != (unsigned long )(& rename_list)) { goto ldv_33740; } else { } { ldv_mutex_lock_105(& ubi->device_mutex); err = ubi_rename_volumes(ubi, & rename_list); ldv_mutex_unlock_106(& ubi->device_mutex); } out_free: __mptr___3 = (struct list_head const *)rename_list.next; re = (struct ubi_rename_entry *)__mptr___3 + 0xffffffffffffff70UL; __mptr___4 = (struct list_head const *)re->list.next; re1 = (struct ubi_rename_entry *)__mptr___4 + 0xffffffffffffff70UL; goto ldv_33750; ldv_33749: { ubi_close_volume(re->desc); list_del(& re->list); kfree((void const *)re); re = re1; __mptr___5 = (struct list_head const *)re1->list.next; re1 = (struct ubi_rename_entry *)__mptr___5 + 0xffffffffffffff70UL; } ldv_33750: ; if ((unsigned long )(& re->list) != (unsigned long )(& rename_list)) { goto ldv_33749; } else { } return (err); } } static long ubi_cdev_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { int err ; struct ubi_device *ubi ; struct ubi_volume_desc *desc ; void *argp ; bool tmp ; int tmp___0 ; unsigned int tmp___1 ; struct ubi_mkvol_req req ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; unsigned long tmp___4 ; int __ret_pu ; int32_t __pu_val ; int vol_id ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; int __ret_gu ; register unsigned long __val_gu ; long tmp___7 ; bool tmp___8 ; int pebs ; struct ubi_rsvol_req req___0 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___9 ; long tmp___10 ; unsigned long tmp___11 ; long tmp___12 ; bool tmp___13 ; u64 tmp___14 ; struct ubi_rnvol_req *req___1 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___15 ; long tmp___16 ; void *tmp___17 ; unsigned long tmp___18 ; { { err = 0; argp = (void *)arg; tmp = capable(24); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (-1L); } else { } { tmp___1 = imajor((struct inode const *)(file->f_mapping)->host); ubi = ubi_get_by_major((int )tmp___1); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19L); } else { } { if (cmd == 1083731712U) { goto case_1083731712; } else { } if (cmd == 1074032385U) { goto case_1074032385; } else { } if (cmd == 1074556674U) { goto case_1074556674; } else { } if (cmd == 1360031491U) { goto case_1360031491; } else { } goto switch_default___0; case_1083731712: /* CIL Label */ { descriptor.modname = "ubi"; descriptor.function = "ubi_cdev_ioctl"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): create volume\n"; descriptor.lineno = 854U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): create volume\n", tmp___2->pid); } } else { } { tmp___4 = copy_from_user((void *)(& req), (void const *)argp, 152UL); err = (int )tmp___4; } if (err != 0) { err = -14; goto ldv_33765; } else { } { err = verify_mkvol_req((struct ubi_device const *)ubi, (struct ubi_mkvol_req const *)(& req)); } if (err != 0) { goto ldv_33765; } else { } { ldv_mutex_lock_107(& ubi->device_mutex); err = ubi_create_volume(ubi, & req); ldv_mutex_unlock_108(& ubi->device_mutex); } if (err != 0) { goto ldv_33765; } else { } { might_fault(); __pu_val = req.vol_id; } { if (4UL == 1UL) { goto case_1; } else { } if (4UL == 2UL) { goto case_2; } else { } if (4UL == 4UL) { goto case_4; } else { } if (4UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33769; case_2: /* CIL Label */ __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33769; case_4: /* CIL Label */ __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33769; case_8: /* CIL Label */ __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33769; switch_default: /* CIL Label */ __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33769; switch_break___0: /* CIL Label */ ; } ldv_33769: err = __ret_pu; if (err != 0) { err = -14; } else { } goto ldv_33765; case_1074032385: /* CIL Label */ { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_cdev_ioctl"; descriptor___0.filename = "drivers/mtd/ubi/cdev.c"; descriptor___0.format = "UBI DBG gen (pid %d): remove volume\n"; descriptor___0.lineno = 883U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___6 != 0L) { { tmp___5 = get_current___2(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): remove volume\n", tmp___5->pid); } } else { } { might_fault(); __asm__ volatile ("call __get_user_%P3": "=a" (__ret_gu), "=r" (__val_gu): "0" ((int32_t *)argp), "i" (4UL)); vol_id = (int )__val_gu; err = __ret_gu; } if (err != 0) { err = -14; goto ldv_33765; } else { } { desc = ubi_open_volume(ubi->ubi_num, vol_id, 3); tmp___8 = IS_ERR((void const *)desc); } if ((int )tmp___8) { { tmp___7 = PTR_ERR((void const *)desc); err = (int )tmp___7; } goto ldv_33765; } else { } { ldv_mutex_lock_109(& ubi->device_mutex); err = ubi_remove_volume(desc, 0); ldv_mutex_unlock_110(& ubi->device_mutex); ubi_close_volume(desc); } goto ldv_33765; case_1074556674: /* CIL Label */ { descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_cdev_ioctl"; descriptor___1.filename = "drivers/mtd/ubi/cdev.c"; descriptor___1.format = "UBI DBG gen (pid %d): re-size volume\n"; descriptor___1.lineno = 915U; descriptor___1.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___10 != 0L) { { tmp___9 = get_current___2(); __dynamic_pr_debug(& descriptor___1, "UBI DBG gen (pid %d): re-size volume\n", tmp___9->pid); } } else { } { tmp___11 = copy_from_user((void *)(& req___0), (void const *)argp, 12UL); err = (int )tmp___11; } if (err != 0) { err = -14; goto ldv_33765; } else { } { err = verify_rsvol_req((struct ubi_device const *)ubi, (struct ubi_rsvol_req const *)(& req___0)); } if (err != 0) { goto ldv_33765; } else { } { desc = ubi_open_volume(ubi->ubi_num, req___0.vol_id, 3); tmp___13 = IS_ERR((void const *)desc); } if ((int )tmp___13) { { tmp___12 = PTR_ERR((void const *)desc); err = (int )tmp___12; } goto ldv_33765; } else { } { tmp___14 = div_u64((u64 )((req___0.bytes + (__s64 )(desc->vol)->usable_leb_size) + -1LL), (u32 )(desc->vol)->usable_leb_size); pebs = (int )tmp___14; ldv_mutex_lock_111(& ubi->device_mutex); err = ubi_resize_volume(desc, pebs); ldv_mutex_unlock_112(& ubi->device_mutex); ubi_close_volume(desc); } goto ldv_33765; case_1360031491: /* CIL Label */ { descriptor___2.modname = "ubi"; descriptor___2.function = "ubi_cdev_ioctl"; descriptor___2.filename = "drivers/mtd/ubi/cdev.c"; descriptor___2.format = "UBI DBG gen (pid %d): re-name volumes\n"; descriptor___2.lineno = 947U; descriptor___2.flags = 0U; tmp___16 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); } if (tmp___16 != 0L) { { tmp___15 = get_current___2(); __dynamic_pr_debug(& descriptor___2, "UBI DBG gen (pid %d): re-name volumes\n", tmp___15->pid); } } else { } { tmp___17 = kmalloc(4368UL, 208U); req___1 = (struct ubi_rnvol_req *)tmp___17; } if ((unsigned long )req___1 == (unsigned long )((struct ubi_rnvol_req *)0)) { err = -12; goto ldv_33765; } else { } { tmp___18 = copy_from_user((void *)req___1, (void const *)argp, 4368UL); err = (int )tmp___18; } if (err != 0) { { err = -14; kfree((void const *)req___1); } goto ldv_33765; } else { } { err = rename_volumes(ubi, req___1); kfree((void const *)req___1); } goto ldv_33765; switch_default___0: /* CIL Label */ err = -25; goto ldv_33765; switch_break: /* CIL Label */ ; } ldv_33765: { ubi_put_device(ubi); } return ((long )err); } } static long ctrl_cdev_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { int err ; void *argp ; bool tmp ; int tmp___0 ; struct ubi_attach_req req ; struct mtd_info *mtd ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; unsigned long tmp___3 ; long tmp___4 ; bool tmp___5 ; int __ret_pu ; int32_t __pu_val ; int ubi_num ; struct _ddebug descriptor___0 ; struct task_struct *tmp___6 ; long tmp___7 ; int __ret_gu ; register unsigned long __val_gu ; { { err = 0; argp = (void *)arg; tmp = capable(24); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (-1L); } else { } { if (cmd == 1075343168U) { goto case_1075343168; } else { } if (cmd == 1074032449U) { goto case_1074032449; } else { } goto switch_default___0; case_1075343168: /* CIL Label */ { descriptor.modname = "ubi"; descriptor.function = "ctrl_cdev_ioctl"; descriptor.filename = "drivers/mtd/ubi/cdev.c"; descriptor.format = "UBI DBG gen (pid %d): attach MTD device\n"; descriptor.lineno = 991U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___2(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): attach MTD device\n", tmp___1->pid); } } else { } { tmp___3 = copy_from_user((void *)(& req), (void const *)argp, 24UL); err = (int )tmp___3; } if (err != 0) { err = -14; goto ldv_33801; } else { } if (req.mtd_num < 0 || req.ubi_num < -1) { err = -22; goto ldv_33801; } else { } { mtd = get_mtd_device((struct mtd_info *)0, req.mtd_num); tmp___5 = IS_ERR((void const *)mtd); } if ((int )tmp___5) { { tmp___4 = PTR_ERR((void const *)mtd); err = (int )tmp___4; } goto ldv_33801; } else { } { ldv_mutex_lock_113(& ubi_devices_mutex); err = ubi_attach_mtd_dev(mtd, req.ubi_num, req.vid_hdr_offset, (int )req.max_beb_per1024); ldv_mutex_unlock_114(& ubi_devices_mutex); } if (err < 0) { { put_mtd_device(mtd); } } else { { might_fault(); __pu_val = err; } { if (4UL == 1UL) { goto case_1; } else { } if (4UL == 2UL) { goto case_2; } else { } if (4UL == 4UL) { goto case_4; } else { } if (4UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33805; case_2: /* CIL Label */ __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33805; case_4: /* CIL Label */ __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33805; case_8: /* CIL Label */ __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33805; switch_default: /* CIL Label */ __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" ((int32_t *)argp): "ebx"); goto ldv_33805; switch_break___0: /* CIL Label */ ; } ldv_33805: err = __ret_pu; } goto ldv_33801; case_1074032449: /* CIL Label */ { descriptor___0.modname = "ubi"; descriptor___0.function = "ctrl_cdev_ioctl"; descriptor___0.filename = "drivers/mtd/ubi/cdev.c"; descriptor___0.format = "UBI DBG gen (pid %d): detach MTD device\n"; descriptor___0.lineno = 1032U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___7 != 0L) { { tmp___6 = get_current___2(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): detach MTD device\n", tmp___6->pid); } } else { } { might_fault(); __asm__ volatile ("call __get_user_%P3": "=a" (__ret_gu), "=r" (__val_gu): "0" ((int32_t *)argp), "i" (4UL)); ubi_num = (int )__val_gu; err = __ret_gu; } if (err != 0) { err = -14; goto ldv_33801; } else { } { ldv_mutex_lock_115(& ubi_devices_mutex); err = ubi_detach_mtd_dev(ubi_num, 0); ldv_mutex_unlock_116(& ubi_devices_mutex); } goto ldv_33801; switch_default___0: /* CIL Label */ err = -25; goto ldv_33801; switch_break: /* CIL Label */ ; } ldv_33801: ; return ((long )err); } } static long vol_cdev_compat_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { unsigned long translated_arg ; void *tmp ; long tmp___0 ; { { tmp = compat_ptr((compat_uptr_t )arg); translated_arg = (unsigned long )tmp; tmp___0 = vol_cdev_ioctl(file, cmd, translated_arg); } return (tmp___0); } } static long ubi_cdev_compat_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { unsigned long translated_arg ; void *tmp ; long tmp___0 ; { { tmp = compat_ptr((compat_uptr_t )arg); translated_arg = (unsigned long )tmp; tmp___0 = ubi_cdev_ioctl(file, cmd, translated_arg); } return (tmp___0); } } static long ctrl_cdev_compat_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { unsigned long translated_arg ; void *tmp ; long tmp___0 ; { { tmp = compat_ptr((compat_uptr_t )arg); translated_arg = (unsigned long )tmp; tmp___0 = ctrl_cdev_ioctl(file, cmd, translated_arg); } return (tmp___0); } } struct file_operations const ubi_vol_cdev_operations = {& __this_module, & vol_cdev_llseek, & vol_cdev_read, & vol_cdev_write, 0, 0, 0, 0, 0, 0, & vol_cdev_ioctl, & vol_cdev_compat_ioctl, 0, 0, & vol_cdev_open, 0, & vol_cdev_release, & vol_cdev_fsync, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; struct file_operations const ubi_cdev_operations = {& __this_module, & no_llseek, 0, 0, 0, 0, 0, 0, 0, 0, & ubi_cdev_ioctl, & ubi_cdev_compat_ioctl, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; struct file_operations const ubi_ctrl_cdev_operations = {& __this_module, & no_llseek, 0, 0, 0, 0, 0, 0, 0, 0, & ctrl_cdev_ioctl, & ctrl_cdev_compat_ioctl, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ldv_file_operations_instance_callback_1_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) ; void ldv_file_operations_instance_callback_1_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) ; void ldv_file_operations_instance_callback_1_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; void ldv_file_operations_instance_callback_1_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; void ldv_file_operations_instance_callback_2_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) ; void ldv_file_operations_instance_callback_2_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) ; void ldv_file_operations_instance_callback_2_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; void ldv_file_operations_instance_callback_2_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; void ldv_file_operations_instance_callback_3_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) ; void ldv_file_operations_instance_callback_3_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) ; void ldv_file_operations_instance_callback_3_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) ; void ldv_file_operations_instance_callback_3_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; void ldv_file_operations_instance_callback_3_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; void ldv_file_operations_instance_callback_3_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) ; int ldv_file_operations_instance_probe_3_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_release_3_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_write_3_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; struct ldv_thread ldv_thread_1 ; struct ldv_thread ldv_thread_2 ; struct ldv_thread ldv_thread_3 ; void ldv_file_operations_file_operations_instance_1(void *arg0 ) { long (*ldv_1_callback_compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*ldv_1_callback_fsync)(struct file * , long long , long long , int ) ; int (*ldv_1_callback_getgeo)(struct block_device * , struct hd_geometry * ) ; long long (*ldv_1_callback_llseek)(struct file * , long long , int ) ; long (*ldv_1_callback_read)(struct file * , char * , unsigned long , long long * ) ; long (*ldv_1_callback_unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; struct file_operations *ldv_1_container_file_operations ; long long ldv_1_ldv_param_22_1_default ; long long ldv_1_ldv_param_22_2_default ; int ldv_1_ldv_param_22_3_default ; long long ldv_1_ldv_param_26_1_default ; int ldv_1_ldv_param_26_2_default ; char *ldv_1_ldv_param_29_1_default ; long long *ldv_1_ldv_param_29_3_default ; unsigned int ldv_1_ldv_param_32_1_default ; char *ldv_1_ldv_param_4_1_default ; long long *ldv_1_ldv_param_4_3_default ; unsigned int ldv_1_ldv_param_5_1_default ; struct file *ldv_1_resource_file ; struct inode *ldv_1_resource_inode ; struct block_device *ldv_1_resource_struct_block_device_ptr ; int ldv_1_ret_default ; struct hd_geometry *ldv_1_size_cnt_struct_hd_geometry_ptr ; unsigned long ldv_1_size_cnt_write_size ; struct ldv_struct_file_operations_instance_0 *data ; void *tmp ; void *tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; void *tmp___7 ; int tmp___8 ; void *tmp___9 ; void *tmp___10 ; { data = (struct ldv_struct_file_operations_instance_0 *)arg0; ldv_1_ret_default = 1; if ((unsigned long )data != (unsigned long )((struct ldv_struct_file_operations_instance_0 *)0)) { { ldv_1_container_file_operations = data->arg0; ldv_free((void *)data); } } else { } { tmp = ldv_xmalloc(504UL); ldv_1_resource_file = (struct file *)tmp; tmp___0 = ldv_xmalloc(976UL); ldv_1_resource_inode = (struct inode *)tmp___0; tmp___1 = ldv_xmalloc(480UL); ldv_1_resource_struct_block_device_ptr = (struct block_device *)tmp___1; tmp___2 = ldv_undef_int(); ldv_1_size_cnt_struct_hd_geometry_ptr = (struct hd_geometry *)((long )tmp___2); } goto ldv_main_1; return; ldv_main_1: { tmp___4 = ldv_undef_int(); } if (tmp___4 != 0) { if ((unsigned long )ldv_1_container_file_operations->open != (unsigned long )((int (*)(struct inode * , struct file * ))0)) { { ldv_1_ret_default = ldv_file_operations_instance_probe_1_12(ldv_1_container_file_operations->open, ldv_1_resource_inode, ldv_1_resource_file); } } else { } { ldv_1_ret_default = ldv_filter_err_code(ldv_1_ret_default); tmp___3 = ldv_undef_int(); } if (tmp___3 != 0) { { ldv_assume(ldv_1_ret_default == 0); } goto ldv_call_1; } else { { ldv_assume(ldv_1_ret_default != 0); } goto ldv_main_1; } } else { { ldv_free((void *)ldv_1_resource_file); ldv_free((void *)ldv_1_resource_inode); ldv_free((void *)ldv_1_resource_struct_block_device_ptr); } return; } return; ldv_call_1: { tmp___5 = ldv_undef_int(); } { if (tmp___5 == 1) { goto case_1; } else { } if (tmp___5 == 2) { goto case_2; } else { } if (tmp___5 == 3) { goto case_3; } else { } goto switch_default___0; case_1: /* CIL Label */ { tmp___6 = ldv_xmalloc(1UL); ldv_1_ldv_param_4_1_default = (char *)tmp___6; tmp___7 = ldv_xmalloc(8UL); ldv_1_ldv_param_4_3_default = (long long *)tmp___7; ldv_assume((unsigned long )ldv_1_size_cnt_struct_hd_geometry_ptr <= (unsigned long )((struct hd_geometry *)2147479552)); } if ((unsigned long )ldv_1_container_file_operations->write != (unsigned long )((ssize_t (*)(struct file * , char const * , size_t , loff_t * ))0)) { { ldv_file_operations_instance_write_1_4((long (*)(struct file * , char * , unsigned long , long long * ))ldv_1_container_file_operations->write, ldv_1_resource_file, ldv_1_ldv_param_4_1_default, ldv_1_size_cnt_write_size, ldv_1_ldv_param_4_3_default); } } else { } { ldv_free((void *)ldv_1_ldv_param_4_1_default); ldv_free((void *)ldv_1_ldv_param_4_3_default); } goto ldv_call_1; case_2: /* CIL Label */ ; if ((unsigned long )ldv_1_container_file_operations->release != (unsigned long )((int (*)(struct inode * , struct file * ))0)) { { ldv_file_operations_instance_release_1_2(ldv_1_container_file_operations->release, ldv_1_resource_inode, ldv_1_resource_file); } } else { } goto ldv_main_1; case_3: /* CIL Label */ { tmp___8 = ldv_undef_int(); } { if (tmp___8 == 1) { goto case_1___0; } else { } if (tmp___8 == 2) { goto case_2___0; } else { } if (tmp___8 == 3) { goto case_3___0; } else { } if (tmp___8 == 4) { goto case_4; } else { } if (tmp___8 == 5) { goto case_5; } else { } if (tmp___8 == 6) { goto case_6; } else { } goto switch_default; case_1___0: /* CIL Label */ { ldv_file_operations_instance_callback_1_32(ldv_1_callback_unlocked_ioctl, ldv_1_resource_file, ldv_1_ldv_param_32_1_default, ldv_1_size_cnt_write_size); } goto ldv_34125; case_2___0: /* CIL Label */ { tmp___9 = ldv_xmalloc(1UL); ldv_1_ldv_param_29_1_default = (char *)tmp___9; tmp___10 = ldv_xmalloc(8UL); ldv_1_ldv_param_29_3_default = (long long *)tmp___10; } if ((unsigned long )ldv_1_callback_read != (unsigned long )((long (*)(struct file * , char * , unsigned long , long long * ))0)) { { ldv_file_operations_instance_callback_1_29(ldv_1_callback_read, ldv_1_resource_file, ldv_1_ldv_param_29_1_default, ldv_1_size_cnt_write_size, ldv_1_ldv_param_29_3_default); } } else { } { ldv_free((void *)ldv_1_ldv_param_29_1_default); ldv_free((void *)ldv_1_ldv_param_29_3_default); } goto ldv_34125; case_3___0: /* CIL Label */ { ldv_file_operations_instance_callback_1_26(ldv_1_callback_llseek, ldv_1_resource_file, ldv_1_ldv_param_26_1_default, ldv_1_ldv_param_26_2_default); } goto ldv_34125; case_4: /* CIL Label */ { ldv_file_operations_instance_callback_1_25(ldv_1_callback_getgeo, ldv_1_resource_struct_block_device_ptr, ldv_1_size_cnt_struct_hd_geometry_ptr); } goto ldv_34125; case_5: /* CIL Label */ ; if ((unsigned long )ldv_1_callback_fsync != (unsigned long )((int (*)(struct file * , long long , long long , int ))0)) { { ldv_file_operations_instance_callback_1_22(ldv_1_callback_fsync, ldv_1_resource_file, ldv_1_ldv_param_22_1_default, ldv_1_ldv_param_22_2_default, ldv_1_ldv_param_22_3_default); } } else { } goto ldv_34125; case_6: /* CIL Label */ { ldv_file_operations_instance_callback_1_5(ldv_1_callback_compat_ioctl, ldv_1_resource_file, ldv_1_ldv_param_5_1_default, ldv_1_size_cnt_write_size); } goto ldv_34125; switch_default: /* CIL Label */ { ldv_stop(); } switch_break___0: /* CIL Label */ ; } ldv_34125: ; goto ldv_34132; switch_default___0: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_34132: ; goto ldv_call_1; goto ldv_call_1; return; } } void ldv_file_operations_file_operations_instance_2(void *arg0 ) { long (*ldv_2_callback_compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*ldv_2_callback_fsync)(struct file * , long long , long long , int ) ; int (*ldv_2_callback_getgeo)(struct block_device * , struct hd_geometry * ) ; long long (*ldv_2_callback_llseek)(struct file * , long long , int ) ; long (*ldv_2_callback_read)(struct file * , char * , unsigned long , long long * ) ; long (*ldv_2_callback_unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; struct file_operations *ldv_2_container_file_operations ; long long ldv_2_ldv_param_22_1_default ; long long ldv_2_ldv_param_22_2_default ; int ldv_2_ldv_param_22_3_default ; long long ldv_2_ldv_param_26_1_default ; int ldv_2_ldv_param_26_2_default ; char *ldv_2_ldv_param_29_1_default ; long long *ldv_2_ldv_param_29_3_default ; unsigned int ldv_2_ldv_param_32_1_default ; char *ldv_2_ldv_param_4_1_default ; long long *ldv_2_ldv_param_4_3_default ; unsigned int ldv_2_ldv_param_5_1_default ; struct file *ldv_2_resource_file ; struct inode *ldv_2_resource_inode ; struct block_device *ldv_2_resource_struct_block_device_ptr ; int ldv_2_ret_default ; struct hd_geometry *ldv_2_size_cnt_struct_hd_geometry_ptr ; unsigned long ldv_2_size_cnt_write_size ; struct ldv_struct_file_operations_instance_0 *data ; void *tmp ; void *tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; void *tmp___7 ; int tmp___8 ; void *tmp___9 ; void *tmp___10 ; { data = (struct ldv_struct_file_operations_instance_0 *)arg0; ldv_2_ret_default = 1; if ((unsigned long )data != (unsigned long )((struct ldv_struct_file_operations_instance_0 *)0)) { { ldv_2_container_file_operations = data->arg0; ldv_free((void *)data); } } else { } { tmp = ldv_xmalloc(504UL); ldv_2_resource_file = (struct file *)tmp; tmp___0 = ldv_xmalloc(976UL); ldv_2_resource_inode = (struct inode *)tmp___0; tmp___1 = ldv_xmalloc(480UL); ldv_2_resource_struct_block_device_ptr = (struct block_device *)tmp___1; tmp___2 = ldv_undef_int(); ldv_2_size_cnt_struct_hd_geometry_ptr = (struct hd_geometry *)((long )tmp___2); } goto ldv_main_2; return; ldv_main_2: { tmp___4 = ldv_undef_int(); } if (tmp___4 != 0) { if ((unsigned long )ldv_2_container_file_operations->open != (unsigned long )((int (*)(struct inode * , struct file * ))0)) { { ldv_2_ret_default = ldv_file_operations_instance_probe_2_12(ldv_2_container_file_operations->open, ldv_2_resource_inode, ldv_2_resource_file); } } else { } { ldv_2_ret_default = ldv_filter_err_code(ldv_2_ret_default); tmp___3 = ldv_undef_int(); } if (tmp___3 != 0) { { ldv_assume(ldv_2_ret_default == 0); } goto ldv_call_2; } else { { ldv_assume(ldv_2_ret_default != 0); } goto ldv_main_2; } } else { { ldv_free((void *)ldv_2_resource_file); ldv_free((void *)ldv_2_resource_inode); ldv_free((void *)ldv_2_resource_struct_block_device_ptr); } return; } return; ldv_call_2: { tmp___5 = ldv_undef_int(); } { if (tmp___5 == 1) { goto case_1; } else { } if (tmp___5 == 2) { goto case_2; } else { } if (tmp___5 == 3) { goto case_3; } else { } goto switch_default___0; case_1: /* CIL Label */ { tmp___6 = ldv_xmalloc(1UL); ldv_2_ldv_param_4_1_default = (char *)tmp___6; tmp___7 = ldv_xmalloc(8UL); ldv_2_ldv_param_4_3_default = (long long *)tmp___7; ldv_assume((unsigned long )ldv_2_size_cnt_struct_hd_geometry_ptr <= (unsigned long )((struct hd_geometry *)2147479552)); } if ((unsigned long )ldv_2_container_file_operations->write != (unsigned long )((ssize_t (*)(struct file * , char const * , size_t , loff_t * ))0)) { { ldv_file_operations_instance_write_2_4((long (*)(struct file * , char * , unsigned long , long long * ))ldv_2_container_file_operations->write, ldv_2_resource_file, ldv_2_ldv_param_4_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_4_3_default); } } else { } { ldv_free((void *)ldv_2_ldv_param_4_1_default); ldv_free((void *)ldv_2_ldv_param_4_3_default); } goto ldv_call_2; case_2: /* CIL Label */ ; if ((unsigned long )ldv_2_container_file_operations->release != (unsigned long )((int (*)(struct inode * , struct file * ))0)) { { ldv_file_operations_instance_release_2_2(ldv_2_container_file_operations->release, ldv_2_resource_inode, ldv_2_resource_file); } } else { } goto ldv_main_2; case_3: /* CIL Label */ { tmp___8 = ldv_undef_int(); } { if (tmp___8 == 1) { goto case_1___0; } else { } if (tmp___8 == 2) { goto case_2___0; } else { } if (tmp___8 == 3) { goto case_3___0; } else { } if (tmp___8 == 4) { goto case_4; } else { } if (tmp___8 == 5) { goto case_5; } else { } if (tmp___8 == 6) { goto case_6; } else { } goto switch_default; case_1___0: /* CIL Label */ { ldv_file_operations_instance_callback_2_32(ldv_2_callback_unlocked_ioctl, ldv_2_resource_file, ldv_2_ldv_param_32_1_default, ldv_2_size_cnt_write_size); } goto ldv_34187; case_2___0: /* CIL Label */ { tmp___9 = ldv_xmalloc(1UL); ldv_2_ldv_param_29_1_default = (char *)tmp___9; tmp___10 = ldv_xmalloc(8UL); ldv_2_ldv_param_29_3_default = (long long *)tmp___10; } if ((unsigned long )ldv_2_callback_read != (unsigned long )((long (*)(struct file * , char * , unsigned long , long long * ))0)) { { ldv_file_operations_instance_callback_2_29(ldv_2_callback_read, ldv_2_resource_file, ldv_2_ldv_param_29_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_29_3_default); } } else { } { ldv_free((void *)ldv_2_ldv_param_29_1_default); ldv_free((void *)ldv_2_ldv_param_29_3_default); } goto ldv_34187; case_3___0: /* CIL Label */ { ldv_file_operations_instance_callback_2_26(ldv_2_callback_llseek, ldv_2_resource_file, ldv_2_ldv_param_26_1_default, ldv_2_ldv_param_26_2_default); } goto ldv_34187; case_4: /* CIL Label */ { ldv_file_operations_instance_callback_2_25(ldv_2_callback_getgeo, ldv_2_resource_struct_block_device_ptr, ldv_2_size_cnt_struct_hd_geometry_ptr); } goto ldv_34187; case_5: /* CIL Label */ ; if ((unsigned long )ldv_2_callback_fsync != (unsigned long )((int (*)(struct file * , long long , long long , int ))0)) { { ldv_file_operations_instance_callback_2_22(ldv_2_callback_fsync, ldv_2_resource_file, ldv_2_ldv_param_22_1_default, ldv_2_ldv_param_22_2_default, ldv_2_ldv_param_22_3_default); } } else { } goto ldv_34187; case_6: /* CIL Label */ { ldv_file_operations_instance_callback_2_5(ldv_2_callback_compat_ioctl, ldv_2_resource_file, ldv_2_ldv_param_5_1_default, ldv_2_size_cnt_write_size); } goto ldv_34187; switch_default: /* CIL Label */ { ldv_stop(); } switch_break___0: /* CIL Label */ ; } ldv_34187: ; goto ldv_34194; switch_default___0: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_34194: ; goto ldv_call_2; goto ldv_call_2; return; } } void ldv_file_operations_file_operations_instance_3(void *arg0 ) { long (*ldv_3_callback_compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*ldv_3_callback_fsync)(struct file * , long long , long long , int ) ; int (*ldv_3_callback_getgeo)(struct block_device * , struct hd_geometry * ) ; long long (*ldv_3_callback_llseek)(struct file * , long long , int ) ; long (*ldv_3_callback_read)(struct file * , char * , unsigned long , long long * ) ; long (*ldv_3_callback_unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; struct file_operations *ldv_3_container_file_operations ; long long ldv_3_ldv_param_22_1_default ; long long ldv_3_ldv_param_22_2_default ; int ldv_3_ldv_param_22_3_default ; long long ldv_3_ldv_param_26_1_default ; int ldv_3_ldv_param_26_2_default ; char *ldv_3_ldv_param_29_1_default ; long long *ldv_3_ldv_param_29_3_default ; unsigned int ldv_3_ldv_param_32_1_default ; char *ldv_3_ldv_param_4_1_default ; long long *ldv_3_ldv_param_4_3_default ; unsigned int ldv_3_ldv_param_5_1_default ; struct file *ldv_3_resource_file ; struct inode *ldv_3_resource_inode ; struct block_device *ldv_3_resource_struct_block_device_ptr ; int ldv_3_ret_default ; struct hd_geometry *ldv_3_size_cnt_struct_hd_geometry_ptr ; unsigned long ldv_3_size_cnt_write_size ; struct ldv_struct_file_operations_instance_0 *data ; void *tmp ; void *tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; void *tmp___7 ; int tmp___8 ; void *tmp___9 ; void *tmp___10 ; { data = (struct ldv_struct_file_operations_instance_0 *)arg0; ldv_3_ret_default = 1; if ((unsigned long )data != (unsigned long )((struct ldv_struct_file_operations_instance_0 *)0)) { { ldv_3_container_file_operations = data->arg0; ldv_free((void *)data); } } else { } { tmp = ldv_xmalloc(504UL); ldv_3_resource_file = (struct file *)tmp; tmp___0 = ldv_xmalloc(976UL); ldv_3_resource_inode = (struct inode *)tmp___0; tmp___1 = ldv_xmalloc(480UL); ldv_3_resource_struct_block_device_ptr = (struct block_device *)tmp___1; tmp___2 = ldv_undef_int(); ldv_3_size_cnt_struct_hd_geometry_ptr = (struct hd_geometry *)((long )tmp___2); } goto ldv_main_3; return; ldv_main_3: { tmp___4 = ldv_undef_int(); } if (tmp___4 != 0) { { ldv_3_ret_default = ldv_file_operations_instance_probe_3_12(ldv_3_container_file_operations->open, ldv_3_resource_inode, ldv_3_resource_file); ldv_3_ret_default = ldv_filter_err_code(ldv_3_ret_default); tmp___3 = ldv_undef_int(); } if (tmp___3 != 0) { { ldv_assume(ldv_3_ret_default == 0); } goto ldv_call_3; } else { { ldv_assume(ldv_3_ret_default != 0); } goto ldv_main_3; } } else { { ldv_free((void *)ldv_3_resource_file); ldv_free((void *)ldv_3_resource_inode); ldv_free((void *)ldv_3_resource_struct_block_device_ptr); } return; } return; ldv_call_3: { tmp___5 = ldv_undef_int(); } { if (tmp___5 == 1) { goto case_1; } else { } if (tmp___5 == 2) { goto case_2; } else { } if (tmp___5 == 3) { goto case_3; } else { } goto switch_default___0; case_1: /* CIL Label */ { tmp___6 = ldv_xmalloc(1UL); ldv_3_ldv_param_4_1_default = (char *)tmp___6; tmp___7 = ldv_xmalloc(8UL); ldv_3_ldv_param_4_3_default = (long long *)tmp___7; ldv_assume((unsigned long )ldv_3_size_cnt_struct_hd_geometry_ptr <= (unsigned long )((struct hd_geometry *)2147479552)); ldv_file_operations_instance_write_3_4((long (*)(struct file * , char * , unsigned long , long long * ))ldv_3_container_file_operations->write, ldv_3_resource_file, ldv_3_ldv_param_4_1_default, ldv_3_size_cnt_write_size, ldv_3_ldv_param_4_3_default); ldv_free((void *)ldv_3_ldv_param_4_1_default); ldv_free((void *)ldv_3_ldv_param_4_3_default); } goto ldv_call_3; case_2: /* CIL Label */ { ldv_file_operations_instance_release_3_2(ldv_3_container_file_operations->release, ldv_3_resource_inode, ldv_3_resource_file); } goto ldv_main_3; case_3: /* CIL Label */ { tmp___8 = ldv_undef_int(); } { if (tmp___8 == 1) { goto case_1___0; } else { } if (tmp___8 == 2) { goto case_2___0; } else { } if (tmp___8 == 3) { goto case_3___0; } else { } if (tmp___8 == 4) { goto case_4; } else { } if (tmp___8 == 5) { goto case_5; } else { } if (tmp___8 == 6) { goto case_6; } else { } goto switch_default; case_1___0: /* CIL Label */ { ldv_file_operations_instance_callback_3_32(ldv_3_callback_unlocked_ioctl, ldv_3_resource_file, ldv_3_ldv_param_32_1_default, ldv_3_size_cnt_write_size); } goto ldv_34249; case_2___0: /* CIL Label */ { tmp___9 = ldv_xmalloc(1UL); ldv_3_ldv_param_29_1_default = (char *)tmp___9; tmp___10 = ldv_xmalloc(8UL); ldv_3_ldv_param_29_3_default = (long long *)tmp___10; ldv_file_operations_instance_callback_3_29(ldv_3_callback_read, ldv_3_resource_file, ldv_3_ldv_param_29_1_default, ldv_3_size_cnt_write_size, ldv_3_ldv_param_29_3_default); ldv_free((void *)ldv_3_ldv_param_29_1_default); ldv_free((void *)ldv_3_ldv_param_29_3_default); } goto ldv_34249; case_3___0: /* CIL Label */ { ldv_file_operations_instance_callback_3_26(ldv_3_callback_llseek, ldv_3_resource_file, ldv_3_ldv_param_26_1_default, ldv_3_ldv_param_26_2_default); } goto ldv_34249; case_4: /* CIL Label */ { ldv_file_operations_instance_callback_3_25(ldv_3_callback_getgeo, ldv_3_resource_struct_block_device_ptr, ldv_3_size_cnt_struct_hd_geometry_ptr); } goto ldv_34249; case_5: /* CIL Label */ { ldv_file_operations_instance_callback_3_22(ldv_3_callback_fsync, ldv_3_resource_file, ldv_3_ldv_param_22_1_default, ldv_3_ldv_param_22_2_default, ldv_3_ldv_param_22_3_default); } goto ldv_34249; case_6: /* CIL Label */ { ldv_file_operations_instance_callback_3_5(ldv_3_callback_compat_ioctl, ldv_3_resource_file, ldv_3_ldv_param_5_1_default, ldv_3_size_cnt_write_size); } goto ldv_34249; switch_default: /* CIL Label */ { ldv_stop(); } switch_break___0: /* CIL Label */ ; } ldv_34249: ; goto ldv_34256; switch_default___0: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_34256: ; goto ldv_call_3; goto ldv_call_3; return; } } void ldv_file_operations_instance_callback_1_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { ubi_cdev_ioctl(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_1_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { ubi_cdev_compat_ioctl(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_2_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { ctrl_cdev_ioctl(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_2_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { ctrl_cdev_compat_ioctl(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_3_22(int (*arg0)(struct file * , long long , long long , int ) , struct file *arg1 , long long arg2 , long long arg3 , int arg4 ) { { { vol_cdev_fsync(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_3_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) { { { vol_cdev_llseek(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_3_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { vol_cdev_read(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_3_32(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { vol_cdev_ioctl(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_3_5(long (*arg0)(struct file * , unsigned int , unsigned long ) , struct file *arg1 , unsigned int arg2 , unsigned long arg3 ) { { { vol_cdev_compat_ioctl(arg1, arg2, arg3); } return; } } int ldv_file_operations_instance_probe_3_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { int tmp ; { { tmp = vol_cdev_open(arg1, arg2); } return (tmp); } } void ldv_file_operations_instance_release_3_2(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { { { vol_cdev_release(arg1, arg2); } return; } } void ldv_file_operations_instance_write_3_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { vol_cdev_write(arg1, (char const *)arg2, arg3, arg4); } return; } } static void ldv_mutex_lock_99(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_i_mutex_of_inode(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_100(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_i_mutex_of_inode(ldv_func_arg1); } return; } } static void *ldv_vmalloc_101(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_vmalloc_102(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_lock_103(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_104(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_105(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_106(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_107(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_108(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_109(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_110(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_111(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_112(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_113(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_114(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_lock_115(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_116(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(ldv_func_arg1); } return; } } int ldv_linux_kernel_module_try_module_get(struct module *module ) ; void ldv_linux_kernel_module_module_put(struct module *module ) ; static void ldv_mutex_lock_98(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_109___0(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_ckvol_mutex_of_ubi_device(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_ckvol_mutex_of_ubi_device(struct mutex *lock ) ; __inline static void *ERR_PTR(long error ) ; static void ldv_mutex_unlock_99(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_100___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_110___0(struct mutex *ldv_func_arg1 ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; extern int blocking_notifier_chain_register(struct blocking_notifier_head * , struct notifier_block * ) ; static int ldv_blocking_notifier_chain_register_108(struct blocking_notifier_head *ldv_func_arg1 , struct notifier_block *ldv_func_arg2 ) ; extern int blocking_notifier_chain_unregister(struct blocking_notifier_head * , struct notifier_block * ) ; static int ldv_blocking_notifier_chain_unregister_111(struct blocking_notifier_head *ldv_func_arg1 , struct notifier_block *ldv_func_arg2 ) ; static bool ldv_try_module_get_95(struct module *ldv_func_arg1 ) ; static void ldv_module_put_102(struct module *ldv_func_arg1 ) ; static void ldv_module_put_107(struct module *ldv_func_arg1 ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void mtd_sync(struct mtd_info *mtd ) { { if ((unsigned long )mtd->_sync != (unsigned long )((void (*)(struct mtd_info * ))0)) { { (*(mtd->_sync))(mtd); } } else { } return; } } int ubi_get_device_info(int ubi_num , struct ubi_device_info *di ) ; struct ubi_volume_desc *ubi_open_volume_path(char const *pathname , int mode ) ; int ubi_register_volume_notifier(struct notifier_block *nb , int ignore_existing ) ; int ubi_unregister_volume_notifier(struct notifier_block *nb ) ; int ubi_leb_read(struct ubi_volume_desc *desc , int lnum , char *buf , int offset , int len , int check ) ; int ubi_leb_read_sg(struct ubi_volume_desc *desc , int lnum , struct ubi_sgl *sgl , int offset , int len , int check ) ; int ubi_leb_write(struct ubi_volume_desc *desc , int lnum , void const *buf , int offset , int len ) ; int ubi_leb_change(struct ubi_volume_desc *desc , int lnum , void const *buf , int len ) ; int ubi_leb_erase(struct ubi_volume_desc *desc , int lnum ) ; int ubi_flush(int ubi_num , int vol_id , int lnum ) ; int ubi_eba_read_leb_sg(struct ubi_device *ubi , struct ubi_volume *vol , struct ubi_sgl *sgl , int lnum , int offset , int len , int check ) ; void ubi_do_get_device_info(struct ubi_device *ubi , struct ubi_device_info *di ) { { di->ubi_num = ubi->ubi_num; di->leb_size = ubi->leb_size; di->leb_start = ubi->leb_start; di->min_io_size = ubi->min_io_size; di->max_write_size = ubi->max_write_size; di->ro_mode = ubi->ro_mode; di->cdev = ubi->cdev.dev; return; } } static char const __kstrtab_ubi_do_get_device_info[23U] = { 'u', 'b', 'i', '_', 'd', 'o', '_', 'g', 'e', 't', '_', 'd', 'e', 'v', 'i', 'c', 'e', '_', 'i', 'n', 'f', 'o', '\000'}; struct kernel_symbol const __ksymtab_ubi_do_get_device_info ; struct kernel_symbol const __ksymtab_ubi_do_get_device_info = {(unsigned long )(& ubi_do_get_device_info), (char const *)(& __kstrtab_ubi_do_get_device_info)}; int ubi_get_device_info(int ubi_num , struct ubi_device_info *di ) { struct ubi_device *ubi ; { if ((unsigned int )ubi_num > 31U) { return (-22); } else { } { ubi = ubi_get_device(ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19); } else { } { ubi_do_get_device_info(ubi, di); ubi_put_device(ubi); } return (0); } } static char const __kstrtab_ubi_get_device_info[20U] = { 'u', 'b', 'i', '_', 'g', 'e', 't', '_', 'd', 'e', 'v', 'i', 'c', 'e', '_', 'i', 'n', 'f', 'o', '\000'}; struct kernel_symbol const __ksymtab_ubi_get_device_info ; struct kernel_symbol const __ksymtab_ubi_get_device_info = {(unsigned long )(& ubi_get_device_info), (char const *)(& __kstrtab_ubi_get_device_info)}; void ubi_do_get_volume_info(struct ubi_device *ubi , struct ubi_volume *vol , struct ubi_volume_info *vi ) { { vi->vol_id = vol->vol_id; vi->ubi_num = ubi->ubi_num; vi->size = vol->reserved_pebs; vi->used_bytes = vol->used_bytes; vi->vol_type = vol->vol_type; vi->corrupted = (int )vol->corrupted; vi->upd_marker = (int )vol->upd_marker; vi->alignment = vol->alignment; vi->usable_leb_size = vol->usable_leb_size; vi->name_len = vol->name_len; vi->name = (char const *)(& vol->name); vi->cdev = vol->cdev.dev; return; } } void ubi_get_volume_info(struct ubi_volume_desc *desc , struct ubi_volume_info *vi ) { { { ubi_do_get_volume_info((desc->vol)->ubi, desc->vol, vi); } return; } } static char const __kstrtab_ubi_get_volume_info[20U] = { 'u', 'b', 'i', '_', 'g', 'e', 't', '_', 'v', 'o', 'l', 'u', 'm', 'e', '_', 'i', 'n', 'f', 'o', '\000'}; struct kernel_symbol const __ksymtab_ubi_get_volume_info ; struct kernel_symbol const __ksymtab_ubi_get_volume_info = {(unsigned long )(& ubi_get_volume_info), (char const *)(& __kstrtab_ubi_get_volume_info)}; struct ubi_volume_desc *ubi_open_volume(int ubi_num , int vol_id , int mode ) { int err ; struct ubi_volume_desc *desc ; struct ubi_device *ubi ; struct ubi_volume *vol ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; void *tmp___4 ; bool tmp___5 ; int tmp___6 ; void *tmp___7 ; void *tmp___8 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_open_volume"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): open device %d, volume %d, mode %d\n"; descriptor.lineno = 134U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): open device %d, volume %d, mode %d\n", tmp->pid, ubi_num, vol_id, mode); } } else { } if ((unsigned int )ubi_num > 31U) { { tmp___1 = ERR_PTR(-22L); } return ((struct ubi_volume_desc *)tmp___1); } else { } if ((unsigned int )mode - 1U > 3U) { { tmp___2 = ERR_PTR(-22L); } return ((struct ubi_volume_desc *)tmp___2); } else { } { ubi = ubi_get_device(ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { { tmp___3 = ERR_PTR(-19L); } return ((struct ubi_volume_desc *)tmp___3); } else { } if (vol_id < 0 || vol_id >= ubi->vtbl_slots) { err = -22; goto out_put_ubi; } else { } { tmp___4 = kmalloc(16UL, 208U); desc = (struct ubi_volume_desc *)tmp___4; } if ((unsigned long )desc == (unsigned long )((struct ubi_volume_desc *)0)) { err = -12; goto out_put_ubi; } else { } { err = -19; tmp___5 = ldv_try_module_get_95(& __this_module); } if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { goto out_free; } else { } { ldv_spin_lock_95(& ubi->volumes_lock); vol = ubi->volumes[vol_id]; } if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { goto out_unlock; } else { } err = -16; { if (mode == 1) { goto case_1; } else { } if (mode == 2) { goto case_2; } else { } if (mode == 3) { goto case_3; } else { } if (mode == 4) { goto case_4; } else { } goto switch_break; case_1: /* CIL Label */ ; if (vol->exclusive != 0) { goto out_unlock; } else { } vol->readers = vol->readers + 1; goto ldv_32352; case_2: /* CIL Label */ ; if (vol->exclusive != 0 || vol->writers > 0) { goto out_unlock; } else { } vol->writers = vol->writers + 1; goto ldv_32352; case_3: /* CIL Label */ ; if ((vol->exclusive != 0 || ((unsigned long )*((long *)vol + 220UL) & 0xffffffffffffffffUL) != 0UL) || vol->metaonly != 0) { goto out_unlock; } else { } vol->exclusive = 1; goto ldv_32352; case_4: /* CIL Label */ ; if (((unsigned long )*((long *)vol + 221UL) & 0xffffffffffffffffUL) != 0UL) { goto out_unlock; } else { } vol->metaonly = 1; goto ldv_32352; switch_break: /* CIL Label */ ; } ldv_32352: { get_device(& vol->dev); vol->ref_count = vol->ref_count + 1; ldv_spin_unlock_96(& ubi->volumes_lock); desc->vol = vol; desc->mode = mode; ldv_mutex_lock_98(& ubi->ckvol_mutex); } if ((unsigned int )*((unsigned char *)vol + 1992UL) == 0U) { { err = ubi_check_volume(ubi, vol_id); } if (err < 0) { { ldv_mutex_unlock_99(& ubi->ckvol_mutex); ubi_close_volume(desc); tmp___7 = ERR_PTR((long )err); } return ((struct ubi_volume_desc *)tmp___7); } else { } if (err == 1) { { printk("\fubi%d warning: %s: volume %d on UBI device %d is corrupted\n", ubi->ubi_num, "ubi_open_volume", vol_id, ubi->ubi_num); vol->corrupted = 1U; } } else { } vol->checked = 1U; } else { } { ldv_mutex_unlock_100___0(& ubi->ckvol_mutex); } return (desc); out_unlock: { ldv_spin_unlock_96(& ubi->volumes_lock); ldv_module_put_102(& __this_module); } out_free: { kfree((void const *)desc); } out_put_ubi: { ubi_put_device(ubi); printk("\vubi%d error: %s: cannot open device %d, volume %d, error %d\n", ubi->ubi_num, "ubi_open_volume", ubi_num, vol_id, err); tmp___8 = ERR_PTR((long )err); } return ((struct ubi_volume_desc *)tmp___8); } } static char const __kstrtab_ubi_open_volume[16U] = { 'u', 'b', 'i', '_', 'o', 'p', 'e', 'n', '_', 'v', 'o', 'l', 'u', 'm', 'e', '\000'}; struct kernel_symbol const __ksymtab_ubi_open_volume ; struct kernel_symbol const __ksymtab_ubi_open_volume = {(unsigned long )(& ubi_open_volume), (char const *)(& __kstrtab_ubi_open_volume)}; struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num , char const *name , int mode ) { int i ; int vol_id ; int len ; struct ubi_device *ubi ; struct ubi_volume_desc *ret ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; __kernel_size_t tmp___2 ; void *tmp___3 ; void *tmp___4 ; void *tmp___5 ; struct ubi_volume *vol ; int tmp___6 ; void *tmp___7 ; { { vol_id = -1; descriptor.modname = "ubi"; descriptor.function = "ubi_open_volume_nm"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): open device %d, volume %s, mode %d\n"; descriptor.lineno = 252U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): open device %d, volume %s, mode %d\n", tmp->pid, ubi_num, name, mode); } } else { } if ((unsigned long )name == (unsigned long )((char const *)0)) { { tmp___1 = ERR_PTR(-22L); } return ((struct ubi_volume_desc *)tmp___1); } else { } { tmp___2 = strnlen(name, 128UL); len = (int )tmp___2; } if (len > 127) { { tmp___3 = ERR_PTR(-22L); } return ((struct ubi_volume_desc *)tmp___3); } else { } if ((unsigned int )ubi_num > 31U) { { tmp___4 = ERR_PTR(-22L); } return ((struct ubi_volume_desc *)tmp___4); } else { } { ubi = ubi_get_device(ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { { tmp___5 = ERR_PTR(-19L); } return ((struct ubi_volume_desc *)tmp___5); } else { } { ldv_spin_lock_95(& ubi->volumes_lock); i = 0; } goto ldv_32380; ldv_32379: vol = ubi->volumes[i]; if ((unsigned long )vol != (unsigned long )((struct ubi_volume *)0) && len == vol->name_len) { { tmp___6 = strcmp(name, (char const *)(& vol->name)); } if (tmp___6 == 0) { vol_id = i; goto ldv_32378; } else { } } else { } i = i + 1; ldv_32380: ; if (i < ubi->vtbl_slots) { goto ldv_32379; } else { } ldv_32378: { ldv_spin_unlock_96(& ubi->volumes_lock); } if (vol_id >= 0) { { ret = ubi_open_volume(ubi_num, vol_id, mode); } } else { { tmp___7 = ERR_PTR(-19L); ret = (struct ubi_volume_desc *)tmp___7; } } { ubi_put_device(ubi); } return (ret); } } static char const __kstrtab_ubi_open_volume_nm[19U] = { 'u', 'b', 'i', '_', 'o', 'p', 'e', 'n', '_', 'v', 'o', 'l', 'u', 'm', 'e', '_', 'n', 'm', '\000'}; struct kernel_symbol const __ksymtab_ubi_open_volume_nm ; struct kernel_symbol const __ksymtab_ubi_open_volume_nm = {(unsigned long )(& ubi_open_volume_nm), (char const *)(& __kstrtab_ubi_open_volume_nm)}; struct ubi_volume_desc *ubi_open_volume_path(char const *pathname , int mode ) { int error ; int ubi_num ; int vol_id ; int mod ; struct inode *inode ; struct path path ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; unsigned int tmp___3 ; unsigned int tmp___4 ; void *tmp___5 ; struct ubi_volume_desc *tmp___6 ; void *tmp___7 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_open_volume_path"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): open volume %s, mode %d\n"; descriptor.lineno = 308U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): open volume %s, mode %d\n", tmp->pid, pathname, mode); } } else { } if ((unsigned long )pathname == (unsigned long )((char const *)0) || (int )((signed char )*pathname) == 0) { { tmp___1 = ERR_PTR(-22L); } return ((struct ubi_volume_desc *)tmp___1); } else { } { error = kern_path(pathname, 1U, & path); } if (error != 0) { { tmp___2 = ERR_PTR((long )error); } return ((struct ubi_volume_desc *)tmp___2); } else { } { inode = (path.dentry)->d_inode; mod = (int )inode->i_mode; tmp___3 = imajor((struct inode const *)inode); ubi_num = ubi_major2num((int )tmp___3); tmp___4 = iminor((struct inode const *)inode); vol_id = (int )(tmp___4 - 1U); path_put((struct path const *)(& path)); } if ((mod & 61440) != 8192) { { tmp___5 = ERR_PTR(-22L); } return ((struct ubi_volume_desc *)tmp___5); } else { } if (vol_id >= 0 && ubi_num >= 0) { { tmp___6 = ubi_open_volume(ubi_num, vol_id, mode); } return (tmp___6); } else { } { tmp___7 = ERR_PTR(-19L); } return ((struct ubi_volume_desc *)tmp___7); } } static char const __kstrtab_ubi_open_volume_path[21U] = { 'u', 'b', 'i', '_', 'o', 'p', 'e', 'n', '_', 'v', 'o', 'l', 'u', 'm', 'e', '_', 'p', 'a', 't', 'h', '\000'}; struct kernel_symbol const __ksymtab_ubi_open_volume_path ; struct kernel_symbol const __ksymtab_ubi_open_volume_path = {(unsigned long )(& ubi_open_volume_path), (char const *)(& __kstrtab_ubi_open_volume_path)}; void ubi_close_volume(struct ubi_volume_desc *desc ) { struct ubi_volume *vol ; struct ubi_device *ubi ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { { vol = desc->vol; ubi = vol->ubi; descriptor.modname = "ubi"; descriptor.function = "ubi_close_volume"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): close device %d, volume %d, mode %d\n"; descriptor.lineno = 341U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): close device %d, volume %d, mode %d\n", tmp->pid, ubi->ubi_num, vol->vol_id, desc->mode); } } else { } { ldv_spin_lock_95(& ubi->volumes_lock); } { if (desc->mode == 1) { goto case_1; } else { } if (desc->mode == 2) { goto case_2; } else { } if (desc->mode == 3) { goto case_3; } else { } if (desc->mode == 4) { goto case_4; } else { } goto switch_break; case_1: /* CIL Label */ vol->readers = vol->readers + -1; goto ldv_32418; case_2: /* CIL Label */ vol->writers = vol->writers + -1; goto ldv_32418; case_3: /* CIL Label */ vol->exclusive = 0; goto ldv_32418; case_4: /* CIL Label */ vol->metaonly = 0; goto ldv_32418; switch_break: /* CIL Label */ ; } ldv_32418: { vol->ref_count = vol->ref_count + -1; ldv_spin_unlock_96(& ubi->volumes_lock); kfree((void const *)desc); put_device(& vol->dev); ubi_put_device(ubi); ldv_module_put_107(& __this_module); } return; } } static char const __kstrtab_ubi_close_volume[17U] = { 'u', 'b', 'i', '_', 'c', 'l', 'o', 's', 'e', '_', 'v', 'o', 'l', 'u', 'm', 'e', '\000'}; struct kernel_symbol const __ksymtab_ubi_close_volume ; struct kernel_symbol const __ksymtab_ubi_close_volume = {(unsigned long )(& ubi_close_volume), (char const *)(& __kstrtab_ubi_close_volume)}; static int leb_read_sanity_check(struct ubi_volume_desc *desc , int lnum , int offset , int len ) { struct ubi_volume *vol ; struct ubi_device *ubi ; int vol_id ; { vol = desc->vol; ubi = vol->ubi; vol_id = vol->vol_id; if ((((vol_id < 0 || (vol_id >= ubi->vtbl_slots || lnum < 0)) || (lnum >= vol->used_ebs || offset < 0)) || len < 0) || offset + len > vol->usable_leb_size) { return (-22); } else { } if (vol->vol_type == 4) { if (vol->used_ebs == 0) { return (0); } else { } if (lnum == vol->used_ebs + -1 && offset + len > vol->last_eb_bytes) { return (-22); } else { } } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { return (-9); } else { } return (0); } } int ubi_leb_read(struct ubi_volume_desc *desc , int lnum , char *buf , int offset , int len , int check ) { struct ubi_volume *vol ; struct ubi_device *ubi ; int err ; int vol_id ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { vol = desc->vol; ubi = vol->ubi; vol_id = vol->vol_id; descriptor.modname = "ubi"; descriptor.function = "ubi_leb_read"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): read %d bytes from LEB %d:%d:%d\n"; descriptor.lineno = 439U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): read %d bytes from LEB %d:%d:%d\n", tmp->pid, len, vol_id, lnum, offset); } } else { } { err = leb_read_sanity_check(desc, lnum, offset, len); } if (err < 0) { return (err); } else { } if (len == 0) { return (0); } else { } { err = ubi_eba_read_leb(ubi, vol, lnum, (void *)buf, offset, len, check); } if (err != 0) { { tmp___1 = mtd_is_eccerr(err); } if (tmp___1 != 0) { if (vol->vol_type == 4) { { printk("\fubi%d warning: %s: mark volume %d as corrupted\n", ubi->ubi_num, "ubi_leb_read", vol_id); vol->corrupted = 1U; } } else { } } else { } } else { } return (err); } } static char const __kstrtab_ubi_leb_read[13U] = { 'u', 'b', 'i', '_', 'l', 'e', 'b', '_', 'r', 'e', 'a', 'd', '\000'}; struct kernel_symbol const __ksymtab_ubi_leb_read ; struct kernel_symbol const __ksymtab_ubi_leb_read = {(unsigned long )(& ubi_leb_read), (char const *)(& __kstrtab_ubi_leb_read)}; int ubi_leb_read_sg(struct ubi_volume_desc *desc , int lnum , struct ubi_sgl *sgl , int offset , int len , int check ) { struct ubi_volume *vol ; struct ubi_device *ubi ; int err ; int vol_id ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { vol = desc->vol; ubi = vol->ubi; vol_id = vol->vol_id; descriptor.modname = "ubi"; descriptor.function = "ubi_leb_read_sg"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): read %d bytes from LEB %d:%d:%d\n"; descriptor.lineno = 479U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): read %d bytes from LEB %d:%d:%d\n", tmp->pid, len, vol_id, lnum, offset); } } else { } { err = leb_read_sanity_check(desc, lnum, offset, len); } if (err < 0) { return (err); } else { } if (len == 0) { return (0); } else { } { err = ubi_eba_read_leb_sg(ubi, vol, sgl, lnum, offset, len, check); } if (err != 0) { { tmp___1 = mtd_is_eccerr(err); } if (tmp___1 != 0) { if (vol->vol_type == 4) { { printk("\fubi%d warning: %s: mark volume %d as corrupted\n", ubi->ubi_num, "ubi_leb_read_sg", vol_id); vol->corrupted = 1U; } } else { } } else { } } else { } return (err); } } static char const __kstrtab_ubi_leb_read_sg[16U] = { 'u', 'b', 'i', '_', 'l', 'e', 'b', '_', 'r', 'e', 'a', 'd', '_', 's', 'g', '\000'}; struct kernel_symbol const __ksymtab_ubi_leb_read_sg ; struct kernel_symbol const __ksymtab_ubi_leb_read_sg = {(unsigned long )(& ubi_leb_read_sg), (char const *)(& __kstrtab_ubi_leb_read_sg)}; int ubi_leb_write(struct ubi_volume_desc *desc , int lnum , void const *buf , int offset , int len ) { struct ubi_volume *vol ; struct ubi_device *ubi ; int vol_id ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { vol = desc->vol; ubi = vol->ubi; vol_id = vol->vol_id; descriptor.modname = "ubi"; descriptor.function = "ubi_leb_write"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): write %d bytes to LEB %d:%d:%d\n"; descriptor.lineno = 530U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): write %d bytes to LEB %d:%d:%d\n", tmp->pid, len, vol_id, lnum, offset); } } else { } if (vol_id < 0 || vol_id >= ubi->vtbl_slots) { return (-22); } else { } if (desc->mode == 1 || vol->vol_type == 4) { return (-30); } else { } if (((((lnum < 0 || (lnum >= vol->reserved_pebs || offset < 0)) || len < 0) || offset + len > vol->usable_leb_size) || (offset & (ubi->min_io_size + -1)) != 0) || (len & (ubi->min_io_size + -1)) != 0) { return (-22); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { return (-9); } else { } if (len == 0) { return (0); } else { } { tmp___1 = ubi_eba_write_leb(ubi, vol, lnum, buf, offset, len); } return (tmp___1); } } static char const __kstrtab_ubi_leb_write[14U] = { 'u', 'b', 'i', '_', 'l', 'e', 'b', '_', 'w', 'r', 'i', 't', 'e', '\000'}; struct kernel_symbol const __ksymtab_ubi_leb_write ; struct kernel_symbol const __ksymtab_ubi_leb_write = {(unsigned long )(& ubi_leb_write), (char const *)(& __kstrtab_ubi_leb_write)}; int ubi_leb_change(struct ubi_volume_desc *desc , int lnum , void const *buf , int len ) { struct ubi_volume *vol ; struct ubi_device *ubi ; int vol_id ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { vol = desc->vol; ubi = vol->ubi; vol_id = vol->vol_id; descriptor.modname = "ubi"; descriptor.function = "ubi_leb_change"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): atomically write %d bytes to LEB %d:%d\n"; descriptor.lineno = 575U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): atomically write %d bytes to LEB %d:%d\n", tmp->pid, len, vol_id, lnum); } } else { } if (vol_id < 0 || vol_id >= ubi->vtbl_slots) { return (-22); } else { } if (desc->mode == 1 || vol->vol_type == 4) { return (-30); } else { } if (((lnum < 0 || (lnum >= vol->reserved_pebs || len < 0)) || len > vol->usable_leb_size) || (len & (ubi->min_io_size + -1)) != 0) { return (-22); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { return (-9); } else { } if (len == 0) { return (0); } else { } { tmp___1 = ubi_eba_atomic_leb_change(ubi, vol, lnum, buf, len); } return (tmp___1); } } static char const __kstrtab_ubi_leb_change[15U] = { 'u', 'b', 'i', '_', 'l', 'e', 'b', '_', 'c', 'h', 'a', 'n', 'g', 'e', '\000'}; struct kernel_symbol const __ksymtab_ubi_leb_change ; struct kernel_symbol const __ksymtab_ubi_leb_change = {(unsigned long )(& ubi_leb_change), (char const *)(& __kstrtab_ubi_leb_change)}; int ubi_leb_erase(struct ubi_volume_desc *desc , int lnum ) { struct ubi_volume *vol ; struct ubi_device *ubi ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { vol = desc->vol; ubi = vol->ubi; descriptor.modname = "ubi"; descriptor.function = "ubi_leb_erase"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): erase LEB %d:%d\n"; descriptor.lineno = 615U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): erase LEB %d:%d\n", tmp->pid, vol->vol_id, lnum); } } else { } if (desc->mode == 1 || vol->vol_type == 4) { return (-30); } else { } if (lnum < 0 || lnum >= vol->reserved_pebs) { return (-22); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { return (-9); } else { } { err = ubi_eba_unmap_leb(ubi, vol, lnum); } if (err != 0) { return (err); } else { } { tmp___1 = ubi_wl_flush(ubi, vol->vol_id, lnum); } return (tmp___1); } } static char const __kstrtab_ubi_leb_erase[14U] = { 'u', 'b', 'i', '_', 'l', 'e', 'b', '_', 'e', 'r', 'a', 's', 'e', '\000'}; struct kernel_symbol const __ksymtab_ubi_leb_erase ; struct kernel_symbol const __ksymtab_ubi_leb_erase = {(unsigned long )(& ubi_leb_erase), (char const *)(& __kstrtab_ubi_leb_erase)}; int ubi_leb_unmap(struct ubi_volume_desc *desc , int lnum ) { struct ubi_volume *vol ; struct ubi_device *ubi ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { vol = desc->vol; ubi = vol->ubi; descriptor.modname = "ubi"; descriptor.function = "ubi_leb_unmap"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): unmap LEB %d:%d\n"; descriptor.lineno = 675U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): unmap LEB %d:%d\n", tmp->pid, vol->vol_id, lnum); } } else { } if (desc->mode == 1 || vol->vol_type == 4) { return (-30); } else { } if (lnum < 0 || lnum >= vol->reserved_pebs) { return (-22); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { return (-9); } else { } { tmp___1 = ubi_eba_unmap_leb(ubi, vol, lnum); } return (tmp___1); } } static char const __kstrtab_ubi_leb_unmap[14U] = { 'u', 'b', 'i', '_', 'l', 'e', 'b', '_', 'u', 'n', 'm', 'a', 'p', '\000'}; struct kernel_symbol const __ksymtab_ubi_leb_unmap ; struct kernel_symbol const __ksymtab_ubi_leb_unmap = {(unsigned long )(& ubi_leb_unmap), (char const *)(& __kstrtab_ubi_leb_unmap)}; int ubi_leb_map(struct ubi_volume_desc *desc , int lnum ) { struct ubi_volume *vol ; struct ubi_device *ubi ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { vol = desc->vol; ubi = vol->ubi; descriptor.modname = "ubi"; descriptor.function = "ubi_leb_map"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): unmap LEB %d:%d\n"; descriptor.lineno = 711U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): unmap LEB %d:%d\n", tmp->pid, vol->vol_id, lnum); } } else { } if (desc->mode == 1 || vol->vol_type == 4) { return (-30); } else { } if (lnum < 0 || lnum >= vol->reserved_pebs) { return (-22); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { return (-9); } else { } if (*(vol->eba_tbl + (unsigned long )lnum) >= 0) { return (-74); } else { } { tmp___1 = ubi_eba_write_leb(ubi, vol, lnum, (void const *)0, 0, 0); } return (tmp___1); } } static char const __kstrtab_ubi_leb_map[12U] = { 'u', 'b', 'i', '_', 'l', 'e', 'b', '_', 'm', 'a', 'p', '\000'}; struct kernel_symbol const __ksymtab_ubi_leb_map ; struct kernel_symbol const __ksymtab_ubi_leb_map = {(unsigned long )(& ubi_leb_map), (char const *)(& __kstrtab_ubi_leb_map)}; int ubi_is_mapped(struct ubi_volume_desc *desc , int lnum ) { struct ubi_volume *vol ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { { vol = desc->vol; descriptor.modname = "ubi"; descriptor.function = "ubi_is_mapped"; descriptor.filename = "drivers/mtd/ubi/kapi.c"; descriptor.format = "UBI DBG gen (pid %d): test LEB %d:%d\n"; descriptor.lineno = 749U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): test LEB %d:%d\n", tmp->pid, vol->vol_id, lnum); } } else { } if (lnum < 0 || lnum >= vol->reserved_pebs) { return (-22); } else { } if ((unsigned int )*((unsigned char *)vol + 1992UL) != 0U) { return (-9); } else { } return (*(vol->eba_tbl + (unsigned long )lnum) >= 0); } } static char const __kstrtab_ubi_is_mapped[14U] = { 'u', 'b', 'i', '_', 'i', 's', '_', 'm', 'a', 'p', 'p', 'e', 'd', '\000'}; struct kernel_symbol const __ksymtab_ubi_is_mapped ; struct kernel_symbol const __ksymtab_ubi_is_mapped = {(unsigned long )(& ubi_is_mapped), (char const *)(& __kstrtab_ubi_is_mapped)}; int ubi_sync(int ubi_num ) { struct ubi_device *ubi ; { { ubi = ubi_get_device(ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19); } else { } { mtd_sync(ubi->mtd); ubi_put_device(ubi); } return (0); } } static char const __kstrtab_ubi_sync[9U] = { 'u', 'b', 'i', '_', 's', 'y', 'n', 'c', '\000'}; struct kernel_symbol const __ksymtab_ubi_sync ; struct kernel_symbol const __ksymtab_ubi_sync = {(unsigned long )(& ubi_sync), (char const *)(& __kstrtab_ubi_sync)}; int ubi_flush(int ubi_num , int vol_id , int lnum ) { struct ubi_device *ubi ; int err ; { { err = 0; ubi = ubi_get_device(ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19); } else { } { err = ubi_wl_flush(ubi, vol_id, lnum); ubi_put_device(ubi); } return (err); } } static char const __kstrtab_ubi_flush[10U] = { 'u', 'b', 'i', '_', 'f', 'l', 'u', 's', 'h', '\000'}; struct kernel_symbol const __ksymtab_ubi_flush ; struct kernel_symbol const __ksymtab_ubi_flush = {(unsigned long )(& ubi_flush), (char const *)(& __kstrtab_ubi_flush)}; struct blocking_notifier_head ubi_notifiers = {{0L, {& ubi_notifiers.rwsem.wait_list, & ubi_notifiers.rwsem.wait_list}, {{{0U}}, 3735899821U, 4294967295U, (void *)-1, {0, {0, 0}, "(ubi_notifiers).rwsem.wait_lock", 0, 0UL}}, {{0}}, (struct task_struct *)0, {0, {0, 0}, "(ubi_notifiers).rwsem", 0, 0UL}}, (struct notifier_block *)0}; int ubi_register_volume_notifier(struct notifier_block *nb , int ignore_existing ) { int err ; { { err = ldv_blocking_notifier_chain_register_108(& ubi_notifiers, nb); } if (err != 0) { return (err); } else { } if (ignore_existing != 0) { return (0); } else { } { ldv_mutex_lock_109___0(& ubi_devices_mutex); ubi_enumerate_volumes(nb); ldv_mutex_unlock_110___0(& ubi_devices_mutex); } return (err); } } static char const __kstrtab_ubi_register_volume_notifier[29U] = { 'u', 'b', 'i', '_', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '_', 'v', 'o', 'l', 'u', 'm', 'e', '_', 'n', 'o', 't', 'i', 'f', 'i', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ubi_register_volume_notifier ; struct kernel_symbol const __ksymtab_ubi_register_volume_notifier = {(unsigned long )(& ubi_register_volume_notifier), (char const *)(& __kstrtab_ubi_register_volume_notifier)}; int ubi_unregister_volume_notifier(struct notifier_block *nb ) { int tmp ; { { tmp = ldv_blocking_notifier_chain_unregister_111(& ubi_notifiers, nb); } return (tmp); } } static char const __kstrtab_ubi_unregister_volume_notifier[31U] = { 'u', 'b', 'i', '_', 'u', 'n', 'r', 'e', 'g', 'i', 's', 't', 'e', 'r', '_', 'v', 'o', 'l', 'u', 'm', 'e', '_', 'n', 'o', 't', 'i', 'f', 'i', 'e', 'r', '\000'}; struct kernel_symbol const __ksymtab_ubi_unregister_volume_notifier ; struct kernel_symbol const __ksymtab_ubi_unregister_volume_notifier = {(unsigned long )(& ubi_unregister_volume_notifier), (char const *)(& __kstrtab_ubi_unregister_volume_notifier)}; int ldv_blocking_notifier_chain_register(int arg0 , struct blocking_notifier_head *arg1 , struct notifier_block *arg2 ) ; int ldv_blocking_notifier_chain_unregister(int arg0 , struct blocking_notifier_head *arg1 , struct notifier_block *arg2 ) ; static bool ldv_try_module_get_95(struct module *ldv_func_arg1 ) { int tmp ; { { tmp = ldv_linux_kernel_module_try_module_get(ldv_func_arg1); } return (tmp != 0); } } static void ldv_mutex_lock_98(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_ckvol_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_99(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ckvol_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_100___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ckvol_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_module_put_102(struct module *ldv_func_arg1 ) { { { ldv_linux_kernel_module_module_put(ldv_func_arg1); } return; } } static void ldv_module_put_107(struct module *ldv_func_arg1 ) { { { ldv_linux_kernel_module_module_put(ldv_func_arg1); } return; } } static int ldv_blocking_notifier_chain_register_108(struct blocking_notifier_head *ldv_func_arg1 , struct notifier_block *ldv_func_arg2 ) { ldv_func_ret_type___0 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = blocking_notifier_chain_register(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; tmp___0 = ldv_blocking_notifier_chain_register(ldv_func_res, ldv_func_arg1, ldv_func_arg2); } return (tmp___0); return (ldv_func_res); } } static void ldv_mutex_lock_109___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_110___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(ldv_func_arg1); } return; } } static int ldv_blocking_notifier_chain_unregister_111(struct blocking_notifier_head *ldv_func_arg1 , struct notifier_block *ldv_func_arg2 ) { ldv_func_ret_type___1 ldv_func_res ; int tmp ; int tmp___0 ; { { tmp = blocking_notifier_chain_unregister(ldv_func_arg1, ldv_func_arg2); ldv_func_res = tmp; tmp___0 = ldv_blocking_notifier_chain_unregister(ldv_func_res, ldv_func_arg1, ldv_func_arg2); } return (tmp___0); return (ldv_func_res); } } static void ldv_mutex_lock_105___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_109___1(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_113___0(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_alc_mutex_of_ubi_device(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_alc_mutex_of_ubi_device(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(struct mutex *lock ) ; __inline static struct task_struct *get_current___5(void) { struct task_struct *pfo_ret__ ; { { if (8UL == 1UL) { goto case_1; } else { } if (8UL == 2UL) { goto case_2; } else { } if (8UL == 4UL) { goto case_4; } else { } if (8UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_3670; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3670; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3670; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3670; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_3670: ; return (pfo_ret__); } } __inline static void *ERR_PTR(long error ) ; __inline static long PTR_ERR(void const *ptr ) ; void ldv_linux_kernel_locking_spinlock_spin_lock_ltree_lock_of_ubi_device(void) ; void ldv_linux_kernel_locking_spinlock_spin_unlock_ltree_lock_of_ubi_device(void) ; static void ldv_mutex_unlock_106___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_107(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_108___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_110___1(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_114___0(struct mutex *ldv_func_arg1 ) ; __inline static void ldv_spin_lock_95___1(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95___1(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95___1(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95___1(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95___1(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96___1(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96___1(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96___1(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96___1(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96___1(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; extern void rb_insert_color(struct rb_node * , struct rb_root * ) ; extern void rb_erase(struct rb_node * , struct rb_root * ) ; __inline static void rb_link_node(struct rb_node *node , struct rb_node *parent , struct rb_node **rb_link ) { struct rb_node *tmp ; { node->__rb_parent_color = (unsigned long )parent; tmp = (struct rb_node *)0; node->rb_right = tmp; node->rb_left = tmp; *rb_link = node; return; } } extern void down_read(struct rw_semaphore * ) ; extern void down_write(struct rw_semaphore * ) ; extern int down_write_trylock(struct rw_semaphore * ) ; extern void up_read(struct rw_semaphore * ) ; extern void up_write(struct rw_semaphore * ) ; __inline static void *lowmem_page_address(struct page const *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 64L) << 12) + 0xffff880000000000UL)); } } __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static struct page *sg_page(struct scatterlist *sg ) { long tmp ; long tmp___0 ; { { tmp = ldv__builtin_expect(sg->sg_magic != 2271560481UL, 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" (98), "i" (12UL)); __builtin_unreachable(); } } else { } { tmp___0 = ldv__builtin_expect((long )((int )sg->page_link) & 1L, 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" (99), "i" (12UL)); __builtin_unreachable(); } } else { } return ((struct page *)(sg->page_link & 0xfffffffffffffffcUL)); } } __inline static void *sg_virt(struct scatterlist *sg ) { struct page *tmp ; void *tmp___0 ; { { tmp = sg_page(sg); tmp___0 = lowmem_page_address((struct page const *)tmp); } return (tmp___0 + (unsigned long )sg->offset); } } void ubi_calculate_reserved(struct ubi_device *ubi ) ; int ubi_eba_copy_leb(struct ubi_device *ubi , int from , int to , struct ubi_vid_hdr *vid_hdr ) ; int ubi_eba_init(struct ubi_device *ubi , struct ubi_attach_info *ai ) ; unsigned long long ubi_next_sqnum(struct ubi_device *ubi ) ; int self_check_eba(struct ubi_device *ubi , struct ubi_attach_info *ai_fastmap , struct ubi_attach_info *ai_scan ) ; int ubi_wl_get_peb(struct ubi_device *ubi ) ; int ubi_wl_put_peb(struct ubi_device *ubi , int vol_id , int lnum , int pnum , int torture ) ; int ubi_wl_scrub_peb(struct ubi_device *ubi , int pnum ) ; int ubi_io_read_vid_hdr(struct ubi_device *ubi , int pnum , struct ubi_vid_hdr *vid_hdr , int verbose ) ; __inline static void ubi_move_aeb_to_list(struct ubi_ainf_volume *av , struct ubi_ainf_peb *aeb , struct list_head *list ) { { { rb_erase(& aeb->u.rb, & av->root); list_add_tail(& aeb->u.list, list); } return; } } __inline static struct ubi_vid_hdr *ubi_zalloc_vid_hdr___0(struct ubi_device const *ubi , gfp_t gfp_flags ) { void *vid_hdr ; { { vid_hdr = kzalloc((size_t )ubi->vid_hdr_alsize, gfp_flags); } if ((unsigned long )vid_hdr == (unsigned long )((void *)0)) { return ((struct ubi_vid_hdr *)0); } else { } return ((struct ubi_vid_hdr *)vid_hdr + (unsigned long )ubi->vid_hdr_shift); } } __inline static int ubi_io_read_data___0(struct ubi_device const *ubi , void *buf , int pnum , int offset , int len ) { struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___0 = ldv__builtin_expect(offset < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read_data", 974, tmp->pid); dump_stack(); } } else { } { tmp___1 = ubi_io_read(ubi, buf, pnum, offset + (int )ubi->leb_start, len); } return (tmp___1); } } __inline static int ubi_io_write_data___0(struct ubi_device *ubi , void const *buf , int pnum , int offset , int len ) { struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___0 = ldv__builtin_expect(offset < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write_data", 986, tmp->pid); dump_stack(); } } else { } { tmp___1 = ubi_io_write(ubi, buf, pnum, offset + ubi->leb_start, len); } return (tmp___1); } } __inline static int idx2vol_id(struct ubi_device const *ubi , int idx ) { { if (idx >= (int )ubi->vtbl_slots) { return ((idx - (int )ubi->vtbl_slots) + 2147479551); } else { return (idx); } } } unsigned long long ubi_next_sqnum(struct ubi_device *ubi ) { unsigned long long sqnum ; unsigned long long tmp ; { { ldv_spin_lock_95___1(& ubi->ltree_lock); tmp = ubi->global_sqnum; ubi->global_sqnum = ubi->global_sqnum + 1ULL; sqnum = tmp; ldv_spin_unlock_96___1(& ubi->ltree_lock); } return (sqnum); } } static int ubi_get_compat(struct ubi_device const *ubi , int vol_id ) { { if (vol_id == 2147479551) { return (5); } else { } return (0); } } static struct ubi_ltree_entry *ltree_lookup(struct ubi_device *ubi , int vol_id , int lnum ) { struct rb_node *p ; struct ubi_ltree_entry *le ; struct rb_node const *__mptr ; { p = ubi->ltree.rb_node; goto ldv_31508; ldv_31507: __mptr = (struct rb_node const *)p; le = (struct ubi_ltree_entry *)__mptr; if (vol_id < le->vol_id) { p = p->rb_left; } else if (vol_id > le->vol_id) { p = p->rb_right; } else if (lnum < le->lnum) { p = p->rb_left; } else if (lnum > le->lnum) { p = p->rb_right; } else { return (le); } ldv_31508: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_31507; } else { } return ((struct ubi_ltree_entry *)0); } } static struct ubi_ltree_entry *ltree_add_entry(struct ubi_device *ubi , int vol_id , int lnum ) { struct ubi_ltree_entry *le ; struct ubi_ltree_entry *le1 ; struct ubi_ltree_entry *le_free ; void *tmp ; void *tmp___0 ; struct lock_class_key __key ; struct rb_node **p ; struct rb_node *parent ; struct rb_node const *__mptr ; struct task_struct *tmp___1 ; long tmp___2 ; { { tmp = kmalloc(200UL, 80U); le = (struct ubi_ltree_entry *)tmp; } if ((unsigned long )le == (unsigned long )((struct ubi_ltree_entry *)0)) { { tmp___0 = ERR_PTR(-12L); } return ((struct ubi_ltree_entry *)tmp___0); } else { } { le->users = 0; __init_rwsem(& le->mutex, "&le->mutex", & __key); le->vol_id = vol_id; le->lnum = lnum; ldv_spin_lock_95___1(& ubi->ltree_lock); le1 = ltree_lookup(ubi, vol_id, lnum); } if ((unsigned long )le1 != (unsigned long )((struct ubi_ltree_entry *)0)) { le_free = le; le = le1; } else { parent = (struct rb_node *)0; le_free = (struct ubi_ltree_entry *)0; p = & ubi->ltree.rb_node; goto ldv_31525; ldv_31524: parent = *p; __mptr = (struct rb_node const *)parent; le1 = (struct ubi_ltree_entry *)__mptr; if (vol_id < le1->vol_id) { p = & (*p)->rb_left; } else if (vol_id > le1->vol_id) { p = & (*p)->rb_right; } else { { tmp___2 = ldv__builtin_expect(lnum == le1->lnum, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ltree_add_entry", 178, tmp___1->pid); dump_stack(); } } else { } if (lnum < le1->lnum) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } } ldv_31525: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31524; } else { } { rb_link_node(& le->rb, parent, p); rb_insert_color(& le->rb, & ubi->ltree); } } { le->users = le->users + 1; ldv_spin_unlock_96___1(& ubi->ltree_lock); kfree((void const *)le_free); } return (le); } } static int leb_read_lock(struct ubi_device *ubi , int vol_id , int lnum ) { struct ubi_ltree_entry *le ; long tmp ; bool tmp___0 ; { { le = ltree_add_entry(ubi, vol_id, lnum); tmp___0 = IS_ERR((void const *)le); } if ((int )tmp___0) { { tmp = PTR_ERR((void const *)le); } return ((int )tmp); } else { } { down_read(& le->mutex); } return (0); } } static void leb_read_unlock(struct ubi_device *ubi , int vol_id , int lnum ) { struct ubi_ltree_entry *le ; struct task_struct *tmp ; long tmp___0 ; { { ldv_spin_lock_95___1(& ubi->ltree_lock); le = ltree_lookup(ubi, vol_id, lnum); le->users = le->users + -1; tmp___0 = ldv__builtin_expect(le->users < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "leb_read_unlock", 229, tmp->pid); dump_stack(); } } else { } { up_read(& le->mutex); } if (le->users == 0) { { rb_erase(& le->rb, & ubi->ltree); kfree((void const *)le); } } else { } { ldv_spin_unlock_96___1(& ubi->ltree_lock); } return; } } static int leb_write_lock(struct ubi_device *ubi , int vol_id , int lnum ) { struct ubi_ltree_entry *le ; long tmp ; bool tmp___0 ; { { le = ltree_add_entry(ubi, vol_id, lnum); tmp___0 = IS_ERR((void const *)le); } if ((int )tmp___0) { { tmp = PTR_ERR((void const *)le); } return ((int )tmp); } else { } { down_write(& le->mutex); } return (0); } } static int leb_write_trylock(struct ubi_device *ubi , int vol_id , int lnum ) { struct ubi_ltree_entry *le ; long tmp ; bool tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; { { le = ltree_add_entry(ubi, vol_id, lnum); tmp___0 = IS_ERR((void const *)le); } if ((int )tmp___0) { { tmp = PTR_ERR((void const *)le); } return ((int )tmp); } else { } { tmp___1 = down_write_trylock(& le->mutex); } if (tmp___1 != 0) { return (0); } else { } { ldv_spin_lock_95___1(& ubi->ltree_lock); le->users = le->users + -1; tmp___3 = ldv__builtin_expect(le->users < 0, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "leb_write_trylock", 282, tmp___2->pid); dump_stack(); } } else { } if (le->users == 0) { { rb_erase(& le->rb, & ubi->ltree); kfree((void const *)le); } } else { } { ldv_spin_unlock_96___1(& ubi->ltree_lock); } return (1); } } static void leb_write_unlock(struct ubi_device *ubi , int vol_id , int lnum ) { struct ubi_ltree_entry *le ; struct task_struct *tmp ; long tmp___0 ; { { ldv_spin_lock_95___1(& ubi->ltree_lock); le = ltree_lookup(ubi, vol_id, lnum); le->users = le->users + -1; tmp___0 = ldv__builtin_expect(le->users < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "leb_write_unlock", 305, tmp->pid); dump_stack(); } } else { } { up_write(& le->mutex); } if (le->users == 0) { { rb_erase(& le->rb, & ubi->ltree); kfree((void const *)le); } } else { } { ldv_spin_unlock_96___1(& ubi->ltree_lock); } return; } } int ubi_eba_unmap_leb(struct ubi_device *ubi , struct ubi_volume *vol , int lnum ) { int err ; int pnum ; int vol_id ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { vol_id = vol->vol_id; if (ubi->ro_mode != 0) { return (-30); } else { } { err = leb_write_lock(ubi, vol_id, lnum); } if (err != 0) { return (err); } else { } pnum = *(vol->eba_tbl + (unsigned long )lnum); if (pnum < 0) { goto out_unlock; } else { } { descriptor.modname = "ubi"; descriptor.function = "ubi_eba_unmap_leb"; descriptor.filename = "drivers/mtd/ubi/eba.c"; descriptor.format = "UBI DBG eba (pid %d): erase LEB %d:%d, PEB %d\n"; descriptor.lineno = 341U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); __dynamic_pr_debug(& descriptor, "UBI DBG eba (pid %d): erase LEB %d:%d, PEB %d\n", tmp->pid, vol_id, lnum, pnum); } } else { } { down_read(& ubi->fm_sem); *(vol->eba_tbl + (unsigned long )lnum) = -1; up_read(& ubi->fm_sem); err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 0); } out_unlock: { leb_write_unlock(ubi, vol_id, lnum); } return (err); } } int ubi_eba_read_leb(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void *buf , int offset , int len , int check ) { int err ; int pnum ; int scrub ; int vol_id ; struct ubi_vid_hdr *vid_hdr ; uint32_t crc ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; __u32 tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; __u32 tmp___9 ; long tmp___10 ; __u32 tmp___11 ; int tmp___12 ; uint32_t crc1 ; u32 tmp___13 ; { { scrub = 0; vol_id = vol->vol_id; crc = crc; err = leb_read_lock(ubi, vol_id, lnum); } if (err != 0) { return (err); } else { } pnum = *(vol->eba_tbl + (unsigned long )lnum); if (pnum < 0) { { descriptor.modname = "ubi"; descriptor.function = "ubi_eba_read_leb"; descriptor.filename = "drivers/mtd/ubi/eba.c"; descriptor.format = "UBI DBG eba (pid %d): read %d bytes from offset %d of LEB %d:%d (unmapped)\n"; descriptor.lineno = 391U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); __dynamic_pr_debug(& descriptor, "UBI DBG eba (pid %d): read %d bytes from offset %d of LEB %d:%d (unmapped)\n", tmp->pid, len, offset, vol_id, lnum); } } else { } { leb_read_unlock(ubi, vol_id, lnum); tmp___2 = ldv__builtin_expect(vol->vol_type == 4, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_eba_read_leb", 393, tmp___1->pid); dump_stack(); } } else { } { __memset(buf, 255, (size_t )len); } return (0); } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_eba_read_leb"; descriptor___0.filename = "drivers/mtd/ubi/eba.c"; descriptor___0.format = "UBI DBG eba (pid %d): read %d bytes from offset %d of LEB %d:%d, PEB %d\n"; descriptor___0.lineno = 399U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___5(); __dynamic_pr_debug(& descriptor___0, "UBI DBG eba (pid %d): read %d bytes from offset %d of LEB %d:%d, PEB %d\n", tmp___3->pid, len, offset, vol_id, lnum, pnum); } } else { } if (vol->vol_type == 3) { check = 0; } else { } retry: ; if (check != 0) { { vid_hdr = ubi_zalloc_vid_hdr___0((struct ubi_device const *)ubi, 80U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { err = -12; goto out_unlock; } else { } { err = ubi_io_read_vid_hdr(ubi, pnum, vid_hdr, 1); } if (err != 0 && err != 5) { if (err > 0) { if ((unsigned int )err - 3U <= 1U) { { printk("\fubi%d warning: %s: corrupted VID header at PEB %d, LEB %d:%d\n", ubi->ubi_num, "ubi_eba_read_leb", pnum, vol_id, lnum); err = -74; } } else { err = -22; } { ubi_ro_mode(ubi); } } else { } goto out_free; } else if (err == 5) { scrub = 1; } else { } { tmp___6 = __fswab32(vid_hdr->used_ebs); tmp___7 = ldv__builtin_expect((unsigned int )lnum >= tmp___6, 0L); } if (tmp___7 != 0L) { { tmp___5 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_eba_read_leb", 436, tmp___5->pid); dump_stack(); } } else { } { tmp___9 = __fswab32(vid_hdr->data_size); tmp___10 = ldv__builtin_expect((unsigned int )len != tmp___9, 0L); } if (tmp___10 != 0L) { { tmp___8 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_eba_read_leb", 437, tmp___8->pid); dump_stack(); } } else { } { tmp___11 = __fswab32(vid_hdr->data_crc); crc = tmp___11; ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } } else { } { err = ubi_io_read_data___0((struct ubi_device const *)ubi, buf, pnum, offset, len); } if (err != 0) { if (err == 5) { scrub = 1; } else { { tmp___12 = mtd_is_eccerr(err); } if (tmp___12 != 0) { if (vol->vol_type == 3) { goto out_unlock; } else { } scrub = 1; if (check == 0) { { printk("\rubi%d: force data checking\n", ubi->ubi_num); check = 1; } goto retry; } else { } } else { goto out_unlock; } } } else { } if (check != 0) { { tmp___13 = crc32_le(4294967295U, (unsigned char const *)buf, (size_t )len); crc1 = tmp___13; } if (crc1 != crc) { { printk("\fubi%d warning: %s: CRC error: calculated %#08x, must be %#08x\n", ubi->ubi_num, "ubi_eba_read_leb", crc1, crc); err = -74; } goto out_unlock; } else { } } else { } if (scrub != 0) { { err = ubi_wl_scrub_peb(ubi, pnum); } } else { } { leb_read_unlock(ubi, vol_id, lnum); } return (err); out_free: { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } out_unlock: { leb_read_unlock(ubi, vol_id, lnum); } return (err); } } int ubi_eba_read_leb_sg(struct ubi_device *ubi , struct ubi_volume *vol , struct ubi_sgl *sgl , int lnum , int offset , int len , int check ) { int to_read ; int ret ; struct scatterlist *sg ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; { ldv_31607: { tmp___0 = ldv__builtin_expect(sgl->list_pos > 63, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_eba_read_leb_sg", 506, tmp->pid); dump_stack(); } } else { } sg = (struct scatterlist *)(& sgl->sg) + (unsigned long )sgl->list_pos; if ((unsigned int )len < sg->length - (unsigned int )sgl->page_pos) { to_read = len; } else { to_read = (int )(sg->length - (unsigned int )sgl->page_pos); } { tmp___1 = sg_virt(sg); ret = ubi_eba_read_leb(ubi, vol, lnum, tmp___1 + (unsigned long )sgl->page_pos, offset, to_read, check); } if (ret < 0) { return (ret); } else { } offset = offset + to_read; len = len - to_read; if (len == 0) { sgl->page_pos = sgl->page_pos + to_read; if ((unsigned int )sgl->page_pos == sg->length) { sgl->list_pos = sgl->list_pos + 1; sgl->page_pos = 0; } else { } goto ldv_31606; } else { } sgl->list_pos = sgl->list_pos + 1; sgl->page_pos = 0; goto ldv_31607; ldv_31606: ; return (ret); } } static int recover_peb(struct ubi_device *ubi , int pnum , int vol_id , int lnum , void const *buf , int offset , int len ) { int err ; int idx ; int tmp ; int new_pnum ; int data_size ; int tries ; struct ubi_volume *vol ; struct ubi_vid_hdr *vid_hdr ; unsigned long long tmp___0 ; __u64 tmp___1 ; { { tmp = vol_id2idx((struct ubi_device const *)ubi, vol_id); idx = tmp; tries = 0; vol = ubi->volumes[idx]; vid_hdr = ubi_zalloc_vid_hdr___0((struct ubi_device const *)ubi, 80U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } retry: { new_pnum = ubi_wl_get_peb(ubi); } if (new_pnum < 0) { { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (new_pnum); } else { } { printk("\rubi%d: recover PEB %d, move data to PEB %d\n", ubi->ubi_num, pnum, new_pnum); err = ubi_io_read_vid_hdr(ubi, pnum, vid_hdr, 1); } if (err != 0 && err != 5) { if (err > 0) { err = -5; } else { } goto out_put; } else { } { tmp___0 = ubi_next_sqnum(ubi); tmp___1 = __fswab64(tmp___0); vid_hdr->sqnum = tmp___1; err = ubi_io_write_vid_hdr(ubi, new_pnum, vid_hdr); } if (err != 0) { goto write_error; } else { } { data_size = offset + len; ldv_mutex_lock_105___0(& ubi->buf_mutex); __memset(ubi->peb_buf + (unsigned long )offset, 255, (size_t )len); } if (offset > 0) { { err = ubi_io_read_data___0((struct ubi_device const *)ubi, ubi->peb_buf, pnum, 0, offset); } if (err != 0 && err != 5) { goto out_unlock; } else { } } else { } { __memcpy(ubi->peb_buf + (unsigned long )offset, buf, (size_t )len); err = ubi_io_write_data___0(ubi, (void const *)ubi->peb_buf, new_pnum, 0, data_size); } if (err != 0) { { ldv_mutex_unlock_106___0(& ubi->buf_mutex); } goto write_error; } else { } { ldv_mutex_unlock_107(& ubi->buf_mutex); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); down_read(& ubi->fm_sem); *(vol->eba_tbl + (unsigned long )lnum) = new_pnum; up_read(& ubi->fm_sem); ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); printk("\rubi%d: data was successfully recovered\n", ubi->ubi_num); } return (0); out_unlock: { ldv_mutex_unlock_108___0(& ubi->buf_mutex); } out_put: { ubi_wl_put_peb(ubi, vol_id, lnum, new_pnum, 1); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); write_error: { printk("\fubi%d warning: %s: failed to write to PEB %d\n", ubi->ubi_num, "recover_peb", new_pnum); ubi_wl_put_peb(ubi, vol_id, lnum, new_pnum, 1); tries = tries + 1; } if (tries > 3) { { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { } { printk("\rubi%d: try again\n", ubi->ubi_num); } goto retry; } } int ubi_eba_write_leb(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void const *buf , int offset , int len ) { int err ; int pnum ; int tries ; int vol_id ; struct ubi_vid_hdr *vid_hdr ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; unsigned long long tmp___1 ; __u64 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; int tmp___5 ; __u32 tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; unsigned long long tmp___9 ; __u64 tmp___10 ; { tries = 0; vol_id = vol->vol_id; if (ubi->ro_mode != 0) { return (-30); } else { } { err = leb_write_lock(ubi, vol_id, lnum); } if (err != 0) { return (err); } else { } pnum = *(vol->eba_tbl + (unsigned long )lnum); if (pnum >= 0) { { descriptor.modname = "ubi"; descriptor.function = "ubi_eba_write_leb"; descriptor.filename = "drivers/mtd/ubi/eba.c"; descriptor.format = "UBI DBG eba (pid %d): write %d bytes at offset %d of LEB %d:%d, PEB %d\n"; descriptor.lineno = 669U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); __dynamic_pr_debug(& descriptor, "UBI DBG eba (pid %d): write %d bytes at offset %d of LEB %d:%d, PEB %d\n", tmp->pid, len, offset, vol_id, lnum, pnum); } } else { } { err = ubi_io_write_data___0(ubi, buf, pnum, offset, len); } if (err != 0) { { printk("\fubi%d warning: %s: failed to write data to PEB %d\n", ubi->ubi_num, "ubi_eba_write_leb", pnum); } if (err == -5 && (unsigned int )*((unsigned char *)ubi + 6612UL) != 0U) { { err = recover_peb(ubi, pnum, vol_id, lnum, buf, offset, len); } } else { } if (err != 0) { { ubi_ro_mode(ubi); } } else { } } else { } { leb_write_unlock(ubi, vol_id, lnum); } return (err); } else { } { vid_hdr = ubi_zalloc_vid_hdr___0((struct ubi_device const *)ubi, 80U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { { leb_write_unlock(ubi, vol_id, lnum); } return (-12); } else { } { vid_hdr->vol_type = 1U; tmp___1 = ubi_next_sqnum(ubi); tmp___2 = __fswab64(tmp___1); vid_hdr->sqnum = tmp___2; tmp___3 = __fswab32((__u32 )vol_id); vid_hdr->vol_id = tmp___3; tmp___4 = __fswab32((__u32 )lnum); vid_hdr->lnum = tmp___4; tmp___5 = ubi_get_compat((struct ubi_device const *)ubi, vol_id); vid_hdr->compat = (__u8 )tmp___5; tmp___6 = __fswab32((__u32 )vol->data_pad); vid_hdr->data_pad = tmp___6; } retry: { pnum = ubi_wl_get_peb(ubi); } if (pnum < 0) { { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); leb_write_unlock(ubi, vol_id, lnum); } return (pnum); } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_eba_write_leb"; descriptor___0.filename = "drivers/mtd/ubi/eba.c"; descriptor___0.format = "UBI DBG eba (pid %d): write VID hdr and %d bytes at offset %d of LEB %d:%d, PEB %d\n"; descriptor___0.lineno = 710U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___5(); __dynamic_pr_debug(& descriptor___0, "UBI DBG eba (pid %d): write VID hdr and %d bytes at offset %d of LEB %d:%d, PEB %d\n", tmp___7->pid, len, offset, vol_id, lnum, pnum); } } else { } { err = ubi_io_write_vid_hdr(ubi, pnum, vid_hdr); } if (err != 0) { { printk("\fubi%d warning: %s: failed to write VID header to LEB %d:%d, PEB %d\n", ubi->ubi_num, "ubi_eba_write_leb", vol_id, lnum, pnum); } goto write_error; } else { } if (len != 0) { { err = ubi_io_write_data___0(ubi, buf, pnum, offset, len); } if (err != 0) { { printk("\fubi%d warning: %s: failed to write %d bytes at offset %d of LEB %d:%d, PEB %d\n", ubi->ubi_num, "ubi_eba_write_leb", len, offset, vol_id, lnum, pnum); } goto write_error; } else { } } else { } { down_read(& ubi->fm_sem); *(vol->eba_tbl + (unsigned long )lnum) = pnum; up_read(& ubi->fm_sem); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (0); write_error: ; if (err != -5 || (unsigned int )*((unsigned char *)ubi + 6612UL) == 0U) { { ubi_ro_mode(ubi); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { } { err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); } if (err != 0) { { ubi_ro_mode(ubi); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { tries = tries + 1; if (tries > 3) { { ubi_ro_mode(ubi); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { } } { tmp___9 = ubi_next_sqnum(ubi); tmp___10 = __fswab64(tmp___9); vid_hdr->sqnum = tmp___10; printk("\rubi%d: try another PEB\n", ubi->ubi_num); } goto retry; } } int ubi_eba_write_leb_st(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void const *buf , int len , int used_ebs ) { int err ; int pnum ; int tries ; int data_size ; int vol_id ; struct ubi_vid_hdr *vid_hdr ; uint32_t crc ; struct task_struct *tmp ; long tmp___0 ; unsigned long long tmp___1 ; __u64 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; int tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; struct _ddebug descriptor ; struct task_struct *tmp___10 ; long tmp___11 ; struct task_struct *tmp___12 ; long tmp___13 ; unsigned long long tmp___14 ; __u64 tmp___15 ; { tries = 0; data_size = len; vol_id = vol->vol_id; if (ubi->ro_mode != 0) { return (-30); } else { } if (lnum == used_ebs + -1) { len = (data_size + (ubi->min_io_size + -1)) & - ubi->min_io_size; } else { { tmp___0 = ldv__builtin_expect((len & (ubi->min_io_size + -1)) != 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_eba_write_leb_st", 798, tmp->pid); dump_stack(); } } else { } } { vid_hdr = ubi_zalloc_vid_hdr___0((struct ubi_device const *)ubi, 80U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } { err = leb_write_lock(ubi, vol_id, lnum); } if (err != 0) { { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { } { tmp___1 = ubi_next_sqnum(ubi); tmp___2 = __fswab64(tmp___1); vid_hdr->sqnum = tmp___2; tmp___3 = __fswab32((__u32 )vol_id); vid_hdr->vol_id = tmp___3; tmp___4 = __fswab32((__u32 )lnum); vid_hdr->lnum = tmp___4; tmp___5 = ubi_get_compat((struct ubi_device const *)ubi, vol_id); vid_hdr->compat = (__u8 )tmp___5; tmp___6 = __fswab32((__u32 )vol->data_pad); vid_hdr->data_pad = tmp___6; crc = crc32_le(4294967295U, (unsigned char const *)buf, (size_t )data_size); vid_hdr->vol_type = 2U; tmp___7 = __fswab32((__u32 )data_size); vid_hdr->data_size = tmp___7; tmp___8 = __fswab32((__u32 )used_ebs); vid_hdr->used_ebs = tmp___8; tmp___9 = __fswab32(crc); vid_hdr->data_crc = tmp___9; } retry: { pnum = ubi_wl_get_peb(ubi); } if (pnum < 0) { { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); leb_write_unlock(ubi, vol_id, lnum); } return (pnum); } else { } { descriptor.modname = "ubi"; descriptor.function = "ubi_eba_write_leb_st"; descriptor.filename = "drivers/mtd/ubi/eba.c"; descriptor.format = "UBI DBG eba (pid %d): write VID hdr and %d bytes at LEB %d:%d, PEB %d, used_ebs %d\n"; descriptor.lineno = 831U; descriptor.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___11 != 0L) { { tmp___10 = get_current___5(); __dynamic_pr_debug(& descriptor, "UBI DBG eba (pid %d): write VID hdr and %d bytes at LEB %d:%d, PEB %d, used_ebs %d\n", tmp___10->pid, len, vol_id, lnum, pnum, used_ebs); } } else { } { err = ubi_io_write_vid_hdr(ubi, pnum, vid_hdr); } if (err != 0) { { printk("\fubi%d warning: %s: failed to write VID header to LEB %d:%d, PEB %d\n", ubi->ubi_num, "ubi_eba_write_leb_st", vol_id, lnum, pnum); } goto write_error; } else { } { err = ubi_io_write_data___0(ubi, buf, pnum, 0, len); } if (err != 0) { { printk("\fubi%d warning: %s: failed to write %d bytes of data to PEB %d\n", ubi->ubi_num, "ubi_eba_write_leb_st", len, pnum); } goto write_error; } else { } { tmp___13 = ldv__builtin_expect(*(vol->eba_tbl + (unsigned long )lnum) >= 0, 0L); } if (tmp___13 != 0L) { { tmp___12 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_eba_write_leb_st", 847, tmp___12->pid); dump_stack(); } } else { } { down_read(& ubi->fm_sem); *(vol->eba_tbl + (unsigned long )lnum) = pnum; up_read(& ubi->fm_sem); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (0); write_error: ; if (err != -5 || (unsigned int )*((unsigned char *)ubi + 6612UL) == 0U) { { ubi_ro_mode(ubi); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { } { err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); } if (err != 0) { { ubi_ro_mode(ubi); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { tries = tries + 1; if (tries > 3) { { ubi_ro_mode(ubi); leb_write_unlock(ubi, vol_id, lnum); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); } else { } } { tmp___14 = ubi_next_sqnum(ubi); tmp___15 = __fswab64(tmp___14); vid_hdr->sqnum = tmp___15; printk("\rubi%d: try another PEB\n", ubi->ubi_num); } goto retry; } } int ubi_eba_atomic_leb_change(struct ubi_device *ubi , struct ubi_volume *vol , int lnum , void const *buf , int len ) { int err ; int pnum ; int tries ; int vol_id ; struct ubi_vid_hdr *vid_hdr ; uint32_t crc ; int tmp ; unsigned long long tmp___0 ; __u64 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; int tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; struct _ddebug descriptor ; struct task_struct *tmp___8 ; long tmp___9 ; unsigned long long tmp___10 ; __u64 tmp___11 ; { tries = 0; vol_id = vol->vol_id; if (ubi->ro_mode != 0) { return (-30); } else { } if (len == 0) { { err = ubi_eba_unmap_leb(ubi, vol, lnum); } if (err != 0) { return (err); } else { } { tmp = ubi_eba_write_leb(ubi, vol, lnum, (void const *)0, 0, 0); } return (tmp); } else { } { vid_hdr = ubi_zalloc_vid_hdr___0((struct ubi_device const *)ubi, 80U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } { ldv_mutex_lock_109___1(& ubi->alc_mutex); err = leb_write_lock(ubi, vol_id, lnum); } if (err != 0) { goto out_mutex; } else { } { tmp___0 = ubi_next_sqnum(ubi); tmp___1 = __fswab64(tmp___0); vid_hdr->sqnum = tmp___1; tmp___2 = __fswab32((__u32 )vol_id); vid_hdr->vol_id = tmp___2; tmp___3 = __fswab32((__u32 )lnum); vid_hdr->lnum = tmp___3; tmp___4 = ubi_get_compat((struct ubi_device const *)ubi, vol_id); vid_hdr->compat = (__u8 )tmp___4; tmp___5 = __fswab32((__u32 )vol->data_pad); vid_hdr->data_pad = tmp___5; crc = crc32_le(4294967295U, (unsigned char const *)buf, (size_t )len); vid_hdr->vol_type = 1U; tmp___6 = __fswab32((__u32 )len); vid_hdr->data_size = tmp___6; vid_hdr->copy_flag = 1U; tmp___7 = __fswab32(crc); vid_hdr->data_crc = tmp___7; } retry: { pnum = ubi_wl_get_peb(ubi); } if (pnum < 0) { err = pnum; goto out_leb_unlock; } else { } { descriptor.modname = "ubi"; descriptor.function = "ubi_eba_atomic_leb_change"; descriptor.filename = "drivers/mtd/ubi/eba.c"; descriptor.format = "UBI DBG eba (pid %d): change LEB %d:%d, PEB %d, write VID hdr to PEB %d\n"; descriptor.lineno = 949U; descriptor.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___9 != 0L) { { tmp___8 = get_current___5(); __dynamic_pr_debug(& descriptor, "UBI DBG eba (pid %d): change LEB %d:%d, PEB %d, write VID hdr to PEB %d\n", tmp___8->pid, vol_id, lnum, *(vol->eba_tbl + (unsigned long )lnum), pnum); } } else { } { err = ubi_io_write_vid_hdr(ubi, pnum, vid_hdr); } if (err != 0) { { printk("\fubi%d warning: %s: failed to write VID header to LEB %d:%d, PEB %d\n", ubi->ubi_num, "ubi_eba_atomic_leb_change", vol_id, lnum, pnum); } goto write_error; } else { } { err = ubi_io_write_data___0(ubi, buf, pnum, 0, len); } if (err != 0) { { printk("\fubi%d warning: %s: failed to write %d bytes of data to PEB %d\n", ubi->ubi_num, "ubi_eba_atomic_leb_change", len, pnum); } goto write_error; } else { } if (*(vol->eba_tbl + (unsigned long )lnum) >= 0) { { err = ubi_wl_put_peb(ubi, vol_id, lnum, *(vol->eba_tbl + (unsigned long )lnum), 0); } if (err != 0) { goto out_leb_unlock; } else { } } else { } { down_read(& ubi->fm_sem); *(vol->eba_tbl + (unsigned long )lnum) = pnum; up_read(& ubi->fm_sem); } out_leb_unlock: { leb_write_unlock(ubi, vol_id, lnum); } out_mutex: { ldv_mutex_unlock_110___1(& ubi->alc_mutex); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (err); write_error: ; if (err != -5 || (unsigned int )*((unsigned char *)ubi + 6612UL) == 0U) { { ubi_ro_mode(ubi); } goto out_leb_unlock; } else { } { err = ubi_wl_put_peb(ubi, vol_id, lnum, pnum, 1); } if (err != 0) { { ubi_ro_mode(ubi); } goto out_leb_unlock; } else { tries = tries + 1; if (tries > 3) { { ubi_ro_mode(ubi); } goto out_leb_unlock; } else { } } { tmp___10 = ubi_next_sqnum(ubi); tmp___11 = __fswab64(tmp___10); vid_hdr->sqnum = tmp___11; printk("\rubi%d: try another PEB\n", ubi->ubi_num); } goto retry; } } static int is_error_sane(int err ) { { if (((err == -5 || err == -12) || (err == 3 || err == 4)) || err == -110) { return (0); } else { } return (1); } } int ubi_eba_copy_leb(struct ubi_device *ubi , int from , int to , struct ubi_vid_hdr *vid_hdr ) { int err ; int vol_id ; int lnum ; int data_size ; int aldata_size ; int idx ; struct ubi_volume *vol ; uint32_t crc ; __u32 tmp ; __u32 tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___7 ; long tmp___8 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___9 ; long tmp___10 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___11 ; long tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; unsigned long long tmp___15 ; __u64 tmp___16 ; int tmp___17 ; int tmp___18 ; u32 tmp___19 ; struct task_struct *tmp___20 ; long tmp___21 ; { { tmp = __fswab32(vid_hdr->vol_id); vol_id = (int )tmp; tmp___0 = __fswab32(vid_hdr->lnum); lnum = (int )tmp___0; descriptor.modname = "ubi"; descriptor.function = "ubi_eba_copy_leb"; descriptor.filename = "drivers/mtd/ubi/eba.c"; descriptor.format = "UBI DBG wl (pid %d): copy LEB %d:%d, PEB %d to PEB %d\n"; descriptor.lineno = 1055U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___5(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): copy LEB %d:%d, PEB %d to PEB %d\n", tmp___1->pid, vol_id, lnum, from, to); } } else { } if ((unsigned int )vid_hdr->vol_type == 2U) { { tmp___3 = __fswab32(vid_hdr->data_size); data_size = (int )tmp___3; aldata_size = (data_size + (ubi->min_io_size + -1)) & - ubi->min_io_size; } } else { { tmp___4 = __fswab32(vid_hdr->data_pad); aldata_size = (int )((unsigned int )ubi->leb_size - tmp___4); data_size = aldata_size; } } { idx = vol_id2idx((struct ubi_device const *)ubi, vol_id); ldv_spin_lock_95(& ubi->volumes_lock); vol = ubi->volumes[idx]; ldv_spin_unlock_96(& ubi->volumes_lock); } if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_eba_copy_leb"; descriptor___0.filename = "drivers/mtd/ubi/eba.c"; descriptor___0.format = "UBI DBG wl (pid %d): volume %d is being removed, cancel\n"; descriptor___0.lineno = 1076U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___6 != 0L) { { tmp___5 = get_current___5(); __dynamic_pr_debug(& descriptor___0, "UBI DBG wl (pid %d): volume %d is being removed, cancel\n", tmp___5->pid, vol_id); } } else { } return (1); } else { } { err = leb_write_trylock(ubi, vol_id, lnum); } if (err != 0) { { descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_eba_copy_leb"; descriptor___1.filename = "drivers/mtd/ubi/eba.c"; descriptor___1.format = "UBI DBG wl (pid %d): contention on LEB %d:%d, cancel\n"; descriptor___1.lineno = 1097U; descriptor___1.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___5(); __dynamic_pr_debug(& descriptor___1, "UBI DBG wl (pid %d): contention on LEB %d:%d, cancel\n", tmp___7->pid, vol_id, lnum); } } else { } return (6); } else { } if (*(vol->eba_tbl + (unsigned long )lnum) != from) { { descriptor___2.modname = "ubi"; descriptor___2.function = "ubi_eba_copy_leb"; descriptor___2.filename = "drivers/mtd/ubi/eba.c"; descriptor___2.format = "UBI DBG wl (pid %d): LEB %d:%d is no longer mapped to PEB %d, mapped to PEB %d, cancel\n"; descriptor___2.lineno = 1108U; descriptor___2.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); } if (tmp___10 != 0L) { { tmp___9 = get_current___5(); __dynamic_pr_debug(& descriptor___2, "UBI DBG wl (pid %d): LEB %d:%d is no longer mapped to PEB %d, mapped to PEB %d, cancel\n", tmp___9->pid, vol_id, lnum, from, *(vol->eba_tbl + (unsigned long )lnum)); } } else { } err = 1; goto out_unlock_leb; } else { } { ldv_mutex_lock_113___0(& ubi->buf_mutex); descriptor___3.modname = "ubi"; descriptor___3.function = "ubi_eba_copy_leb"; descriptor___3.filename = "drivers/mtd/ubi/eba.c"; descriptor___3.format = "UBI DBG wl (pid %d): read %d bytes of data\n"; descriptor___3.lineno = 1120U; descriptor___3.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); } if (tmp___12 != 0L) { { tmp___11 = get_current___5(); __dynamic_pr_debug(& descriptor___3, "UBI DBG wl (pid %d): read %d bytes of data\n", tmp___11->pid, aldata_size); } } else { } { err = ubi_io_read_data___0((struct ubi_device const *)ubi, ubi->peb_buf, from, 0, aldata_size); } if (err != 0 && err != 5) { { printk("\fubi%d warning: %s: error %d while reading data from PEB %d\n", ubi->ubi_num, "ubi_eba_copy_leb", err, from); err = 2; } goto out_unlock_buf; } else { } if ((unsigned int )vid_hdr->vol_type == 1U) { { data_size = ubi_calc_data_len((struct ubi_device const *)ubi, (void const *)ubi->peb_buf, data_size); aldata_size = data_size; } } else { } { ___might_sleep("drivers/mtd/ubi/eba.c", 1143, 0); _cond_resched(); crc = crc32_le(4294967295U, (unsigned char const *)ubi->peb_buf, (size_t )data_size); ___might_sleep("drivers/mtd/ubi/eba.c", 1145, 0); _cond_resched(); } if (data_size > 0) { { vid_hdr->copy_flag = 1U; tmp___13 = __fswab32((__u32 )data_size); vid_hdr->data_size = tmp___13; tmp___14 = __fswab32(crc); vid_hdr->data_crc = tmp___14; } } else { } { tmp___15 = ubi_next_sqnum(ubi); tmp___16 = __fswab64(tmp___15); vid_hdr->sqnum = tmp___16; err = ubi_io_write_vid_hdr(ubi, to, vid_hdr); } if (err != 0) { if (err == -5) { err = 4; } else { } goto out_unlock_buf; } else { } { ___might_sleep("drivers/mtd/ubi/eba.c", 1167, 0); _cond_resched(); err = ubi_io_read_vid_hdr(ubi, to, vid_hdr, 1); } if (err != 0) { if (err != 5) { { printk("\fubi%d warning: %s: error %d while reading VID header back from PEB %d\n", ubi->ubi_num, "ubi_eba_copy_leb", err, to); tmp___17 = is_error_sane(err); } if (tmp___17 != 0) { err = 3; } else { } } else { err = 5; } goto out_unlock_buf; } else { } if (data_size > 0) { { err = ubi_io_write_data___0(ubi, (void const *)ubi->peb_buf, to, 0, aldata_size); } if (err != 0) { if (err == -5) { err = 4; } else { } goto out_unlock_buf; } else { } { ___might_sleep("drivers/mtd/ubi/eba.c", 1190, 0); _cond_resched(); __memset(ubi->peb_buf, 255, (size_t )aldata_size); err = ubi_io_read_data___0((struct ubi_device const *)ubi, ubi->peb_buf, to, 0, aldata_size); } if (err != 0) { if (err != 5) { { printk("\fubi%d warning: %s: error %d while reading data back from PEB %d\n", ubi->ubi_num, "ubi_eba_copy_leb", err, to); tmp___18 = is_error_sane(err); } if (tmp___18 != 0) { err = 3; } else { } } else { err = 5; } goto out_unlock_buf; } else { } { ___might_sleep("drivers/mtd/ubi/eba.c", 1209, 0); _cond_resched(); tmp___19 = crc32_le(4294967295U, (unsigned char const *)ubi->peb_buf, (size_t )data_size); } if (crc != tmp___19) { { printk("\fubi%d warning: %s: read data back from PEB %d and it is different\n", ubi->ubi_num, "ubi_eba_copy_leb", to); err = -22; } goto out_unlock_buf; } else { } } else { } { tmp___21 = ldv__builtin_expect(*(vol->eba_tbl + (unsigned long )lnum) != from, 0L); } if (tmp___21 != 0L) { { tmp___20 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_eba_copy_leb", 1219, tmp___20->pid); dump_stack(); } } else { } { down_read(& ubi->fm_sem); *(vol->eba_tbl + (unsigned long )lnum) = to; up_read(& ubi->fm_sem); } out_unlock_buf: { ldv_mutex_unlock_114___0(& ubi->buf_mutex); } out_unlock_leb: { leb_write_unlock(ubi, vol_id, lnum); } return (err); } } static void print_rsvd_warning(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int min ; { if (ai->max_sqnum > 262144ULL) { min = ubi->beb_rsvd_level / 10; if (min == 0) { min = 1; } else { } if (ubi->beb_rsvd_pebs > min) { return; } else { } } else { } { printk("\fubi%d warning: %s: cannot reserve enough PEBs for bad PEB handling, reserved %d, need %d\n", ubi->ubi_num, "print_rsvd_warning", ubi->beb_rsvd_pebs, ubi->beb_rsvd_level); } if (ubi->corr_peb_count != 0) { { printk("\fubi%d warning: %s: %d PEBs are corrupted and not used\n", ubi->ubi_num, "print_rsvd_warning", ubi->corr_peb_count); } } else { } return; } } int self_check_eba(struct ubi_device *ubi , struct ubi_attach_info *ai_fastmap , struct ubi_attach_info *ai_scan ) { int i ; int j ; int num_volumes ; int ret ; int **scan_eba ; int **fm_eba ; struct ubi_ainf_volume *av ; struct ubi_volume *vol ; struct ubi_ainf_peb *aeb ; struct rb_node *rb ; void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; int tmp___3 ; int tmp___4 ; struct rb_node const *__mptr ; struct rb_node const *__mptr___0 ; int tmp___5 ; struct rb_node const *__mptr___1 ; struct rb_node const *__mptr___2 ; struct task_struct *tmp___6 ; { { ret = 0; num_volumes = ubi->vtbl_slots + 1; tmp = kmalloc((unsigned long )num_volumes * 8UL, 208U); scan_eba = (int **)tmp; } if ((unsigned long )scan_eba == (unsigned long )((int **)0)) { return (-12); } else { } { tmp___0 = kmalloc((unsigned long )num_volumes * 8UL, 208U); fm_eba = (int **)tmp___0; } if ((unsigned long )fm_eba == (unsigned long )((int **)0)) { { kfree((void const *)scan_eba); } return (-12); } else { } i = 0; goto ldv_31761; ldv_31760: vol = ubi->volumes[i]; if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { goto ldv_31736; } else { } { tmp___1 = kmalloc((unsigned long )vol->reserved_pebs * 4UL, 208U); *(scan_eba + (unsigned long )i) = (int *)tmp___1; } if ((unsigned long )*(scan_eba + (unsigned long )i) == (unsigned long )((int *)0)) { ret = -12; goto out_free; } else { } { tmp___2 = kmalloc((unsigned long )vol->reserved_pebs * 4UL, 208U); *(fm_eba + (unsigned long )i) = (int *)tmp___2; } if ((unsigned long )*(fm_eba + (unsigned long )i) == (unsigned long )((int *)0)) { ret = -12; goto out_free; } else { } j = 0; goto ldv_31739; ldv_31738: tmp___3 = -1; *(*(fm_eba + (unsigned long )i) + (unsigned long )j) = tmp___3; *(*(scan_eba + (unsigned long )i) + (unsigned long )j) = tmp___3; j = j + 1; ldv_31739: ; if (j < vol->reserved_pebs) { goto ldv_31738; } else { } { tmp___4 = idx2vol_id((struct ubi_device const *)ubi, i); av = ubi_find_av((struct ubi_attach_info const *)ai_scan, tmp___4); } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { goto ldv_31736; } else { } { rb = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31746; ldv_31745: { *(*(scan_eba + (unsigned long )i) + (unsigned long )aeb->lnum) = aeb->pnum; rb = rb_next((struct rb_node const *)rb); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr___0 = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31746: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_31745; } else { } { tmp___5 = idx2vol_id((struct ubi_device const *)ubi, i); av = ubi_find_av((struct ubi_attach_info const *)ai_fastmap, tmp___5); } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { goto ldv_31736; } else { } { rb = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr___1 = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31753; ldv_31752: { *(*(fm_eba + (unsigned long )i) + (unsigned long )aeb->lnum) = aeb->pnum; rb = rb_next((struct rb_node const *)rb); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr___2 = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr___2 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31753: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_31752; } else { } j = 0; goto ldv_31758; ldv_31757: ; if (*(*(scan_eba + (unsigned long )i) + (unsigned long )j) != *(*(fm_eba + (unsigned long )i) + (unsigned long )j)) { if (*(*(scan_eba + (unsigned long )i) + (unsigned long )j) == -1 || *(*(fm_eba + (unsigned long )i) + (unsigned long )j) == -1) { goto ldv_31755; } else { } { printk("\vubi%d error: %s: LEB:%i:%i is PEB:%i instead of %i!\n", ubi->ubi_num, "self_check_eba", vol->vol_id, i, *(*(fm_eba + (unsigned long )i) + (unsigned long )j), *(*(scan_eba + (unsigned long )i) + (unsigned long )j)); tmp___6 = get_current___5(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "self_check_eba", 1349, tmp___6->pid); dump_stack(); } } else { } ldv_31755: j = j + 1; ldv_31758: ; if (j < vol->reserved_pebs) { goto ldv_31757; } else { } ldv_31736: i = i + 1; ldv_31761: ; if (i < num_volumes) { goto ldv_31760; } else { } out_free: i = 0; goto ldv_31765; ldv_31764: ; if ((unsigned long )ubi->volumes[i] == (unsigned long )((struct ubi_volume *)0)) { goto ldv_31763; } else { } { kfree((void const *)*(scan_eba + (unsigned long )i)); kfree((void const *)*(fm_eba + (unsigned long )i)); } ldv_31763: i = i + 1; ldv_31765: ; if (i < num_volumes) { goto ldv_31764; } else { } { kfree((void const *)scan_eba); kfree((void const *)fm_eba); } return (ret); } } int ubi_eba_init(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int i ; int j ; int err ; int num_volumes ; struct ubi_ainf_volume *av ; struct ubi_volume *vol ; struct ubi_ainf_peb *aeb ; struct rb_node *rb ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct rb_root __constr_expr_0 ; void *tmp___1 ; int tmp___2 ; struct rb_node const *__mptr ; struct rb_node const *__mptr___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_eba_init"; descriptor.filename = "drivers/mtd/ubi/eba.c"; descriptor.format = "UBI DBG eba (pid %d): initialize EBA sub-system\n"; descriptor.lineno = 1384U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___5(); __dynamic_pr_debug(& descriptor, "UBI DBG eba (pid %d): initialize EBA sub-system\n", tmp->pid); } } else { } { spinlock_check(& ubi->ltree_lock); __raw_spin_lock_init(& ubi->ltree_lock.__annonCompField18.rlock, "&(&ubi->ltree_lock)->rlock", & __key); __mutex_init(& ubi->alc_mutex, "&ubi->alc_mutex", & __key___0); __constr_expr_0.rb_node = (struct rb_node *)0; ubi->ltree = __constr_expr_0; ubi->global_sqnum = ai->max_sqnum + 1ULL; num_volumes = ubi->vtbl_slots + 1; i = 0; } goto ldv_31798; ldv_31797: vol = ubi->volumes[i]; if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { goto ldv_31784; } else { } { ___might_sleep("drivers/mtd/ubi/eba.c", 1398, 0); _cond_resched(); tmp___1 = kmalloc((unsigned long )vol->reserved_pebs * 4UL, 208U); vol->eba_tbl = (int *)tmp___1; } if ((unsigned long )vol->eba_tbl == (unsigned long )((int *)0)) { err = -12; goto out_free; } else { } j = 0; goto ldv_31788; ldv_31787: *(vol->eba_tbl + (unsigned long )j) = -1; j = j + 1; ldv_31788: ; if (j < vol->reserved_pebs) { goto ldv_31787; } else { } { tmp___2 = idx2vol_id((struct ubi_device const *)ubi, i); av = ubi_find_av((struct ubi_attach_info const *)ai, tmp___2); } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { goto ldv_31784; } else { } { rb = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31795; ldv_31794: ; if (aeb->lnum >= vol->reserved_pebs) { { ubi_move_aeb_to_list(av, aeb, & ai->erase); } } else { } { *(vol->eba_tbl + (unsigned long )aeb->lnum) = aeb->pnum; rb = rb_next((struct rb_node const *)rb); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { __mptr___0 = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31795: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_31794; } else { } ldv_31784: i = i + 1; ldv_31798: ; if (i < num_volumes) { goto ldv_31797; } else { } if (ubi->avail_pebs <= 0) { { printk("\vubi%d error: %s: no enough physical eraseblocks (%d, need %d)\n", ubi->ubi_num, "ubi_eba_init", ubi->avail_pebs, 1); } if (ubi->corr_peb_count != 0) { { printk("\vubi%d error: %s: %d PEBs are corrupted and not used\n", ubi->ubi_num, "ubi_eba_init", ubi->corr_peb_count); } } else { } err = -28; goto out_free; } else { } ubi->avail_pebs = ubi->avail_pebs + -1; ubi->rsvd_pebs = ubi->rsvd_pebs + 1; if ((unsigned int )*((unsigned char *)ubi + 6612UL) != 0U) { { ubi_calculate_reserved(ubi); } if (ubi->avail_pebs < ubi->beb_rsvd_level) { { ubi->beb_rsvd_pebs = ubi->avail_pebs; print_rsvd_warning(ubi, ai); } } else { ubi->beb_rsvd_pebs = ubi->beb_rsvd_level; } ubi->avail_pebs = ubi->avail_pebs - ubi->beb_rsvd_pebs; ubi->rsvd_pebs = ubi->rsvd_pebs + ubi->beb_rsvd_pebs; } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_eba_init"; descriptor___0.filename = "drivers/mtd/ubi/eba.c"; descriptor___0.format = "UBI DBG eba (pid %d): EBA sub-system is initialized\n"; descriptor___0.lineno = 1451U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___5(); __dynamic_pr_debug(& descriptor___0, "UBI DBG eba (pid %d): EBA sub-system is initialized\n", tmp___3->pid); } } else { } return (0); out_free: i = 0; goto ldv_31803; ldv_31802: ; if ((unsigned long )ubi->volumes[i] == (unsigned long )((struct ubi_volume *)0)) { goto ldv_31801; } else { } { kfree((void const *)(ubi->volumes[i])->eba_tbl); (ubi->volumes[i])->eba_tbl = (int *)0; } ldv_31801: i = i + 1; ldv_31803: ; if (i < num_volumes) { goto ldv_31802; } else { } return (err); } } __inline static void ldv_spin_lock_95___1(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_lock_ltree_lock_of_ubi_device(); spin_lock(lock); } return; } } __inline static void ldv_spin_unlock_96___1(spinlock_t *lock ) { { { ldv_linux_kernel_locking_spinlock_spin_unlock_ltree_lock_of_ubi_device(); spin_unlock(lock); } return; } } static void ldv_mutex_lock_105___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_106___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_107(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_108___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_109___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_alc_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_110___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_alc_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_113___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_114___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_95___1(struct mutex *ldv_func_arg1 ) ; extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; extern void __might_sleep(char const * , int , int ) ; __inline static struct task_struct *get_current___6(void) { struct task_struct *pfo_ret__ ; { { if (8UL == 1UL) { goto case_1; } else { } if (8UL == 2UL) { goto case_2; } else { } if (8UL == 4UL) { goto case_4; } else { } if (8UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_3662; case_2: /* CIL Label */ __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3662; case_4: /* CIL Label */ __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3662; case_8: /* CIL Label */ __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_3662; switch_default: /* CIL Label */ { __bad_percpu_size(); } switch_break: /* CIL Label */ ; } ldv_3662: ; return (pfo_ret__); } } static void ldv_mutex_unlock_96___1(struct mutex *ldv_func_arg1 ) ; 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 long prepare_to_wait_event(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern void *__vmalloc(unsigned long , gfp_t , pgprot_t ) ; extern void schedule(void) ; extern void yield(void) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; extern int mtd_erase(struct mtd_info * , struct erase_info * ) ; extern int mtd_read(struct mtd_info * , loff_t , size_t , size_t * , u_char * ) ; extern int mtd_write(struct mtd_info * , loff_t , size_t , size_t * , u_char const * ) ; extern int mtd_block_isbad(struct mtd_info * , loff_t ) ; extern int mtd_block_markbad(struct mtd_info * , loff_t ) ; __inline static int mtd_is_bitflip(int err ) { { return (err == -117); } } void ubi_dump_flash(struct ubi_device *ubi , int pnum , int offset , int len ) ; void ubi_dump_ec_hdr(struct ubi_ec_hdr const *ec_hdr ) ; void ubi_dump_vid_hdr(struct ubi_vid_hdr const *vid_hdr ) ; extern u32 prandom_u32(void) ; int ubi_self_check_all_ff(struct ubi_device *ubi , int pnum , int offset , int len ) ; __inline static int ubi_dbg_is_bitflip(struct ubi_device const *ubi ) { u32 tmp ; { if ((unsigned int )*((unsigned char *)ubi + 6960UL) != 0U) { { tmp = prandom_u32(); } return (tmp % 200U == 0U); } else { } return (0); } } __inline static int ubi_dbg_is_write_failure(struct ubi_device const *ubi ) { u32 tmp ; { if ((unsigned int )*((unsigned char *)ubi + 6960UL) != 0U) { { tmp = prandom_u32(); } return (tmp % 500U == 0U); } else { } return (0); } } __inline static int ubi_dbg_is_erase_failure(struct ubi_device const *ubi ) { u32 tmp ; { if ((unsigned int )*((unsigned char *)ubi + 6960UL) != 0U) { { tmp = prandom_u32(); } return (tmp % 400U == 0U); } else { } return (0); } } __inline static int ubi_dbg_chk_io(struct ubi_device const *ubi ) { { return ((int )ubi->dbg.chk_io); } } int ubi_check_pattern(void const *buf , uint8_t patt , int size ) ; int ubi_io_sync_erase(struct ubi_device *ubi , int pnum , int torture ) ; int ubi_io_is_bad(struct ubi_device const *ubi , int pnum ) ; int ubi_io_mark_bad(struct ubi_device const *ubi , int pnum ) ; int ubi_io_read_ec_hdr(struct ubi_device *ubi , int pnum , struct ubi_ec_hdr *ec_hdr , int verbose ) ; int ubi_io_write_ec_hdr(struct ubi_device *ubi , int pnum , struct ubi_ec_hdr *ec_hdr ) ; __inline static struct ubi_vid_hdr *ubi_zalloc_vid_hdr___1(struct ubi_device const *ubi , gfp_t gfp_flags ) { void *vid_hdr ; { { vid_hdr = kzalloc((size_t )ubi->vid_hdr_alsize, gfp_flags); } if ((unsigned long )vid_hdr == (unsigned long )((void *)0)) { return ((struct ubi_vid_hdr *)0); } else { } return ((struct ubi_vid_hdr *)vid_hdr + (unsigned long )ubi->vid_hdr_shift); } } static int self_check_not_bad(struct ubi_device const *ubi , int pnum ) ; static int self_check_peb_ec_hdr(struct ubi_device const *ubi , int pnum ) ; static int self_check_ec_hdr(struct ubi_device const *ubi , int pnum , struct ubi_ec_hdr const *ec_hdr ) ; static int self_check_peb_vid_hdr(struct ubi_device const *ubi , int pnum ) ; static int self_check_vid_hdr(struct ubi_device const *ubi , int pnum , struct ubi_vid_hdr const *vid_hdr ) ; static int self_check_write(struct ubi_device *ubi , void const *buf , int pnum , int offset , int len ) ; int ubi_io_read(struct ubi_device const *ubi , void *buf , int pnum , int offset , int len ) { int err ; int retries ; size_t read ; loff_t addr ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; char const *errstr ; int tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; int tmp___12 ; int tmp___13 ; struct task_struct *tmp___14 ; int tmp___15 ; struct task_struct *tmp___16 ; long tmp___17 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___18 ; long tmp___19 ; int tmp___20 ; { { retries = 0; descriptor.modname = "ubi"; descriptor.function = "ubi_io_read"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): read %d bytes from PEB %d:%d\n"; descriptor.lineno = 133U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): read %d bytes from PEB %d:%d\n", tmp->pid, len, pnum, offset); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 135, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect(pnum >= (int )ubi->peb_count, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 135, tmp___1->pid); dump_stack(); } } else { } } { tmp___5 = ldv__builtin_expect(offset < 0, 0L); } if (tmp___5 != 0L) { { tmp___4 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 136, tmp___4->pid); dump_stack(); } } else { { tmp___6 = ldv__builtin_expect(offset + len > (int )ubi->peb_size, 0L); } if (tmp___6 != 0L) { { tmp___4 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 136, tmp___4->pid); dump_stack(); } } else { } } { tmp___8 = ldv__builtin_expect(len <= 0, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 137, tmp___7->pid); dump_stack(); } } else { } { err = self_check_not_bad(ubi, pnum); } if (err != 0) { return (err); } else { } *((uint8_t *)buf) = ~ ((int )*((uint8_t *)buf)); addr = (long long )pnum * (long long )ubi->peb_size + (long long )offset; retry: { err = mtd_read(ubi->mtd, addr, (size_t )len, & read, (u_char *)buf); } if (err != 0) { { tmp___9 = mtd_is_eccerr(err); errstr = tmp___9 != 0 ? " (ECC error)" : ""; tmp___12 = mtd_is_bitflip(err); } if (tmp___12 != 0) { { printk("\rubi%d: fixable bit-flip detected at PEB %d\n", ubi->ubi_num, pnum); tmp___11 = ldv__builtin_expect((size_t )len != read, 0L); } if (tmp___11 != 0L) { { tmp___10 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 182, tmp___10->pid); dump_stack(); } } else { } return (5); } else { } tmp___13 = retries; retries = retries + 1; if (tmp___13 <= 2) { { printk("\fubi%d warning: %s: error %d%s while reading %d bytes from PEB %d:%d, read only %zd bytes, retry\n", ubi->ubi_num, "ubi_io_read", err, errstr, len, pnum, offset, read); yield(); } goto retry; } else { } { printk("\vubi%d error: %s: error %d%s while reading %d bytes from PEB %d:%d, read %zd bytes\n", ubi->ubi_num, "ubi_io_read", err, errstr, len, pnum, offset, read); dump_stack(); } if (read != (size_t )len) { { tmp___15 = mtd_is_eccerr(err); } if (tmp___15 != 0) { { tmp___14 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 203, tmp___14->pid); dump_stack(); err = -5; } } else { } } else { } } else { { tmp___17 = ldv__builtin_expect((size_t )len != read, 0L); } if (tmp___17 != 0L) { { tmp___16 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read", 207, tmp___16->pid); dump_stack(); } } else { } { tmp___20 = ubi_dbg_is_bitflip(ubi); } if (tmp___20 != 0) { { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_io_read"; descriptor___0.filename = "drivers/mtd/ubi/io.c"; descriptor___0.format = "UBI DBG gen (pid %d): bit-flip (emulated)\n"; descriptor___0.lineno = 210U; descriptor___0.flags = 0U; tmp___19 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___19 != 0L) { { tmp___18 = get_current___6(); __dynamic_pr_debug(& descriptor___0, "UBI DBG gen (pid %d): bit-flip (emulated)\n", tmp___18->pid); } } else { } err = 5; } else { } } return (err); } } int ubi_io_write(struct ubi_device *ubi , void const *buf , int pnum , int offset , int len ) { int err ; size_t written ; loff_t addr ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; long tmp___11 ; int tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_io_write"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): write %d bytes to PEB %d:%d\n"; descriptor.lineno = 242U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): write %d bytes to PEB %d:%d\n", tmp->pid, len, pnum, offset); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 244, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 244, tmp___1->pid); dump_stack(); } } else { } } { tmp___5 = ldv__builtin_expect(offset < 0, 0L); } if (tmp___5 != 0L) { { tmp___4 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 245, tmp___4->pid); dump_stack(); } } else { { tmp___6 = ldv__builtin_expect(offset + len > ubi->peb_size, 0L); } if (tmp___6 != 0L) { { tmp___4 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 245, tmp___4->pid); dump_stack(); } } else { } } { tmp___8 = ldv__builtin_expect(offset % ubi->hdrs_min_io_size != 0, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 246, tmp___7->pid); dump_stack(); } } else { } { tmp___10 = ldv__builtin_expect(len <= 0, 0L); } if (tmp___10 != 0L) { { tmp___9 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 247, tmp___9->pid); dump_stack(); } } else { { tmp___11 = ldv__builtin_expect(len % ubi->hdrs_min_io_size != 0, 0L); } if (tmp___11 != 0L) { { tmp___9 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 247, tmp___9->pid); dump_stack(); } } else { } } if (ubi->ro_mode != 0) { { printk("\vubi%d error: %s: read-only mode\n", ubi->ubi_num, "ubi_io_write"); } return (-30); } else { } { err = self_check_not_bad((struct ubi_device const *)ubi, pnum); } if (err != 0) { return (err); } else { } { err = ubi_self_check_all_ff(ubi, pnum, offset, len); } if (err != 0) { return (err); } else { } if (offset >= ubi->leb_start) { { err = self_check_peb_ec_hdr((struct ubi_device const *)ubi, pnum); } if (err != 0) { return (err); } else { } { err = self_check_peb_vid_hdr((struct ubi_device const *)ubi, pnum); } if (err != 0) { return (err); } else { } } else { } { tmp___12 = ubi_dbg_is_write_failure((struct ubi_device const *)ubi); } if (tmp___12 != 0) { { printk("\vubi%d error: %s: cannot write %d bytes to PEB %d:%d (emulated)\n", ubi->ubi_num, "ubi_io_write", len, pnum, offset); dump_stack(); } return (-5); } else { } { addr = (long long )pnum * (long long )ubi->peb_size + (long long )offset; err = mtd_write(ubi->mtd, addr, (size_t )len, & written, (u_char const *)buf); } if (err != 0) { { printk("\vubi%d error: %s: error %d while writing %d bytes to PEB %d:%d, written %zd bytes\n", ubi->ubi_num, "ubi_io_write", err, len, pnum, offset, written); dump_stack(); ubi_dump_flash(ubi, pnum, offset, len); } } else { { tmp___14 = ldv__builtin_expect(written != (size_t )len, 0L); } if (tmp___14 != 0L) { { tmp___13 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write", 291, tmp___13->pid); dump_stack(); } } else { } } if (err == 0) { { err = self_check_write(ubi, buf, pnum, offset, len); } if (err != 0) { return (err); } else { } offset = offset + len; len = ubi->peb_size - offset; if (len != 0) { { err = ubi_self_check_all_ff(ubi, pnum, offset, len); } } else { } } else { } return (err); } } static void erase_callback(struct erase_info *ei ) { { { __wake_up((wait_queue_head_t *)ei->priv, 1U, 1, (void *)0); } return; } } static int do_sync_erase(struct ubi_device *ubi , int pnum ) { int err ; int retries ; struct erase_info ei ; wait_queue_head_t wq ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct lock_class_key __key ; int tmp___4 ; int __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___5 ; int tmp___6 ; int tmp___7 ; { { retries = 0; descriptor.modname = "ubi"; descriptor.function = "do_sync_erase"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): erase PEB %d\n"; descriptor.lineno = 338U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): erase PEB %d\n", tmp->pid, pnum); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "do_sync_erase", 339, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "do_sync_erase", 339, tmp___1->pid); dump_stack(); } } else { } } if (ubi->ro_mode != 0) { { printk("\vubi%d error: %s: read-only mode\n", ubi->ubi_num, "do_sync_erase"); } return (-30); } else { } retry: { __init_waitqueue_head(& wq, "&wq", & __key); __memset((void *)(& ei), 0, 88UL); ei.mtd = ubi->mtd; ei.addr = (uint64_t )((long long )pnum * (long long )ubi->peb_size); ei.len = (uint64_t )ubi->peb_size; ei.callback = & erase_callback; ei.priv = (unsigned long )(& wq); err = mtd_erase(ubi->mtd, & ei); } if (err != 0) { tmp___4 = retries; retries = retries + 1; if (tmp___4 <= 2) { { printk("\fubi%d warning: %s: error %d while erasing PEB %d, retry\n", ubi->ubi_num, "do_sync_erase", err, pnum); yield(); } goto retry; } else { } { printk("\vubi%d error: %s: cannot erase PEB %d, error %d\n", ubi->ubi_num, "do_sync_erase", pnum, err); dump_stack(); } return (err); } else { } { __ret = 0; __might_sleep("drivers/mtd/ubi/io.c", 370, 0); } if ((unsigned int )ei.state != 8U && (unsigned int )ei.state != 16U) { { __ret___0 = 0L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; } ldv_31478: { tmp___5 = prepare_to_wait_event(& wq, & __wait, 1); __int = tmp___5; } if ((unsigned int )ei.state == 8U || (unsigned int )ei.state == 16U) { goto ldv_31477; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_31477; } else { } { schedule(); } goto ldv_31478; ldv_31477: { finish_wait(& wq, & __wait); } __ret = (int )__ret___0; } else { } err = __ret; if (err != 0) { { printk("\vubi%d error: %s: interrupted PEB %d erasure\n", ubi->ubi_num, "do_sync_erase", pnum); } return (-4); } else { } if ((unsigned int )ei.state == 16U) { tmp___6 = retries; retries = retries + 1; if (tmp___6 <= 2) { { printk("\fubi%d warning: %s: error while erasing PEB %d, retry\n", ubi->ubi_num, "do_sync_erase", pnum); yield(); } goto retry; } else { } { printk("\vubi%d error: %s: cannot erase PEB %d\n", ubi->ubi_num, "do_sync_erase", pnum); dump_stack(); } return (-5); } else { } { err = ubi_self_check_all_ff(ubi, pnum, 0, ubi->peb_size); } if (err != 0) { return (err); } else { } { tmp___7 = ubi_dbg_is_erase_failure((struct ubi_device const *)ubi); } if (tmp___7 != 0) { { printk("\vubi%d error: %s: cannot erase PEB %d (emulated)\n", ubi->ubi_num, "do_sync_erase", pnum); } return (-5); } else { } return (0); } } static uint8_t patterns[3U] = { 165U, 90U, 0U}; static int torture_peb(struct ubi_device *ubi , int pnum ) { int err ; int i ; int patt_count ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { printk("\rubi%d: run torture test for PEB %d\n", ubi->ubi_num, pnum); patt_count = 3; tmp___0 = ldv__builtin_expect(patt_count <= 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "torture_peb", 418, tmp->pid); dump_stack(); } } else { } { ldv_mutex_lock_95___1(& ubi->buf_mutex); i = 0; } goto ldv_31494; ldv_31493: { err = do_sync_erase(ubi, pnum); } if (err != 0) { goto out; } else { } { err = ubi_io_read((struct ubi_device const *)ubi, ubi->peb_buf, pnum, 0, ubi->peb_size); } if (err != 0) { goto out; } else { } { err = ubi_check_pattern((void const *)ubi->peb_buf, 255, ubi->peb_size); } if (err == 0) { { printk("\vubi%d error: %s: erased PEB %d, but a non-0xFF byte found\n", ubi->ubi_num, "torture_peb", pnum); err = -5; } goto out; } else { } { __memset(ubi->peb_buf, (int )patterns[i], (size_t )ubi->peb_size); err = ubi_io_write(ubi, (void const *)ubi->peb_buf, pnum, 0, ubi->peb_size); } if (err != 0) { goto out; } else { } { __memset(ubi->peb_buf, ~ ((int )patterns[i]), (size_t )ubi->peb_size); err = ubi_io_read((struct ubi_device const *)ubi, ubi->peb_buf, pnum, 0, ubi->peb_size); } if (err != 0) { goto out; } else { } { err = ubi_check_pattern((void const *)ubi->peb_buf, (int )patterns[i], ubi->peb_size); } if (err == 0) { { printk("\vubi%d error: %s: pattern %x checking failed for PEB %d\n", ubi->ubi_num, "torture_peb", (int )patterns[i], pnum); err = -5; } goto out; } else { } i = i + 1; ldv_31494: ; if (i < patt_count) { goto ldv_31493; } else { } { err = patt_count; printk("\rubi%d: PEB %d passed torture test, do not mark it as bad\n", ubi->ubi_num, pnum); } out: { ldv_mutex_unlock_96___1(& ubi->buf_mutex); } if (err == 5) { { printk("\vubi%d error: %s: read problems on freshly erased PEB %d, must be bad\n", ubi->ubi_num, "torture_peb", pnum); err = -5; } } else { { tmp___1 = mtd_is_eccerr(err); } if (tmp___1 != 0) { { printk("\vubi%d error: %s: read problems on freshly erased PEB %d, must be bad\n", ubi->ubi_num, "torture_peb", pnum); err = -5; } } else { } } return (err); } } static int nor_erase_prepare(struct ubi_device *ubi , int pnum ) { int err ; size_t written ; loff_t addr ; uint32_t data ; struct ubi_ec_hdr ec_hdr ; struct ubi_vid_hdr vid_hdr ; { { data = 0U; addr = (long long )pnum * (long long )ubi->peb_size; err = ubi_io_read_ec_hdr(ubi, pnum, & ec_hdr, 0); } if ((unsigned int )err - 3U > 1U && err != 1) { { err = mtd_write(ubi->mtd, addr, 4UL, & written, (u_char const *)(& data)); } if (err != 0) { goto error; } else { } } else { } { err = ubi_io_read_vid_hdr(ubi, pnum, & vid_hdr, 0); } if ((unsigned int )err - 3U > 1U && err != 1) { { addr = addr + (loff_t )ubi->vid_hdr_aloffset; err = mtd_write(ubi->mtd, addr, 4UL, & written, (u_char const *)(& data)); } if (err != 0) { goto error; } else { } } else { } return (0); error: { printk("\vubi%d error: %s: cannot invalidate PEB %d, write returned %d\n", ubi->ubi_num, "nor_erase_prepare", pnum, err); ubi_dump_flash(ubi, pnum, 0, ubi->peb_size); } return (-5); } } int ubi_io_sync_erase(struct ubi_device *ubi , int pnum , int torture ) { int err ; int ret ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; { { ret = 0; tmp___0 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_sync_erase", 572, tmp->pid); dump_stack(); } } else { { tmp___1 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___1 != 0L) { { tmp = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_sync_erase", 572, tmp->pid); dump_stack(); } } else { } } { err = self_check_not_bad((struct ubi_device const *)ubi, pnum); } if (err != 0) { return (err); } else { } if (ubi->ro_mode != 0) { { printk("\vubi%d error: %s: read-only mode\n", ubi->ubi_num, "ubi_io_sync_erase"); } return (-30); } else { } if ((unsigned int )*((unsigned char *)ubi + 6612UL) != 0U) { { err = nor_erase_prepare(ubi, pnum); } if (err != 0) { return (err); } else { } } else { } if (torture != 0) { { ret = torture_peb(ubi, pnum); } if (ret < 0) { return (ret); } else { } } else { } { err = do_sync_erase(ubi, pnum); } if (err != 0) { return (err); } else { } return (ret + 1); } } int ubi_io_is_bad(struct ubi_device const *ubi , int pnum ) { struct mtd_info *mtd ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int ret ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; { { mtd = ubi->mtd; tmp___0 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_is_bad", 614, tmp->pid); dump_stack(); } } else { { tmp___1 = ldv__builtin_expect(pnum >= (int )ubi->peb_count, 0L); } if (tmp___1 != 0L) { { tmp = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_is_bad", 614, tmp->pid); dump_stack(); } } else { } } if ((unsigned int )*((unsigned char *)ubi + 6612UL) != 0U) { { ret = mtd_block_isbad(mtd, (long long )pnum * (long long )ubi->peb_size); } if (ret < 0) { { printk("\vubi%d error: %s: error %d while checking if PEB %d is bad\n", ubi->ubi_num, "ubi_io_is_bad", ret, pnum); } } else if (ret != 0) { { descriptor.modname = "ubi"; descriptor.function = "ubi_io_is_bad"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): PEB %d is bad\n"; descriptor.lineno = 624U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): PEB %d is bad\n", tmp___2->pid, pnum); } } else { } } else { } return (ret); } else { } return (0); } } int ubi_io_mark_bad(struct ubi_device const *ubi , int pnum ) { int err ; struct mtd_info *mtd ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; { { mtd = ubi->mtd; tmp___0 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_mark_bad", 644, tmp->pid); dump_stack(); } } else { { tmp___1 = ldv__builtin_expect(pnum >= (int )ubi->peb_count, 0L); } if (tmp___1 != 0L) { { tmp = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_mark_bad", 644, tmp->pid); dump_stack(); } } else { } } if ((int )ubi->ro_mode != 0) { { printk("\vubi%d error: %s: read-only mode\n", ubi->ubi_num, "ubi_io_mark_bad"); } return (-30); } else { } if ((unsigned int )*((unsigned char *)ubi + 6612UL) == 0U) { return (0); } else { } { err = mtd_block_markbad(mtd, (long long )pnum * (long long )ubi->peb_size); } if (err != 0) { { printk("\vubi%d error: %s: cannot mark PEB %d bad, error %d\n", ubi->ubi_num, "ubi_io_mark_bad", pnum, err); } } else { } return (err); } } static int validate_ec_hdr(struct ubi_device const *ubi , struct ubi_ec_hdr const *ec_hdr ) { long long ec ; int vid_hdr_offset ; int leb_start ; __u64 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; { { tmp = __fswab64(ec_hdr->ec); ec = (long long )tmp; tmp___0 = __fswab32(ec_hdr->vid_hdr_offset); vid_hdr_offset = (int )tmp___0; tmp___1 = __fswab32(ec_hdr->data_offset); leb_start = (int )tmp___1; } if ((unsigned int )((unsigned char )ec_hdr->version) != 1U) { { printk("\vubi%d error: %s: node with incompatible UBI version found: this UBI version is %d, image version is %d\n", ubi->ubi_num, "validate_ec_hdr", 1, (int )ec_hdr->version); } goto bad; } else { } if (vid_hdr_offset != (int )ubi->vid_hdr_offset) { { printk("\vubi%d error: %s: bad VID header offset %d, expected %d\n", ubi->ubi_num, "validate_ec_hdr", vid_hdr_offset, ubi->vid_hdr_offset); } goto bad; } else { } if (leb_start != (int )ubi->leb_start) { { printk("\vubi%d error: %s: bad data offset %d, expected %d\n", ubi->ubi_num, "validate_ec_hdr", leb_start, ubi->leb_start); } goto bad; } else { } if ((unsigned long )ec > 2147483647UL) { { printk("\vubi%d error: %s: bad erase counter %lld\n", ubi->ubi_num, "validate_ec_hdr", ec); } goto bad; } else { } return (0); bad: { printk("\vubi%d error: %s: bad EC header\n", ubi->ubi_num, "validate_ec_hdr"); ubi_dump_ec_hdr(ec_hdr); dump_stack(); } return (1); } } int ubi_io_read_ec_hdr(struct ubi_device *ubi , int pnum , struct ubi_ec_hdr *ec_hdr , int verbose ) { int err ; int read_err ; uint32_t crc ; uint32_t magic ; uint32_t hdr_crc ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; __u32 tmp___5 ; int tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; int tmp___9 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___10 ; long tmp___11 ; __u32 tmp___12 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___13 ; long tmp___14 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_io_read_ec_hdr"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): read EC header from PEB %d\n"; descriptor.lineno = 738U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): read EC header from PEB %d\n", tmp->pid, pnum); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read_ec_hdr", 739, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read_ec_hdr", 739, tmp___1->pid); dump_stack(); } } else { } } { read_err = ubi_io_read((struct ubi_device const *)ubi, (void *)ec_hdr, pnum, 0, 64); } if (read_err != 0) { if (read_err != 5) { { tmp___4 = mtd_is_eccerr(read_err); } if (tmp___4 == 0) { return (read_err); } else { } } else { } } else { } { tmp___5 = __fswab32(ec_hdr->magic); magic = tmp___5; } if (magic != 1430407459U) { { tmp___6 = mtd_is_eccerr(read_err); } if (tmp___6 != 0) { return (4); } else { } { tmp___9 = ubi_check_pattern((void const *)ec_hdr, 255, 64); } if (tmp___9 != 0) { if (verbose != 0) { { printk("\fubi%d warning: %s: no EC header found at PEB %d, only 0xFF bytes\n", ubi->ubi_num, "ubi_io_read_ec_hdr", pnum); } } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_io_read_ec_hdr"; descriptor___0.filename = "drivers/mtd/ubi/io.c"; descriptor___0.format = "UBI DBG bld (pid %d): no EC header found at PEB %d, only 0xFF bytes\n"; descriptor___0.lineno = 773U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___6(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): no EC header found at PEB %d, only 0xFF bytes\n", tmp___7->pid, pnum); } } else { } if (read_err == 0) { return (1); } else { return (2); } } else { } if (verbose != 0) { { printk("\fubi%d warning: %s: bad magic number at PEB %d: %08x instead of %08x\n", ubi->ubi_num, "ubi_io_read_ec_hdr", pnum, magic, 1430407459); ubi_dump_ec_hdr((struct ubi_ec_hdr const *)ec_hdr); } } else { } { descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_io_read_ec_hdr"; descriptor___1.filename = "drivers/mtd/ubi/io.c"; descriptor___1.format = "UBI DBG bld (pid %d): bad magic number at PEB %d: %08x instead of %08x\n"; descriptor___1.lineno = 790U; descriptor___1.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___11 != 0L) { { tmp___10 = get_current___6(); __dynamic_pr_debug(& descriptor___1, "UBI DBG bld (pid %d): bad magic number at PEB %d: %08x instead of %08x\n", tmp___10->pid, pnum, magic, 1430407459); } } else { } return (3); } else { } { crc = crc32_le(4294967295U, (unsigned char const *)ec_hdr, 60UL); tmp___12 = __fswab32(ec_hdr->hdr_crc); hdr_crc = tmp___12; } if (hdr_crc != crc) { if (verbose != 0) { { printk("\fubi%d warning: %s: bad EC header CRC at PEB %d, calculated %#08x, read %#08x\n", ubi->ubi_num, "ubi_io_read_ec_hdr", pnum, crc, hdr_crc); ubi_dump_ec_hdr((struct ubi_ec_hdr const *)ec_hdr); } } else { } { descriptor___2.modname = "ubi"; descriptor___2.function = "ubi_io_read_ec_hdr"; descriptor___2.filename = "drivers/mtd/ubi/io.c"; descriptor___2.format = "UBI DBG bld (pid %d): bad EC header CRC at PEB %d, calculated %#08x, read %#08x\n"; descriptor___2.lineno = 804U; descriptor___2.flags = 0U; tmp___14 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); } if (tmp___14 != 0L) { { tmp___13 = get_current___6(); __dynamic_pr_debug(& descriptor___2, "UBI DBG bld (pid %d): bad EC header CRC at PEB %d, calculated %#08x, read %#08x\n", tmp___13->pid, pnum, crc, hdr_crc); } } else { } if (read_err == 0) { return (3); } else { return (4); } } else { } { err = validate_ec_hdr((struct ubi_device const *)ubi, (struct ubi_ec_hdr const *)ec_hdr); } if (err != 0) { { printk("\vubi%d error: %s: validation failed for PEB %d\n", ubi->ubi_num, "ubi_io_read_ec_hdr", pnum); } return (-22); } else { } return (read_err != 0 ? 5 : 0); } } int ubi_io_write_ec_hdr(struct ubi_device *ubi , int pnum , struct ubi_ec_hdr *ec_hdr ) { int err ; uint32_t crc ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_io_write_ec_hdr"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): write EC header to PEB %d\n"; descriptor.lineno = 847U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): write EC header to PEB %d\n", tmp->pid, pnum); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write_ec_hdr", 848, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write_ec_hdr", 848, tmp___1->pid); dump_stack(); } } else { } } { ec_hdr->magic = 592003669U; ec_hdr->version = 1U; tmp___4 = __fswab32((__u32 )ubi->vid_hdr_offset); ec_hdr->vid_hdr_offset = tmp___4; tmp___5 = __fswab32((__u32 )ubi->leb_start); ec_hdr->data_offset = tmp___5; tmp___6 = __fswab32((__u32 )ubi->image_seq); ec_hdr->image_seq = tmp___6; crc = crc32_le(4294967295U, (unsigned char const *)ec_hdr, 60UL); tmp___7 = __fswab32(crc); ec_hdr->hdr_crc = tmp___7; err = self_check_ec_hdr((struct ubi_device const *)ubi, pnum, (struct ubi_ec_hdr const *)ec_hdr); } if (err != 0) { return (err); } else { } { err = ubi_io_write(ubi, (void const *)ec_hdr, pnum, 0, ubi->ec_hdr_alsize); } return (err); } } static int validate_vid_hdr(struct ubi_device const *ubi , struct ubi_vid_hdr const *vid_hdr ) { int vol_type ; int copy_flag ; int vol_id ; __u32 tmp ; int lnum ; __u32 tmp___0 ; int compat ; int data_size ; __u32 tmp___1 ; int used_ebs ; __u32 tmp___2 ; int data_pad ; __u32 tmp___3 ; int data_crc ; __u32 tmp___4 ; int usable_leb_size ; { { vol_type = (int )vid_hdr->vol_type; copy_flag = (int )vid_hdr->copy_flag; tmp = __fswab32(vid_hdr->vol_id); vol_id = (int )tmp; tmp___0 = __fswab32(vid_hdr->lnum); lnum = (int )tmp___0; compat = (int )vid_hdr->compat; tmp___1 = __fswab32(vid_hdr->data_size); data_size = (int )tmp___1; tmp___2 = __fswab32(vid_hdr->used_ebs); used_ebs = (int )tmp___2; tmp___3 = __fswab32(vid_hdr->data_pad); data_pad = (int )tmp___3; tmp___4 = __fswab32(vid_hdr->data_crc); data_crc = (int )tmp___4; usable_leb_size = (int )ubi->leb_size - data_pad; } if ((unsigned int )copy_flag > 1U) { { printk("\vubi%d error: %s: bad copy_flag\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (((vol_id < 0 || lnum < 0) || (data_size < 0 || used_ebs < 0)) || data_pad < 0) { { printk("\vubi%d error: %s: negative values\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if ((unsigned int )vol_id - 128U <= 2147479422U) { { printk("\vubi%d error: %s: bad vol_id\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (vol_id <= 2147479550 && compat != 0) { { printk("\vubi%d error: %s: bad compat\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (((vol_id > 2147479550 && compat != 1) && (compat != 2 && compat != 4)) && compat != 5) { { printk("\vubi%d error: %s: bad compat\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if ((unsigned int )vol_type - 1U > 1U) { { printk("\vubi%d error: %s: bad vol_type\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (data_pad >= (int )ubi->leb_size / 2) { { printk("\vubi%d error: %s: bad data_pad\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (vol_type == 2) { if (used_ebs == 0) { { printk("\vubi%d error: %s: zero used_ebs\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (data_size == 0) { { printk("\vubi%d error: %s: zero data_size\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (lnum < used_ebs + -1) { if (data_size != usable_leb_size) { { printk("\vubi%d error: %s: bad data_size\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } } else if (lnum == used_ebs + -1) { if (data_size == 0) { { printk("\vubi%d error: %s: bad data_size at last LEB\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } } else { { printk("\vubi%d error: %s: too high lnum\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } } else { if (copy_flag == 0) { if (data_crc != 0) { { printk("\vubi%d error: %s: non-zero data CRC\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (data_size != 0) { { printk("\vubi%d error: %s: non-zero data_size\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } } else if (data_size == 0) { { printk("\vubi%d error: %s: zero data_size of copy\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (used_ebs != 0) { { printk("\vubi%d error: %s: bad used_ebs\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } } return (0); bad: { printk("\vubi%d error: %s: bad VID header\n", ubi->ubi_num, "validate_vid_hdr"); ubi_dump_vid_hdr(vid_hdr); dump_stack(); } return (1); } } int ubi_io_read_vid_hdr(struct ubi_device *ubi , int pnum , struct ubi_vid_hdr *vid_hdr , int verbose ) { int err ; int read_err ; uint32_t crc ; uint32_t magic ; uint32_t hdr_crc ; void *p ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; __u32 tmp___5 ; int tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; int tmp___9 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___10 ; long tmp___11 ; __u32 tmp___12 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___13 ; long tmp___14 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_io_read_vid_hdr"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): read VID header from PEB %d\n"; descriptor.lineno = 1009U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): read VID header from PEB %d\n", tmp->pid, pnum); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read_vid_hdr", 1010, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read_vid_hdr", 1010, tmp___1->pid); dump_stack(); } } else { } } { p = (void *)vid_hdr + - ((unsigned long )ubi->vid_hdr_shift); read_err = ubi_io_read((struct ubi_device const *)ubi, p, pnum, ubi->vid_hdr_aloffset, ubi->vid_hdr_alsize); } if (read_err != 0 && read_err != 5) { { tmp___4 = mtd_is_eccerr(read_err); } if (tmp___4 == 0) { return (read_err); } else { } } else { } { tmp___5 = __fswab32(vid_hdr->magic); magic = tmp___5; } if (magic != 1430407457U) { { tmp___6 = mtd_is_eccerr(read_err); } if (tmp___6 != 0) { return (4); } else { } { tmp___9 = ubi_check_pattern((void const *)vid_hdr, 255, 64); } if (tmp___9 != 0) { if (verbose != 0) { { printk("\fubi%d warning: %s: no VID header found at PEB %d, only 0xFF bytes\n", ubi->ubi_num, "ubi_io_read_vid_hdr", pnum); } } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_io_read_vid_hdr"; descriptor___0.filename = "drivers/mtd/ubi/io.c"; descriptor___0.format = "UBI DBG bld (pid %d): no VID header found at PEB %d, only 0xFF bytes\n"; descriptor___0.lineno = 1028U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___6(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): no VID header found at PEB %d, only 0xFF bytes\n", tmp___7->pid, pnum); } } else { } if (read_err == 0) { return (1); } else { return (2); } } else { } if (verbose != 0) { { printk("\fubi%d warning: %s: bad magic number at PEB %d: %08x instead of %08x\n", ubi->ubi_num, "ubi_io_read_vid_hdr", pnum, magic, 1430407457); ubi_dump_vid_hdr((struct ubi_vid_hdr const *)vid_hdr); } } else { } { descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_io_read_vid_hdr"; descriptor___1.filename = "drivers/mtd/ubi/io.c"; descriptor___1.format = "UBI DBG bld (pid %d): bad magic number at PEB %d: %08x instead of %08x\n"; descriptor___1.lineno = 1041U; descriptor___1.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___11 != 0L) { { tmp___10 = get_current___6(); __dynamic_pr_debug(& descriptor___1, "UBI DBG bld (pid %d): bad magic number at PEB %d: %08x instead of %08x\n", tmp___10->pid, pnum, magic, 1430407457); } } else { } return (3); } else { } { crc = crc32_le(4294967295U, (unsigned char const *)vid_hdr, 60UL); tmp___12 = __fswab32(vid_hdr->hdr_crc); hdr_crc = tmp___12; } if (hdr_crc != crc) { if (verbose != 0) { { printk("\fubi%d warning: %s: bad CRC at PEB %d, calculated %#08x, read %#08x\n", ubi->ubi_num, "ubi_io_read_vid_hdr", pnum, crc, hdr_crc); ubi_dump_vid_hdr((struct ubi_vid_hdr const *)vid_hdr); } } else { } { descriptor___2.modname = "ubi"; descriptor___2.function = "ubi_io_read_vid_hdr"; descriptor___2.filename = "drivers/mtd/ubi/io.c"; descriptor___2.format = "UBI DBG bld (pid %d): bad CRC at PEB %d, calculated %#08x, read %#08x\n"; descriptor___2.lineno = 1055U; descriptor___2.flags = 0U; tmp___14 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); } if (tmp___14 != 0L) { { tmp___13 = get_current___6(); __dynamic_pr_debug(& descriptor___2, "UBI DBG bld (pid %d): bad CRC at PEB %d, calculated %#08x, read %#08x\n", tmp___13->pid, pnum, crc, hdr_crc); } } else { } if (read_err == 0) { return (3); } else { return (4); } } else { } { err = validate_vid_hdr((struct ubi_device const *)ubi, (struct ubi_vid_hdr const *)vid_hdr); } if (err != 0) { { printk("\vubi%d error: %s: validation failed for PEB %d\n", ubi->ubi_num, "ubi_io_read_vid_hdr", pnum); } return (-22); } else { } return (read_err != 0 ? 5 : 0); } } int ubi_io_write_vid_hdr(struct ubi_device *ubi , int pnum , struct ubi_vid_hdr *vid_hdr ) { int err ; uint32_t crc ; void *p ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; __u32 tmp___4 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_io_write_vid_hdr"; descriptor.filename = "drivers/mtd/ubi/io.c"; descriptor.format = "UBI DBG io (pid %d): write VID header to PEB %d\n"; descriptor.lineno = 1093U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___6(); __dynamic_pr_debug(& descriptor, "UBI DBG io (pid %d): write VID header to PEB %d\n", tmp->pid, pnum); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write_vid_hdr", 1094, tmp___1->pid); dump_stack(); } } else { { tmp___3 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___6(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_write_vid_hdr", 1094, tmp___1->pid); dump_stack(); } } else { } } { err = self_check_peb_ec_hdr((struct ubi_device const *)ubi, pnum); } if (err != 0) { return (err); } else { } { vid_hdr->magic = 558449237U; vid_hdr->version = 1U; crc = crc32_le(4294967295U, (unsigned char const *)vid_hdr, 60UL); tmp___4 = __fswab32(crc); vid_hdr->hdr_crc = tmp___4; err = self_check_vid_hdr((struct ubi_device const *)ubi, pnum, (struct ubi_vid_hdr const *)vid_hdr); } if (err != 0) { return (err); } else { } { p = (void *)vid_hdr + - ((unsigned long )ubi->vid_hdr_shift); err = ubi_io_write(ubi, (void const *)p, pnum, ubi->vid_hdr_aloffset, ubi->vid_hdr_alsize); } return (err); } } static int self_check_not_bad(struct ubi_device const *ubi , int pnum ) { int err ; int tmp ; { { tmp = ubi_dbg_chk_io(ubi); } if (tmp == 0) { return (0); } else { } { err = ubi_io_is_bad(ubi, pnum); } if (err == 0) { return (err); } else { } { printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "self_check_not_bad", pnum); dump_stack(); } return (err <= 0 ? err : -22); } } static int self_check_ec_hdr(struct ubi_device const *ubi , int pnum , struct ubi_ec_hdr const *ec_hdr ) { int err ; uint32_t magic ; int tmp ; __u32 tmp___0 ; { { tmp = ubi_dbg_chk_io(ubi); } if (tmp == 0) { return (0); } else { } { tmp___0 = __fswab32(ec_hdr->magic); magic = tmp___0; } if (magic != 1430407459U) { { printk("\vubi%d error: %s: bad magic %#08x, must be %#08x\n", ubi->ubi_num, "self_check_ec_hdr", magic, 1430407459); } goto fail; } else { } { err = validate_ec_hdr(ubi, ec_hdr); } if (err != 0) { { printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "self_check_ec_hdr", pnum); } goto fail; } else { } return (0); fail: { ubi_dump_ec_hdr(ec_hdr); dump_stack(); } return (-22); } } static int self_check_peb_ec_hdr(struct ubi_device const *ubi , int pnum ) { int err ; uint32_t crc ; uint32_t hdr_crc ; struct ubi_ec_hdr *ec_hdr ; int tmp ; void *tmp___0 ; int tmp___1 ; __u32 tmp___2 ; { { tmp = ubi_dbg_chk_io(ubi); } if (tmp == 0) { return (0); } else { } { tmp___0 = kzalloc((size_t )ubi->ec_hdr_alsize, 80U); ec_hdr = (struct ubi_ec_hdr *)tmp___0; } if ((unsigned long )ec_hdr == (unsigned long )((struct ubi_ec_hdr *)0)) { return (-12); } else { } { err = ubi_io_read(ubi, (void *)ec_hdr, pnum, 0, 64); } if (err != 0 && err != 5) { { tmp___1 = mtd_is_eccerr(err); } if (tmp___1 == 0) { goto exit; } else { } } else { } { crc = crc32_le(4294967295U, (unsigned char const *)ec_hdr, 60UL); tmp___2 = __fswab32(ec_hdr->hdr_crc); hdr_crc = tmp___2; } if (hdr_crc != crc) { { printk("\vubi%d error: %s: bad CRC, calculated %#08x, read %#08x\n", ubi->ubi_num, "self_check_peb_ec_hdr", crc, hdr_crc); printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "self_check_peb_ec_hdr", pnum); ubi_dump_ec_hdr((struct ubi_ec_hdr const *)ec_hdr); dump_stack(); err = -22; } goto exit; } else { } { err = self_check_ec_hdr(ubi, pnum, (struct ubi_ec_hdr const *)ec_hdr); } exit: { kfree((void const *)ec_hdr); } return (err); } } static int self_check_vid_hdr(struct ubi_device const *ubi , int pnum , struct ubi_vid_hdr const *vid_hdr ) { int err ; uint32_t magic ; int tmp ; __u32 tmp___0 ; { { tmp = ubi_dbg_chk_io(ubi); } if (tmp == 0) { return (0); } else { } { tmp___0 = __fswab32(vid_hdr->magic); magic = tmp___0; } if (magic != 1430407457U) { { printk("\vubi%d error: %s: bad VID header magic %#08x at PEB %d, must be %#08x\n", ubi->ubi_num, "self_check_vid_hdr", magic, pnum, 1430407457); } goto fail; } else { } { err = validate_vid_hdr(ubi, vid_hdr); } if (err != 0) { { printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "self_check_vid_hdr", pnum); } goto fail; } else { } return (err); fail: { printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "self_check_vid_hdr", pnum); ubi_dump_vid_hdr(vid_hdr); dump_stack(); } return (-22); } } static int self_check_peb_vid_hdr(struct ubi_device const *ubi , int pnum ) { int err ; uint32_t crc ; uint32_t hdr_crc ; struct ubi_vid_hdr *vid_hdr ; void *p ; int tmp ; int tmp___0 ; __u32 tmp___1 ; { { tmp = ubi_dbg_chk_io(ubi); } if (tmp == 0) { return (0); } else { } { vid_hdr = ubi_zalloc_vid_hdr___1(ubi, 80U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } { p = (void *)vid_hdr + - ((unsigned long )ubi->vid_hdr_shift); err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset, ubi->vid_hdr_alsize); } if (err != 0 && err != 5) { { tmp___0 = mtd_is_eccerr(err); } if (tmp___0 == 0) { goto exit; } else { } } else { } { crc = crc32_le(4294967295U, (unsigned char const *)vid_hdr, 60UL); tmp___1 = __fswab32(vid_hdr->hdr_crc); hdr_crc = tmp___1; } if (hdr_crc != crc) { { printk("\vubi%d error: %s: bad VID header CRC at PEB %d, calculated %#08x, read %#08x\n", ubi->ubi_num, "self_check_peb_vid_hdr", pnum, crc, hdr_crc); printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "self_check_peb_vid_hdr", pnum); ubi_dump_vid_hdr((struct ubi_vid_hdr const *)vid_hdr); dump_stack(); err = -22; } goto exit; } else { } { err = self_check_vid_hdr(ubi, pnum, (struct ubi_vid_hdr const *)vid_hdr); } exit: { ubi_free_vid_hdr(ubi, vid_hdr); } return (err); } } static int self_check_write(struct ubi_device *ubi , void const *buf , int pnum , int offset , int len ) { int err ; int i ; size_t read ; void *buf1 ; loff_t addr ; int tmp ; pgprot_t __constr_expr_0 ; int tmp___0 ; uint8_t c ; uint8_t c1 ; int dump_len ; int __max1 ; int __max2 ; { { addr = (long long )pnum * (long long )ubi->peb_size + (long long )offset; tmp = ubi_dbg_chk_io((struct ubi_device const *)ubi); } if (tmp == 0) { return (0); } else { } { __constr_expr_0.pgprot = 0x8000000000000163UL; buf1 = __vmalloc((unsigned long )len, 80U, __constr_expr_0); } if ((unsigned long )buf1 == (unsigned long )((void *)0)) { { printk("\vubi%d error: %s: cannot allocate memory to check writes\n", ubi->ubi_num, "self_check_write"); } return (0); } else { } { err = mtd_read(ubi->mtd, addr, (size_t )len, & read, (u_char *)buf1); } if (err != 0) { { tmp___0 = mtd_is_bitflip(err); } if (tmp___0 == 0) { goto out_free; } else { } } else { } i = 0; goto ldv_31676; ldv_31675: c = *((uint8_t *)buf + (unsigned long )i); c1 = *((uint8_t *)buf1 + (unsigned long )i); if ((int )c == (int )c1) { goto ldv_31671; } else { } { printk("\vubi%d error: %s: self-check failed for PEB %d:%d, len %d\n", ubi->ubi_num, "self_check_write", pnum, offset, len); printk("\rubi%d: data differ at position %d\n", ubi->ubi_num, i); __max1 = 128; __max2 = len - i; dump_len = __max1 > __max2 ? __max1 : __max2; printk("\rubi%d: hex dump of the original buffer from %d to %d\n", ubi->ubi_num, i, i + dump_len); print_hex_dump("\017", "", 2, 32, 1, buf + (unsigned long )i, (size_t )dump_len, 1); printk("\rubi%d: hex dump of the read buffer from %d to %d\n", ubi->ubi_num, i, i + dump_len); print_hex_dump("\017", "", 2, 32, 1, (void const *)buf1 + (unsigned long )i, (size_t )dump_len, 1); dump_stack(); err = -22; } goto out_free; ldv_31671: i = i + 1; ldv_31676: ; if (i < len) { goto ldv_31675; } else { } { vfree((void const *)buf1); } return (0); out_free: { vfree((void const *)buf1); } return (err); } } int ubi_self_check_all_ff(struct ubi_device *ubi , int pnum , int offset , int len ) { size_t read ; int err ; void *buf ; loff_t addr ; int tmp ; pgprot_t __constr_expr_0 ; int tmp___0 ; { { addr = (long long )pnum * (long long )ubi->peb_size + (long long )offset; tmp = ubi_dbg_chk_io((struct ubi_device const *)ubi); } if (tmp == 0) { return (0); } else { } { __constr_expr_0.pgprot = 0x8000000000000163UL; buf = __vmalloc((unsigned long )len, 80U, __constr_expr_0); } if ((unsigned long )buf == (unsigned long )((void *)0)) { { printk("\vubi%d error: %s: cannot allocate memory to check for 0xFFs\n", ubi->ubi_num, "ubi_self_check_all_ff"); } return (0); } else { } { err = mtd_read(ubi->mtd, addr, (size_t )len, & read, (u_char *)buf); } if (err != 0) { { tmp___0 = mtd_is_bitflip(err); } if (tmp___0 == 0) { { printk("\vubi%d error: %s: err %d while reading %d bytes from PEB %d:%d, read %zd bytes\n", ubi->ubi_num, "ubi_self_check_all_ff", err, len, pnum, offset, read); } goto error; } else { } } else { } { err = ubi_check_pattern((void const *)buf, 255, len); } if (err == 0) { { printk("\vubi%d error: %s: flash region at PEB %d:%d, length %d does not contain all 0xFF bytes\n", ubi->ubi_num, "ubi_self_check_all_ff", pnum, offset, len); } goto fail; } else { } { vfree((void const *)buf); } return (0); fail: { printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "ubi_self_check_all_ff", pnum); printk("\rubi%d: hex dump of the %d-%d region\n", ubi->ubi_num, offset, offset + len); print_hex_dump("\017", "", 2, 32, 1, (void const *)buf, (size_t )len, 1); err = -22; } error: { dump_stack(); vfree((void const *)buf); } return (err); } } static void ldv_mutex_lock_95___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_96___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_113___1(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_147(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_move_mutex_of_ubi_device(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_move_mutex_of_ubi_device(struct mutex *lock ) ; extern void __xchg_wrong_size(void) ; __inline static int atomic_read(atomic_t const *v ) { int __var ; { __var = 0; return ((int )*((int const volatile *)(& v->counter))); } } extern void debug_check_no_locks_held(void) ; extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; static void ldv_mutex_unlock_118(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_121___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_124(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_126(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_148(struct mutex *ldv_func_arg1 ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; extern struct rb_node *rb_last(struct rb_root const * ) ; extern void __init_work(struct work_struct * , int ) ; extern struct workqueue_struct *system_wq ; extern bool queue_work_on(int , struct workqueue_struct * , struct work_struct * ) ; __inline static bool queue_work(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { { tmp = queue_work_on(8192, wq, work); } return (tmp); } } __inline static bool schedule_work(struct work_struct *work ) { bool tmp ; { { tmp = queue_work(system_wq, work); } return (tmp); } } __inline static pid_t task_pid_nr(struct task_struct *tsk ) { { return (tsk->pid); } } static void *ldv_kmem_cache_alloc_166(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_167(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_168(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; extern atomic_t system_freezing_cnt ; extern bool freezing_slow_path(struct task_struct * ) ; __inline static bool freezing(struct task_struct *p ) { int tmp ; long tmp___0 ; bool tmp___1 ; { { tmp = atomic_read((atomic_t const *)(& system_freezing_cnt)); tmp___0 = ldv__builtin_expect(tmp == 0, 1L); } if (tmp___0 != 0L) { return (0); } else { } { tmp___1 = freezing_slow_path(p); } return (tmp___1); } } extern bool __refrigerator(bool ) ; __inline static bool try_to_freeze_unsafe(void) { struct task_struct *tmp ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; bool tmp___3 ; { { __might_sleep("include/linux/freezer.h", 56, 0); tmp = get_current___1(); tmp___0 = freezing(tmp); } if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } { tmp___2 = ldv__builtin_expect((long )tmp___1, 1L); } if (tmp___2 != 0L) { return (0); } else { } { tmp___3 = __refrigerator(0); } return (tmp___3); } } __inline static bool try_to_freeze(void) { struct task_struct *tmp ; bool tmp___0 ; { { tmp = get_current___1(); } if ((tmp->flags & 32768U) == 0U) { { debug_check_no_locks_held(); } } else { } { tmp___0 = try_to_freeze_unsafe(); } return (tmp___0); } } extern bool set_freezable(void) ; extern bool kthread_should_stop(void) ; __inline static int ubi_dbg_is_bgt_disabled(struct ubi_device const *ubi ) { { return ((int )ubi->dbg.disable_bgt); } } int ubi_wl_init(struct ubi_device *ubi , struct ubi_attach_info *ai ) ; struct ubi_wl_entry *ubi_wl_get_fm_peb(struct ubi_device *ubi , int anchor ) ; int ubi_wl_put_fm_peb(struct ubi_device *ubi , struct ubi_wl_entry *fm_e , int lnum , int torture ) ; int ubi_is_erase_work(struct ubi_work *wrk ) ; void ubi_refill_pools(struct ubi_device *ubi ) ; int ubi_ensure_anchor_pebs(struct ubi_device *ubi ) ; __inline static struct ubi_vid_hdr *ubi_zalloc_vid_hdr___2(struct ubi_device const *ubi , gfp_t gfp_flags ) { void *vid_hdr ; { { vid_hdr = kzalloc((size_t )ubi->vid_hdr_alsize, gfp_flags); } if ((unsigned long )vid_hdr == (unsigned long )((void *)0)) { return ((struct ubi_vid_hdr *)0); } else { } return ((struct ubi_vid_hdr *)vid_hdr + (unsigned long )ubi->vid_hdr_shift); } } static int self_check_ec(struct ubi_device *ubi , int pnum , int ec ) ; static int self_check_in_wl_tree(struct ubi_device const *ubi , struct ubi_wl_entry *e , struct rb_root *root ) ; static int self_check_in_pq(struct ubi_device const *ubi , struct ubi_wl_entry *e ) ; static void update_fastmap_work_fn(struct work_struct *wrk ) { struct ubi_device *ubi ; struct work_struct const *__mptr ; { { __mptr = (struct work_struct const *)wrk; ubi = (struct ubi_device *)__mptr + 0xffffffffffffe980UL; ubi_update_fastmap(ubi); } return; } } static int ubi_is_fm_block(struct ubi_device *ubi , int pnum ) { int i ; { if ((unsigned long )ubi->fm == (unsigned long )((struct ubi_fastmap_layout *)0)) { return (0); } else { } i = 0; goto ldv_31925; ldv_31924: ; if (((ubi->fm)->e[i])->pnum == pnum) { return (1); } else { } i = i + 1; ldv_31925: ; if (i < (ubi->fm)->used_blocks) { goto ldv_31924; } else { } return (0); } } static void wl_tree_add(struct ubi_wl_entry *e , struct rb_root *root ) { struct rb_node **p ; struct rb_node *parent ; struct ubi_wl_entry *e1 ; struct rb_node const *__mptr ; struct task_struct *tmp ; long tmp___0 ; { parent = (struct rb_node *)0; p = & root->rb_node; goto ldv_31938; ldv_31937: parent = *p; __mptr = (struct rb_node const *)parent; e1 = (struct ubi_wl_entry *)__mptr; if (e->ec < e1->ec) { p = & (*p)->rb_left; } else if (e->ec > e1->ec) { p = & (*p)->rb_right; } else { { tmp___0 = ldv__builtin_expect(e->pnum == e1->pnum, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "wl_tree_add", 203, tmp->pid); dump_stack(); } } else { } if (e->pnum < e1->pnum) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } } ldv_31938: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31937; } else { } { rb_link_node(& e->u.rb, parent, p); rb_insert_color(& e->u.rb, root); } return; } } static int do_work(struct ubi_device *ubi ) { int err ; struct ubi_work *wrk ; int tmp ; struct list_head const *__mptr ; struct task_struct *tmp___0 ; long tmp___1 ; { { ___might_sleep("drivers/mtd/ubi/wl.c", 227, 0); _cond_resched(); down_read(& ubi->work_sem); ldv_spin_lock_114(& ubi->wl_lock); tmp = list_empty((struct list_head const *)(& ubi->works)); } if (tmp != 0) { { ldv_spin_unlock_115(& ubi->wl_lock); up_read(& ubi->work_sem); } return (0); } else { } { __mptr = (struct list_head const *)ubi->works.next; wrk = (struct ubi_work *)__mptr; list_del(& wrk->list); ubi->works_count = ubi->works_count + -1; tmp___1 = ldv__builtin_expect(ubi->works_count < 0, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "do_work", 246, tmp___0->pid); dump_stack(); } } else { } { ldv_spin_unlock_115(& ubi->wl_lock); err = (*(wrk->func))(ubi, wrk, 0); } if (err != 0) { { printk("\vubi%d error: %s: work failed with error code %d\n", ubi->ubi_num, "do_work", err); } } else { } { up_read(& ubi->work_sem); } return (err); } } static int produce_free_peb(struct ubi_device *ubi ) { int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { goto ldv_31956; ldv_31955: { ldv_spin_unlock_115(& ubi->wl_lock); descriptor.modname = "ubi"; descriptor.function = "produce_free_peb"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): do one work synchronously\n"; descriptor.lineno = 278U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): do one work synchronously\n", tmp->pid); } } else { } { err = do_work(ubi); ldv_spin_lock_114(& ubi->wl_lock); } if (err != 0) { return (err); } else { } ldv_31956: ; if ((unsigned long )ubi->free.rb_node == (unsigned long )((struct rb_node *)0) && ubi->works_count != 0) { goto ldv_31955; } else { } return (0); } } static int in_wl_tree(struct ubi_wl_entry *e , struct rb_root *root ) { struct rb_node *p ; struct ubi_wl_entry *e1 ; struct rb_node const *__mptr ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { p = root->rb_node; goto ldv_31968; ldv_31967: __mptr = (struct rb_node const *)p; e1 = (struct ubi_wl_entry *)__mptr; if (e->pnum == e1->pnum) { { tmp___0 = ldv__builtin_expect((unsigned long )e != (unsigned long )e1, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "in_wl_tree", 308, tmp->pid); dump_stack(); } } else { } return (1); } else { } if (e->ec < e1->ec) { p = p->rb_left; } else if (e->ec > e1->ec) { p = p->rb_right; } else { { tmp___2 = ldv__builtin_expect(e->pnum == e1->pnum, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "in_wl_tree", 317, tmp___1->pid); dump_stack(); } } else { } if (e->pnum < e1->pnum) { p = p->rb_left; } else { p = p->rb_right; } } ldv_31968: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_31967; } else { } return (0); } } static void prot_queue_add(struct ubi_device *ubi , struct ubi_wl_entry *e ) { int pq_tail ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { pq_tail = ubi->pq_head + -1; if (pq_tail < 0) { pq_tail = 9; } else { } { tmp___0 = ldv__builtin_expect((unsigned int )pq_tail > 9U, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "prot_queue_add", 344, tmp->pid); dump_stack(); } } else { } { list_add_tail(& e->u.list, (struct list_head *)(& ubi->pq) + (unsigned long )pq_tail); descriptor.modname = "ubi"; descriptor.function = "prot_queue_add"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): added PEB %d EC %d to the protection queue\n"; descriptor.lineno = 346U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): added PEB %d EC %d to the protection queue\n", tmp___1->pid, e->pnum, e->ec); } } else { } return; } } static struct ubi_wl_entry *find_wl_entry(struct ubi_device *ubi , struct rb_root *root , int diff ) { struct rb_node *p ; struct ubi_wl_entry *e ; struct ubi_wl_entry *prev_e ; int max ; struct rb_node const *__mptr ; struct rb_node *tmp ; struct ubi_wl_entry *e1 ; struct rb_node const *__mptr___0 ; { { prev_e = (struct ubi_wl_entry *)0; tmp = rb_first((struct rb_root const *)root); __mptr = (struct rb_node const *)tmp; e = (struct ubi_wl_entry *)__mptr; max = e->ec + diff; p = root->rb_node; } goto ldv_31992; ldv_31991: __mptr___0 = (struct rb_node const *)p; e1 = (struct ubi_wl_entry *)__mptr___0; if (e1->ec >= max) { p = p->rb_left; } else { p = p->rb_right; prev_e = e; e = e1; } ldv_31992: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_31991; } else { } if ((((unsigned long )prev_e != (unsigned long )((struct ubi_wl_entry *)0) && ubi->fm_disabled == 0) && (unsigned long )ubi->fm == (unsigned long )((struct ubi_fastmap_layout *)0)) && e->pnum <= 63) { return (prev_e); } else { } return (e); } } static struct ubi_wl_entry *find_mean_wl_entry(struct ubi_device *ubi , struct rb_root *root ) { struct ubi_wl_entry *e ; struct ubi_wl_entry *first ; struct ubi_wl_entry *last ; struct rb_node const *__mptr ; struct rb_node *tmp ; struct rb_node const *__mptr___0 ; struct rb_node *tmp___0 ; struct rb_node const *__mptr___1 ; struct rb_node const *__mptr___2 ; struct rb_node *tmp___1 ; { { tmp = rb_first((struct rb_root const *)root); __mptr = (struct rb_node const *)tmp; first = (struct ubi_wl_entry *)__mptr; tmp___0 = rb_last((struct rb_root const *)root); __mptr___0 = (struct rb_node const *)tmp___0; last = (struct ubi_wl_entry *)__mptr___0; } if (last->ec - first->ec <= 8191) { __mptr___1 = (struct rb_node const *)root->rb_node; e = (struct ubi_wl_entry *)__mptr___1; if ((((unsigned long )e != (unsigned long )((struct ubi_wl_entry *)0) && ubi->fm_disabled == 0) && (unsigned long )ubi->fm == (unsigned long )((struct ubi_fastmap_layout *)0)) && e->pnum <= 63) { { tmp___1 = rb_next((struct rb_node const *)root->rb_node); __mptr___2 = (struct rb_node const *)tmp___1; e = (struct ubi_wl_entry *)__mptr___2; } } else { } } else { { e = find_wl_entry(ubi, root, 4096); } } return (e); } } static struct ubi_wl_entry *find_anchor_wl_entry(struct rb_root *root ) { struct rb_node *p ; struct ubi_wl_entry *e ; struct ubi_wl_entry *victim ; int max_ec ; struct rb_node const *__mptr ; struct rb_node const *__mptr___0 ; { { victim = (struct ubi_wl_entry *)0; max_ec = 2147483647; p = rb_first((struct rb_root const *)root); } if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { __mptr = (struct rb_node const *)p; e = (struct ubi_wl_entry *)__mptr; } else { e = (struct ubi_wl_entry *)0; } goto ldv_32021; ldv_32020: ; if (e->pnum <= 63 && e->ec < max_ec) { victim = e; max_ec = e->ec; } else { } { p = rb_next((struct rb_node const *)p); } if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { __mptr___0 = (struct rb_node const *)p; e = (struct ubi_wl_entry *)__mptr___0; } else { e = (struct ubi_wl_entry *)0; } ldv_32021: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_32020; } else { } return (victim); } } static int anchor_pebs_avalible(struct rb_root *root ) { struct rb_node *p ; struct ubi_wl_entry *e ; struct rb_node const *__mptr ; struct rb_node const *__mptr___0 ; { { p = rb_first((struct rb_root const *)root); } if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { __mptr = (struct rb_node const *)p; e = (struct ubi_wl_entry *)__mptr; } else { e = (struct ubi_wl_entry *)0; } goto ldv_32033; ldv_32032: ; if (e->pnum <= 63) { return (1); } else { } { p = rb_next((struct rb_node const *)p); } if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { __mptr___0 = (struct rb_node const *)p; e = (struct ubi_wl_entry *)__mptr___0; } else { e = (struct ubi_wl_entry *)0; } ldv_32033: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_32032; } else { } return (0); } } struct ubi_wl_entry *ubi_wl_get_fm_peb(struct ubi_device *ubi , int anchor ) { struct ubi_wl_entry *e ; { e = (struct ubi_wl_entry *)0; if ((unsigned long )ubi->free.rb_node == (unsigned long )((struct rb_node *)0) || ubi->free_count - ubi->beb_rsvd_pebs <= 0) { goto out; } else { } if (anchor != 0) { { e = find_anchor_wl_entry(& ubi->free); } } else { { e = find_mean_wl_entry(ubi, & ubi->free); } } if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { goto out; } else { } { self_check_in_wl_tree((struct ubi_device const *)ubi, e, & ubi->free); rb_erase(& e->u.rb, & ubi->free); ubi->free_count = ubi->free_count - 1; } out: ; return (e); } } static int __wl_get_peb(struct ubi_device *ubi ) { int err ; struct ubi_wl_entry *e ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; { retry: ; if ((unsigned long )ubi->free.rb_node == (unsigned long )((struct rb_node *)0)) { if (ubi->works_count == 0) { { printk("\vubi%d error: %s: no free eraseblocks\n", ubi->ubi_num, "__wl_get_peb"); tmp___0 = list_empty((struct list_head const *)(& ubi->works)); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); } if (tmp___1 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "__wl_get_peb", 511, tmp->pid); dump_stack(); } } else { } return (-28); } else { } { err = produce_free_peb(ubi); } if (err < 0) { return (err); } else { } goto retry; } else { } { e = find_mean_wl_entry(ubi, & ubi->free); } if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { { printk("\vubi%d error: %s: no free eraseblocks\n", ubi->ubi_num, "__wl_get_peb"); } return (-28); } else { } { self_check_in_wl_tree((struct ubi_device const *)ubi, e, & ubi->free); rb_erase(& e->u.rb, & ubi->free); ubi->free_count = ubi->free_count - 1; descriptor.modname = "ubi"; descriptor.function = "__wl_get_peb"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): PEB %d EC %d\n"; descriptor.lineno = 535U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): PEB %d EC %d\n", tmp___2->pid, e->pnum, e->ec); } } else { } return (e->pnum); } } static void return_unused_pool_pebs(struct ubi_device *ubi , struct ubi_fm_pool *pool ) { int i ; struct ubi_wl_entry *e ; { i = pool->used; goto ldv_32056; ldv_32055: { e = *(ubi->lookuptbl + (unsigned long )pool->pebs[i]); wl_tree_add(e, & ubi->free); ubi->free_count = ubi->free_count + 1; i = i + 1; } ldv_32056: ; if (i < pool->size) { goto ldv_32055; } else { } return; } } static void refill_wl_pool(struct ubi_device *ubi ) { struct ubi_wl_entry *e ; struct ubi_fm_pool *pool ; { { pool = & ubi->fm_wl_pool; return_unused_pool_pebs(ubi, pool); pool->size = 0; } goto ldv_32065; ldv_32064: ; if ((unsigned long )ubi->free.rb_node == (unsigned long )((struct rb_node *)0) || ubi->free_count - ubi->beb_rsvd_pebs <= 4) { goto ldv_32063; } else { } { e = find_wl_entry(ubi, & ubi->free, 8192); self_check_in_wl_tree((struct ubi_device const *)ubi, e, & ubi->free); rb_erase(& e->u.rb, & ubi->free); ubi->free_count = ubi->free_count - 1; pool->pebs[pool->size] = e->pnum; pool->size = pool->size + 1; } ldv_32065: ; if (pool->size < pool->max_size) { goto ldv_32064; } else { } ldv_32063: pool->used = 0; return; } } static void refill_wl_user_pool(struct ubi_device *ubi ) { struct ubi_fm_pool *pool ; { { pool = & ubi->fm_pool; return_unused_pool_pebs(ubi, pool); pool->size = 0; } goto ldv_32072; ldv_32071: { pool->pebs[pool->size] = __wl_get_peb(ubi); } if (pool->pebs[pool->size] < 0) { goto ldv_32070; } else { } pool->size = pool->size + 1; ldv_32072: ; if (pool->size < pool->max_size) { goto ldv_32071; } else { } ldv_32070: pool->used = 0; return; } } void ubi_refill_pools(struct ubi_device *ubi ) { { { ldv_spin_lock_114(& ubi->wl_lock); refill_wl_pool(ubi); refill_wl_user_pool(ubi); ldv_spin_unlock_115(& ubi->wl_lock); } return; } } int ubi_wl_get_peb(struct ubi_device *ubi ) { int ret ; struct ubi_fm_pool *pool ; struct ubi_fm_pool *wl_pool ; int tmp ; { pool = & ubi->fm_pool; wl_pool = & ubi->fm_wl_pool; if (((pool->size == 0 || wl_pool->size == 0) || pool->used == pool->size) || wl_pool->used == wl_pool->size) { { ubi_update_fastmap(ubi); } } else { } if (pool->size == 0) { ret = -28; } else { { ldv_spin_lock_114(& ubi->wl_lock); tmp = pool->used; pool->used = pool->used + 1; ret = pool->pebs[tmp]; prot_queue_add(ubi, *(ubi->lookuptbl + (unsigned long )ret)); ldv_spin_unlock_115(& ubi->wl_lock); } } return (ret); } } static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi ) { struct ubi_fm_pool *pool ; int pnum ; int tmp ; { pool = & ubi->fm_wl_pool; if (pool->used == pool->size || pool->size == 0) { { schedule_work(& ubi->fm_work); } return ((struct ubi_wl_entry *)0); } else { tmp = pool->used; pool->used = pool->used + 1; pnum = pool->pebs[tmp]; return (*(ubi->lookuptbl + (unsigned long )pnum)); } } } static int prot_queue_del(struct ubi_device *ubi , int pnum ) { struct ubi_wl_entry *e ; int tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; { e = *(ubi->lookuptbl + (unsigned long )pnum); if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { return (-19); } else { } { tmp = self_check_in_pq((struct ubi_device const *)ubi, e); } if (tmp != 0) { return (-19); } else { } { list_del(& e->u.list); descriptor.modname = "ubi"; descriptor.function = "prot_queue_del"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): deleted PEB %d from the protection queue\n"; descriptor.lineno = 724U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): deleted PEB %d from the protection queue\n", tmp___0->pid, e->pnum); } } else { } return (0); } } static int sync_erase(struct ubi_device *ubi , struct ubi_wl_entry *e , int torture ) { int err ; struct ubi_ec_hdr *ec_hdr ; unsigned long long ec ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; __u64 tmp___4 ; { { ec = (unsigned long long )e->ec; descriptor.modname = "ubi"; descriptor.function = "sync_erase"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): erase PEB %d, old EC %llu\n"; descriptor.lineno = 744U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): erase PEB %d, old EC %llu\n", tmp->pid, e->pnum, ec); } } else { } { err = self_check_ec(ubi, e->pnum, e->ec); } if (err != 0) { return (-22); } else { } { tmp___1 = kzalloc((size_t )ubi->ec_hdr_alsize, 80U); ec_hdr = (struct ubi_ec_hdr *)tmp___1; } if ((unsigned long )ec_hdr == (unsigned long )((struct ubi_ec_hdr *)0)) { return (-12); } else { } { err = ubi_io_sync_erase(ubi, e->pnum, torture); } if (err < 0) { goto out_free; } else { } ec = ec + (unsigned long long )err; if (ec > 2147483647ULL) { { printk("\vubi%d error: %s: erase counter overflow at PEB %d, EC %llu\n", ubi->ubi_num, "sync_erase", e->pnum, ec); err = -22; } goto out_free; } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "sync_erase"; descriptor___0.filename = "drivers/mtd/ubi/wl.c"; descriptor___0.format = "UBI DBG wl (pid %d): erased PEB %d, new EC %llu\n"; descriptor___0.lineno = 770U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG wl (pid %d): erased PEB %d, new EC %llu\n", tmp___2->pid, e->pnum, ec); } } else { } { tmp___4 = __fswab64(ec); ec_hdr->ec = tmp___4; err = ubi_io_write_ec_hdr(ubi, e->pnum, ec_hdr); } if (err != 0) { goto out_free; } else { } { e->ec = (int )ec; ldv_spin_lock_114(& ubi->wl_lock); } if (e->ec > ubi->max_ec) { ubi->max_ec = e->ec; } else { } { ldv_spin_unlock_115(& ubi->wl_lock); } out_free: { kfree((void const *)ec_hdr); } return (err); } } static void serve_prot_queue(struct ubi_device *ubi ) { struct ubi_wl_entry *e ; struct ubi_wl_entry *tmp ; int count ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; struct list_head const *__mptr___1 ; struct task_struct *tmp___3 ; long tmp___4 ; { repeat: { count = 0; ldv_spin_lock_114(& ubi->wl_lock); __mptr = (struct list_head const *)((struct list_head *)(& ubi->pq) + (unsigned long )ubi->pq_head)->next; e = (struct ubi_wl_entry *)__mptr; __mptr___0 = (struct list_head const *)e->u.list.next; tmp = (struct ubi_wl_entry *)__mptr___0; } goto ldv_32123; ldv_32122: { descriptor.modname = "ubi"; descriptor.function = "serve_prot_queue"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): PEB %d EC %d protection over, move to used tree\n"; descriptor.lineno = 811U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): PEB %d EC %d protection over, move to used tree\n", tmp___0->pid, e->pnum, e->ec); } } else { } { list_del(& e->u.list); wl_tree_add(e, & ubi->used); tmp___2 = count; count = count + 1; } if (tmp___2 > 32) { { ldv_spin_unlock_115(& ubi->wl_lock); ___might_sleep("drivers/mtd/ubi/wl.c", 821, 0); _cond_resched(); } goto repeat; } else { } e = tmp; __mptr___1 = (struct list_head const *)tmp->u.list.next; tmp = (struct ubi_wl_entry *)__mptr___1; ldv_32123: ; if ((unsigned long )(& e->u.list) != (unsigned long )((struct list_head *)(& ubi->pq) + (unsigned long )ubi->pq_head)) { goto ldv_32122; } else { } ubi->pq_head = ubi->pq_head + 1; if (ubi->pq_head == 10) { ubi->pq_head = 0; } else { } { tmp___4 = ldv__builtin_expect((unsigned int )ubi->pq_head > 9U, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "serve_prot_queue", 829, tmp___3->pid); dump_stack(); } } else { } { ldv_spin_unlock_115(& ubi->wl_lock); } return; } } static void __schedule_ubi_work(struct ubi_device *ubi , struct ubi_work *wrk ) { struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { ldv_spin_lock_114(& ubi->wl_lock); list_add_tail(& wrk->list, & ubi->works); tmp___0 = ldv__builtin_expect(ubi->works_count < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "__schedule_ubi_work", 845, tmp->pid); dump_stack(); } } else { } ubi->works_count = ubi->works_count + 1; if (ubi->thread_enabled != 0) { { tmp___1 = ubi_dbg_is_bgt_disabled((struct ubi_device const *)ubi); } if (tmp___1 == 0) { { wake_up_process(ubi->bgt_thread); } } else { } } else { } { ldv_spin_unlock_115(& ubi->wl_lock); } return; } } static void schedule_ubi_work(struct ubi_device *ubi , struct ubi_work *wrk ) { { { down_read(& ubi->work_sem); __schedule_ubi_work(ubi, wrk); up_read(& ubi->work_sem); } return; } } static int erase_worker(struct ubi_device *ubi , struct ubi_work *wl_wrk , int shutdown ) ; int ubi_is_erase_work(struct ubi_work *wrk ) { { return ((unsigned long )wrk->func == (unsigned long )(& erase_worker)); } } static int schedule_erase(struct ubi_device *ubi , struct ubi_wl_entry *e , int vol_id , int lnum , int torture ) { struct ubi_work *wl_wrk ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; long tmp___3 ; struct _ddebug descriptor ; struct task_struct *tmp___4 ; long tmp___5 ; void *tmp___6 ; { { tmp___0 = ldv__builtin_expect((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0), 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "schedule_erase", 897, tmp->pid); dump_stack(); } } else { } { tmp___2 = ubi_is_fm_block(ubi, e->pnum); tmp___3 = ldv__builtin_expect(tmp___2 != 0, 0L); } if (tmp___3 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "schedule_erase", 898, tmp___1->pid); dump_stack(); } } else { } { descriptor.modname = "ubi"; descriptor.function = "schedule_erase"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): schedule erasure of PEB %d, EC %d, torture %d\n"; descriptor.lineno = 901U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___5 != 0L) { { tmp___4 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): schedule erasure of PEB %d, EC %d, torture %d\n", tmp___4->pid, e->pnum, e->ec, torture); } } else { } { tmp___6 = kmalloc(48UL, 80U); wl_wrk = (struct ubi_work *)tmp___6; } if ((unsigned long )wl_wrk == (unsigned long )((struct ubi_work *)0)) { return (-12); } else { } { wl_wrk->func = & erase_worker; wl_wrk->e = e; wl_wrk->vol_id = vol_id; wl_wrk->lnum = lnum; wl_wrk->torture = torture; schedule_ubi_work(ubi, wl_wrk); } return (0); } } static int do_sync_erase___0(struct ubi_device *ubi , struct ubi_wl_entry *e , int vol_id , int lnum , int torture ) { struct ubi_work *wl_wrk ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; int tmp___2 ; { { descriptor.modname = "ubi"; descriptor.function = "do_sync_erase"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): sync erase of PEB %i\n"; descriptor.lineno = 931U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): sync erase of PEB %i\n", tmp->pid, e->pnum); } } else { } { tmp___1 = kmalloc(48UL, 80U); wl_wrk = (struct ubi_work *)tmp___1; } if ((unsigned long )wl_wrk == (unsigned long )((struct ubi_work *)0)) { return (-12); } else { } { wl_wrk->e = e; wl_wrk->vol_id = vol_id; wl_wrk->lnum = lnum; wl_wrk->torture = torture; tmp___2 = erase_worker(ubi, wl_wrk, 0); } return (tmp___2); } } int ubi_wl_put_fm_peb(struct ubi_device *ubi , struct ubi_wl_entry *fm_e , int lnum , int torture ) { struct ubi_wl_entry *e ; int vol_id ; int pnum ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; int tmp___7 ; { { pnum = fm_e->pnum; descriptor.modname = "ubi"; descriptor.function = "ubi_wl_put_fm_peb"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): PEB %d\n"; descriptor.lineno = 962U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): PEB %d\n", tmp->pid, pnum); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_put_fm_peb", 964, tmp___1->pid); dump_stack(); } } else { } { tmp___4 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_put_fm_peb", 965, tmp___3->pid); dump_stack(); } } else { } { ldv_spin_lock_114(& ubi->wl_lock); e = *(ubi->lookuptbl + (unsigned long )pnum); } if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { { e = fm_e; tmp___6 = ldv__builtin_expect(e->ec < 0, 0L); } if (tmp___6 != 0L) { { tmp___5 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_put_fm_peb", 976, tmp___5->pid); dump_stack(); } } else { } *(ubi->lookuptbl + (unsigned long )pnum) = e; } else { { e->ec = fm_e->ec; kfree((void const *)fm_e); } } { ldv_spin_unlock_115(& ubi->wl_lock); vol_id = lnum != 0 ? 2147479553 : 2147479552; tmp___7 = schedule_erase(ubi, e, vol_id, lnum, torture); } return (tmp___7); } } static int wear_leveling_worker(struct ubi_device *ubi , struct ubi_work *wrk , int shutdown ) { int err ; int scrubbing ; int torture ; int protect ; int erroneous ; int vol_id ; int lnum ; int anchor ; struct ubi_wl_entry *e1 ; struct ubi_wl_entry *e2 ; struct ubi_vid_hdr *vid_hdr ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct _ddebug descriptor ; struct task_struct *tmp___4 ; long tmp___5 ; int tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; struct rb_node const *__mptr ; struct rb_node *tmp___9 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___10 ; long tmp___11 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___12 ; long tmp___13 ; struct rb_node const *__mptr___0 ; struct rb_node *tmp___14 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___15 ; long tmp___16 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___17 ; long tmp___18 ; struct _ddebug descriptor___5 ; struct task_struct *tmp___19 ; long tmp___20 ; __u32 tmp___21 ; __u32 tmp___22 ; struct task_struct *tmp___23 ; struct ubi_wl_entry *tmp___24 ; int tmp___25 ; struct _ddebug descriptor___6 ; struct task_struct *tmp___26 ; long tmp___27 ; struct _ddebug descriptor___7 ; struct task_struct *tmp___28 ; long tmp___29 ; struct _ddebug descriptor___8 ; struct task_struct *tmp___30 ; long tmp___31 ; struct _ddebug descriptor___9 ; struct task_struct *tmp___32 ; long tmp___33 ; struct task_struct *tmp___34 ; long tmp___35 ; struct ubi_wl_entry *tmp___36 ; struct ubi_wl_entry *tmp___37 ; int tmp___38 ; struct task_struct *tmp___39 ; long tmp___40 ; { { scrubbing = 0; torture = 0; protect = 0; erroneous = 0; vol_id = -1; lnum = lnum; anchor = wrk->anchor; kfree((void const *)wrk); } if (shutdown != 0) { return (0); } else { } { vid_hdr = ubi_zalloc_vid_hdr___2((struct ubi_device const *)ubi, 80U); } if ((unsigned long )vid_hdr == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } { ldv_mutex_lock_113___1(& ubi->move_mutex); ldv_spin_lock_114(& ubi->wl_lock); tmp___0 = ldv__builtin_expect((unsigned long )ubi->move_from != (unsigned long )((struct ubi_wl_entry *)0), 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "wear_leveling_worker", 1022, tmp->pid); dump_stack(); } } else { { tmp___1 = ldv__builtin_expect((unsigned long )ubi->move_to != (unsigned long )((struct ubi_wl_entry *)0), 0L); } if (tmp___1 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "wear_leveling_worker", 1022, tmp->pid); dump_stack(); } } else { } } { tmp___3 = ldv__builtin_expect(ubi->move_to_put != 0, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "wear_leveling_worker", 1023, tmp___2->pid); dump_stack(); } } else { } if ((unsigned long )ubi->free.rb_node == (unsigned long )((struct rb_node *)0) || ((unsigned long )ubi->used.rb_node == (unsigned long )((struct rb_node *)0) && (unsigned long )ubi->scrub.rb_node == (unsigned long )((struct rb_node *)0))) { { descriptor.modname = "ubi"; descriptor.function = "wear_leveling_worker"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): cancel WL, a list is empty: free %d, used %d\n"; descriptor.lineno = 1038U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___5 != 0L) { { tmp___4 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): cancel WL, a list is empty: free %d, used %d\n", tmp___4->pid, (unsigned long )ubi->free.rb_node == (unsigned long )((struct rb_node *)0), (unsigned long )ubi->used.rb_node == (unsigned long )((struct rb_node *)0)); } } else { } goto out_cancel; } else { } if (anchor == 0) { { tmp___6 = anchor_pebs_avalible(& ubi->free); anchor = tmp___6 == 0; } } else { } if (anchor != 0) { { e1 = find_anchor_wl_entry(& ubi->used); } if ((unsigned long )e1 == (unsigned long )((struct ubi_wl_entry *)0)) { goto out_cancel; } else { } { e2 = get_peb_for_wl(ubi); } if ((unsigned long )e2 == (unsigned long )((struct ubi_wl_entry *)0)) { goto out_cancel; } else { } { self_check_in_wl_tree((struct ubi_device const *)ubi, e1, & ubi->used); rb_erase(& e1->u.rb, & ubi->used); descriptor___0.modname = "ubi"; descriptor___0.function = "wear_leveling_worker"; descriptor___0.filename = "drivers/mtd/ubi/wl.c"; descriptor___0.format = "UBI DBG wl (pid %d): anchor-move PEB %d to PEB %d\n"; descriptor___0.lineno = 1057U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG wl (pid %d): anchor-move PEB %d to PEB %d\n", tmp___7->pid, e1->pnum, e2->pnum); } } else { } } else if ((unsigned long )ubi->scrub.rb_node == (unsigned long )((struct rb_node *)0)) { { tmp___9 = rb_first((struct rb_root const *)(& ubi->used)); __mptr = (struct rb_node const *)tmp___9; e1 = (struct ubi_wl_entry *)__mptr; e2 = get_peb_for_wl(ubi); } if ((unsigned long )e2 == (unsigned long )((struct ubi_wl_entry *)0)) { goto out_cancel; } else { } if (e2->ec - e1->ec <= 4095) { { descriptor___1.modname = "ubi"; descriptor___1.function = "wear_leveling_worker"; descriptor___1.filename = "drivers/mtd/ubi/wl.c"; descriptor___1.format = "UBI DBG wl (pid %d): no WL needed: min used EC %d, max free EC %d\n"; descriptor___1.lineno = 1074U; descriptor___1.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___11 != 0L) { { tmp___10 = get_current___1(); __dynamic_pr_debug(& descriptor___1, "UBI DBG wl (pid %d): no WL needed: min used EC %d, max free EC %d\n", tmp___10->pid, e1->ec, e2->ec); } } else { } { wl_tree_add(e2, & ubi->free); ubi->free_count = ubi->free_count + 1; } goto out_cancel; } else { } { self_check_in_wl_tree((struct ubi_device const *)ubi, e1, & ubi->used); rb_erase(& e1->u.rb, & ubi->used); descriptor___2.modname = "ubi"; descriptor___2.function = "wear_leveling_worker"; descriptor___2.filename = "drivers/mtd/ubi/wl.c"; descriptor___2.format = "UBI DBG wl (pid %d): move PEB %d EC %d to PEB %d EC %d\n"; descriptor___2.lineno = 1084U; descriptor___2.flags = 0U; tmp___13 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); } if (tmp___13 != 0L) { { tmp___12 = get_current___1(); __dynamic_pr_debug(& descriptor___2, "UBI DBG wl (pid %d): move PEB %d EC %d to PEB %d EC %d\n", tmp___12->pid, e1->pnum, e1->ec, e2->pnum, e2->ec); } } else { } } else { { scrubbing = 1; tmp___14 = rb_first((struct rb_root const *)(& ubi->scrub)); __mptr___0 = (struct rb_node const *)tmp___14; e1 = (struct ubi_wl_entry *)__mptr___0; e2 = get_peb_for_wl(ubi); } if ((unsigned long )e2 == (unsigned long )((struct ubi_wl_entry *)0)) { goto out_cancel; } else { } { self_check_in_wl_tree((struct ubi_device const *)ubi, e1, & ubi->scrub); rb_erase(& e1->u.rb, & ubi->scrub); descriptor___3.modname = "ubi"; descriptor___3.function = "wear_leveling_worker"; descriptor___3.filename = "drivers/mtd/ubi/wl.c"; descriptor___3.format = "UBI DBG wl (pid %d): scrub PEB %d to PEB %d\n"; descriptor___3.lineno = 1095U; descriptor___3.flags = 0U; tmp___16 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); } if (tmp___16 != 0L) { { tmp___15 = get_current___1(); __dynamic_pr_debug(& descriptor___3, "UBI DBG wl (pid %d): scrub PEB %d to PEB %d\n", tmp___15->pid, e1->pnum, e2->pnum); } } else { } } { ubi->move_from = e1; ubi->move_to = e2; ldv_spin_unlock_115(& ubi->wl_lock); err = ubi_io_read_vid_hdr(ubi, e1->pnum, vid_hdr, 0); } if (err != 0 && err != 5) { if (err == 1) { { descriptor___4.modname = "ubi"; descriptor___4.function = "wear_leveling_worker"; descriptor___4.filename = "drivers/mtd/ubi/wl.c"; descriptor___4.format = "UBI DBG wl (pid %d): PEB %d has no VID header\n"; descriptor___4.lineno = 1126U; descriptor___4.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); } if (tmp___18 != 0L) { { tmp___17 = get_current___1(); __dynamic_pr_debug(& descriptor___4, "UBI DBG wl (pid %d): PEB %d has no VID header\n", tmp___17->pid, e1->pnum); } } else { } protect = 1; goto out_not_moved; } else if (err == 2) { { descriptor___5.modname = "ubi"; descriptor___5.function = "wear_leveling_worker"; descriptor___5.filename = "drivers/mtd/ubi/wl.c"; descriptor___5.format = "UBI DBG wl (pid %d): PEB %d has no VID header but has bit-flips\n"; descriptor___5.lineno = 1136U; descriptor___5.flags = 0U; tmp___20 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); } if (tmp___20 != 0L) { { tmp___19 = get_current___1(); __dynamic_pr_debug(& descriptor___5, "UBI DBG wl (pid %d): PEB %d has no VID header but has bit-flips\n", tmp___19->pid, e1->pnum); } } else { } scrubbing = 1; goto out_not_moved; } else { } { printk("\vubi%d error: %s: error %d while reading VID header from PEB %d\n", ubi->ubi_num, "wear_leveling_worker", err, e1->pnum); } goto out_error; } else { } { tmp___21 = __fswab32(vid_hdr->vol_id); vol_id = (int )tmp___21; tmp___22 = __fswab32(vid_hdr->lnum); lnum = (int )tmp___22; err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vid_hdr); } if (err != 0) { if (err == 1) { protect = 1; goto out_not_moved; } else { } if (err == 6) { scrubbing = 1; goto out_not_moved; } else { } if ((unsigned int )err - 3U <= 2U) { torture = 1; goto out_not_moved; } else { } if (err == 2) { if (ubi->erroneous_peb_count > ubi->max_erroneous) { { printk("\vubi%d error: %s: too many erroneous eraseblocks (%d)\n", ubi->ubi_num, "wear_leveling_worker", ubi->erroneous_peb_count); } goto out_error; } else { } erroneous = 1; goto out_not_moved; } else { } if (err < 0) { goto out_error; } else { } { tmp___23 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "wear_leveling_worker", 1196, tmp___23->pid); dump_stack(); } } else { } if (scrubbing != 0) { { printk("\rubi%d: scrubbed PEB %d (LEB %d:%d), data moved to PEB %d\n", ubi->ubi_num, e1->pnum, vol_id, lnum, e2->pnum); } } else { } { ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); ldv_spin_lock_114(& ubi->wl_lock); } if (ubi->move_to_put == 0) { { wl_tree_add(e2, & ubi->used); e2 = (struct ubi_wl_entry *)0; } } else { } { tmp___24 = (struct ubi_wl_entry *)0; ubi->move_to = tmp___24; ubi->move_from = tmp___24; tmp___25 = 0; ubi->wl_scheduled = tmp___25; ubi->move_to_put = tmp___25; ldv_spin_unlock_115(& ubi->wl_lock); err = do_sync_erase___0(ubi, e1, vol_id, lnum, 0); } if (err != 0) { if ((unsigned long )e2 != (unsigned long )((struct ubi_wl_entry *)0)) { { kmem_cache_free(ubi_wl_entry_slab, (void *)e2); } } else { } goto out_ro; } else { } if ((unsigned long )e2 != (unsigned long )((struct ubi_wl_entry *)0)) { { descriptor___6.modname = "ubi"; descriptor___6.function = "wear_leveling_worker"; descriptor___6.filename = "drivers/mtd/ubi/wl.c"; descriptor___6.format = "UBI DBG wl (pid %d): PEB %d (LEB %d:%d) was put meanwhile, erase\n"; descriptor___6.lineno = 1227U; descriptor___6.flags = 0U; tmp___27 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); } if (tmp___27 != 0L) { { tmp___26 = get_current___1(); __dynamic_pr_debug(& descriptor___6, "UBI DBG wl (pid %d): PEB %d (LEB %d:%d) was put meanwhile, erase\n", tmp___26->pid, e2->pnum, vol_id, lnum); } } else { } { err = do_sync_erase___0(ubi, e2, vol_id, lnum, 0); } if (err != 0) { goto out_ro; } else { } } else { } { descriptor___7.modname = "ubi"; descriptor___7.function = "wear_leveling_worker"; descriptor___7.filename = "drivers/mtd/ubi/wl.c"; descriptor___7.format = "UBI DBG wl (pid %d): done\n"; descriptor___7.lineno = 1233U; descriptor___7.flags = 0U; tmp___29 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); } if (tmp___29 != 0L) { { tmp___28 = get_current___1(); __dynamic_pr_debug(& descriptor___7, "UBI DBG wl (pid %d): done\n", tmp___28->pid); } } else { } { ldv_mutex_unlock_118(& ubi->move_mutex); } return (0); out_not_moved: ; if (vol_id != -1) { { descriptor___8.modname = "ubi"; descriptor___8.function = "wear_leveling_worker"; descriptor___8.filename = "drivers/mtd/ubi/wl.c"; descriptor___8.format = "UBI DBG wl (pid %d): cancel moving PEB %d (LEB %d:%d) to PEB %d (%d)\n"; descriptor___8.lineno = 1245U; descriptor___8.flags = 0U; tmp___31 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); } if (tmp___31 != 0L) { { tmp___30 = get_current___1(); __dynamic_pr_debug(& descriptor___8, "UBI DBG wl (pid %d): cancel moving PEB %d (LEB %d:%d) to PEB %d (%d)\n", tmp___30->pid, e1->pnum, vol_id, lnum, e2->pnum, err); } } else { } } else { { descriptor___9.modname = "ubi"; descriptor___9.function = "wear_leveling_worker"; descriptor___9.filename = "drivers/mtd/ubi/wl.c"; descriptor___9.format = "UBI DBG wl (pid %d): cancel moving PEB %d to PEB %d (%d)\n"; descriptor___9.lineno = 1248U; descriptor___9.flags = 0U; tmp___33 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); } if (tmp___33 != 0L) { { tmp___32 = get_current___1(); __dynamic_pr_debug(& descriptor___9, "UBI DBG wl (pid %d): cancel moving PEB %d to PEB %d (%d)\n", tmp___32->pid, e1->pnum, e2->pnum, err); } } else { } } { ldv_spin_lock_114(& ubi->wl_lock); } if (protect != 0) { { prot_queue_add(ubi, e1); } } else if (erroneous != 0) { { wl_tree_add(e1, & ubi->erroneous); ubi->erroneous_peb_count = ubi->erroneous_peb_count + 1; } } else if (scrubbing != 0) { { wl_tree_add(e1, & ubi->scrub); } } else { { wl_tree_add(e1, & ubi->used); } } { tmp___35 = ldv__builtin_expect(ubi->move_to_put != 0, 0L); } if (tmp___35 != 0L) { { tmp___34 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "wear_leveling_worker", 1259, tmp___34->pid); dump_stack(); } } else { } { tmp___36 = (struct ubi_wl_entry *)0; ubi->move_to = tmp___36; ubi->move_from = tmp___36; ubi->wl_scheduled = 0; ldv_spin_unlock_115(& ubi->wl_lock); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); err = do_sync_erase___0(ubi, e2, vol_id, lnum, torture); } if (err != 0) { goto out_ro; } else { } { ldv_mutex_unlock_121___0(& ubi->move_mutex); } return (0); out_error: ; if (vol_id != -1) { { printk("\vubi%d error: %s: error %d while moving PEB %d to PEB %d\n", ubi->ubi_num, "wear_leveling_worker", err, e1->pnum, e2->pnum); } } else { { printk("\vubi%d error: %s: error %d while moving PEB %d (LEB %d:%d) to PEB %d\n", ubi->ubi_num, "wear_leveling_worker", err, e1->pnum, vol_id, lnum, e2->pnum); } } { ldv_spin_lock_114(& ubi->wl_lock); tmp___37 = (struct ubi_wl_entry *)0; ubi->move_to = tmp___37; ubi->move_from = tmp___37; tmp___38 = 0; ubi->wl_scheduled = tmp___38; ubi->move_to_put = tmp___38; ldv_spin_unlock_115(& ubi->wl_lock); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); kmem_cache_free(ubi_wl_entry_slab, (void *)e1); kmem_cache_free(ubi_wl_entry_slab, (void *)e2); } out_ro: { ubi_ro_mode(ubi); ldv_mutex_unlock_124(& ubi->move_mutex); tmp___40 = ldv__builtin_expect(err == 0, 0L); } if (tmp___40 != 0L) { { tmp___39 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "wear_leveling_worker", 1291, tmp___39->pid); dump_stack(); } } else { } return (err < 0 ? err : -5); out_cancel: { ubi->wl_scheduled = 0; ldv_spin_unlock_115(& ubi->wl_lock); ldv_mutex_unlock_126(& ubi->move_mutex); ubi_free_vid_hdr((struct ubi_device const *)ubi, vid_hdr); } return (0); } } static int ensure_wear_leveling(struct ubi_device *ubi , int nested ) { int err ; struct ubi_wl_entry *e1 ; struct ubi_wl_entry *e2 ; struct ubi_work *wrk ; struct rb_node const *__mptr ; struct rb_node *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; void *tmp___4 ; { { err = 0; ldv_spin_lock_114(& ubi->wl_lock); } if (ubi->wl_scheduled != 0) { goto out_unlock; } else { } if ((unsigned long )ubi->scrub.rb_node == (unsigned long )((struct rb_node *)0)) { if ((unsigned long )ubi->used.rb_node == (unsigned long )((struct rb_node *)0) || (unsigned long )ubi->free.rb_node == (unsigned long )((struct rb_node *)0)) { goto out_unlock; } else { } { tmp = rb_first((struct rb_root const *)(& ubi->used)); __mptr = (struct rb_node const *)tmp; e1 = (struct ubi_wl_entry *)__mptr; e2 = find_wl_entry(ubi, & ubi->free, 8192); } if (e2->ec - e1->ec <= 4095) { goto out_unlock; } else { } { descriptor.modname = "ubi"; descriptor.function = "ensure_wear_leveling"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): schedule wear-leveling\n"; descriptor.lineno = 1343U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): schedule wear-leveling\n", tmp___0->pid); } } else { } } else { { descriptor___0.modname = "ubi"; descriptor___0.function = "ensure_wear_leveling"; descriptor___0.filename = "drivers/mtd/ubi/wl.c"; descriptor___0.format = "UBI DBG wl (pid %d): schedule scrubbing\n"; descriptor___0.lineno = 1345U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG wl (pid %d): schedule scrubbing\n", tmp___2->pid); } } else { } } { ubi->wl_scheduled = 1; ldv_spin_unlock_115(& ubi->wl_lock); tmp___4 = kmalloc(48UL, 80U); wrk = (struct ubi_work *)tmp___4; } if ((unsigned long )wrk == (unsigned long )((struct ubi_work *)0)) { err = -12; goto out_cancel; } else { } wrk->anchor = 0; wrk->func = & wear_leveling_worker; if (nested != 0) { { __schedule_ubi_work(ubi, wrk); } } else { { schedule_ubi_work(ubi, wrk); } } return (err); out_cancel: { ldv_spin_lock_114(& ubi->wl_lock); ubi->wl_scheduled = 0; } out_unlock: { ldv_spin_unlock_115(& ubi->wl_lock); } return (err); } } int ubi_ensure_anchor_pebs(struct ubi_device *ubi ) { struct ubi_work *wrk ; void *tmp ; { { ldv_spin_lock_114(& ubi->wl_lock); } if (ubi->wl_scheduled != 0) { { ldv_spin_unlock_115(& ubi->wl_lock); } return (0); } else { } { ubi->wl_scheduled = 1; ldv_spin_unlock_115(& ubi->wl_lock); tmp = kmalloc(48UL, 80U); wrk = (struct ubi_work *)tmp; } if ((unsigned long )wrk == (unsigned long )((struct ubi_work *)0)) { { ldv_spin_lock_114(& ubi->wl_lock); ubi->wl_scheduled = 0; ldv_spin_unlock_115(& ubi->wl_lock); } return (-12); } else { } { wrk->anchor = 1; wrk->func = & wear_leveling_worker; schedule_ubi_work(ubi, wrk); } return (0); } } static int erase_worker(struct ubi_device *ubi , struct ubi_work *wl_wrk , int shutdown ) { struct ubi_wl_entry *e ; int pnum ; int vol_id ; int lnum ; int err ; int available_consumed ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; int err1 ; { e = wl_wrk->e; pnum = e->pnum; vol_id = wl_wrk->vol_id; lnum = wl_wrk->lnum; available_consumed = 0; if (shutdown != 0) { { descriptor.modname = "ubi"; descriptor.function = "erase_worker"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): cancel erasure of PEB %d EC %d\n"; descriptor.lineno = 1426U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): cancel erasure of PEB %d EC %d\n", tmp->pid, pnum, e->ec); } } else { } { kfree((void const *)wl_wrk); kmem_cache_free(ubi_wl_entry_slab, (void *)e); } return (0); } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "erase_worker"; descriptor___0.filename = "drivers/mtd/ubi/wl.c"; descriptor___0.format = "UBI DBG wl (pid %d): erase PEB %d EC %d LEB %d:%d\n"; descriptor___0.lineno = 1433U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG wl (pid %d): erase PEB %d EC %d LEB %d:%d\n", tmp___1->pid, pnum, e->ec, wl_wrk->vol_id, wl_wrk->lnum); } } else { } { tmp___4 = ubi_is_fm_block(ubi, e->pnum); tmp___5 = ldv__builtin_expect(tmp___4 != 0, 0L); } if (tmp___5 != 0L) { { tmp___3 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "erase_worker", 1435, tmp___3->pid); dump_stack(); } } else { } { err = sync_erase(ubi, e, wl_wrk->torture); } if (err == 0) { { kfree((void const *)wl_wrk); ldv_spin_lock_114(& ubi->wl_lock); wl_tree_add(e, & ubi->free); ubi->free_count = ubi->free_count + 1; ldv_spin_unlock_115(& ubi->wl_lock); serve_prot_queue(ubi); err = ensure_wear_leveling(ubi, 1); } return (err); } else { } { printk("\vubi%d error: %s: failed to erase PEB %d, error %d\n", ubi->ubi_num, "erase_worker", pnum, err); kfree((void const *)wl_wrk); } if ((err == -4 || err == -12) || (err == -11 || err == -16)) { { err1 = schedule_erase(ubi, e, vol_id, lnum, 0); } if (err1 != 0) { err = err1; goto out_ro; } else { } return (err); } else { } { kmem_cache_free(ubi_wl_entry_slab, (void *)e); } if (err != -5) { goto out_ro; } else { } if ((unsigned int )*((unsigned char *)ubi + 6612UL) == 0U) { { printk("\vubi%d error: %s: bad physical eraseblock %d detected\n", ubi->ubi_num, "erase_worker", pnum); } goto out_ro; } else { } { ldv_spin_lock_95(& ubi->volumes_lock); } if (ubi->beb_rsvd_pebs == 0) { if (ubi->avail_pebs == 0) { { ldv_spin_unlock_96(& ubi->volumes_lock); printk("\vubi%d error: %s: no reserved/available physical eraseblocks\n", ubi->ubi_num, "erase_worker"); } goto out_ro; } else { } ubi->avail_pebs = ubi->avail_pebs + -1; available_consumed = 1; } else { } { ldv_spin_unlock_96(& ubi->volumes_lock); printk("\rubi%d: mark PEB %d as bad\n", ubi->ubi_num, pnum); err = ubi_io_mark_bad((struct ubi_device const *)ubi, pnum); } if (err != 0) { goto out_ro; } else { } { ldv_spin_lock_95(& ubi->volumes_lock); } if (ubi->beb_rsvd_pebs > 0) { if (available_consumed != 0) { ubi->avail_pebs = ubi->avail_pebs + 1; available_consumed = 0; } else { } ubi->beb_rsvd_pebs = ubi->beb_rsvd_pebs + -1; } else { } { ubi->bad_peb_count = ubi->bad_peb_count + 1; ubi->good_peb_count = ubi->good_peb_count + -1; ubi_calculate_reserved(ubi); } if (available_consumed != 0) { { printk("\fubi%d warning: %s: no PEBs in the reserved pool, used an available PEB\n", ubi->ubi_num, "erase_worker"); } } else if (ubi->beb_rsvd_pebs != 0) { { printk("\rubi%d: %d PEBs left in the reserve\n", ubi->ubi_num, ubi->beb_rsvd_pebs); } } else { { printk("\fubi%d warning: %s: last PEB from the reserve was used\n", ubi->ubi_num, "erase_worker"); } } { ldv_spin_unlock_96(& ubi->volumes_lock); } return (err); out_ro: ; if (available_consumed != 0) { { ldv_spin_lock_95(& ubi->volumes_lock); ubi->avail_pebs = ubi->avail_pebs + 1; ldv_spin_unlock_96(& ubi->volumes_lock); } } else { } { ubi_ro_mode(ubi); } return (err); } } int ubi_wl_put_peb(struct ubi_device *ubi , int vol_id , int lnum , int pnum , int torture ) { int err ; struct ubi_wl_entry *e ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_wl_put_peb"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): PEB %d\n"; descriptor.lineno = 1562U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): PEB %d\n", tmp->pid, pnum); } } else { } { tmp___2 = ldv__builtin_expect(pnum < 0, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_put_peb", 1563, tmp___1->pid); dump_stack(); } } else { } { tmp___4 = ldv__builtin_expect(pnum >= ubi->peb_count, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_put_peb", 1564, tmp___3->pid); dump_stack(); } } else { } retry: { ldv_spin_lock_114(& ubi->wl_lock); e = *(ubi->lookuptbl + (unsigned long )pnum); } if ((unsigned long )e == (unsigned long )ubi->move_from) { { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_wl_put_peb"; descriptor___0.filename = "drivers/mtd/ubi/wl.c"; descriptor___0.format = "UBI DBG wl (pid %d): PEB %d is being moved, wait\n"; descriptor___0.lineno = 1575U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___6 != 0L) { { tmp___5 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG wl (pid %d): PEB %d is being moved, wait\n", tmp___5->pid, pnum); } } else { } { ldv_spin_unlock_115(& ubi->wl_lock); ldv_mutex_lock_147(& ubi->move_mutex); ldv_mutex_unlock_148(& ubi->move_mutex); } goto retry; } else if ((unsigned long )e == (unsigned long )ubi->move_to) { { descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_wl_put_peb"; descriptor___1.filename = "drivers/mtd/ubi/wl.c"; descriptor___1.format = "UBI DBG wl (pid %d): PEB %d is the target of data moving\n"; descriptor___1.lineno = 1592U; descriptor___1.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___1(); __dynamic_pr_debug(& descriptor___1, "UBI DBG wl (pid %d): PEB %d is the target of data moving\n", tmp___7->pid, pnum); } } else { } { tmp___10 = ldv__builtin_expect(ubi->move_to_put != 0, 0L); } if (tmp___10 != 0L) { { tmp___9 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_put_peb", 1593, tmp___9->pid); dump_stack(); } } else { } { ubi->move_to_put = 1; ldv_spin_unlock_115(& ubi->wl_lock); } return (0); } else { { tmp___15 = in_wl_tree(e, & ubi->used); } if (tmp___15 != 0) { { self_check_in_wl_tree((struct ubi_device const *)ubi, e, & ubi->used); rb_erase(& e->u.rb, & ubi->used); } } else { { tmp___14 = in_wl_tree(e, & ubi->scrub); } if (tmp___14 != 0) { { self_check_in_wl_tree((struct ubi_device const *)ubi, e, & ubi->scrub); rb_erase(& e->u.rb, & ubi->scrub); } } else { { tmp___13 = in_wl_tree(e, & ubi->erroneous); } if (tmp___13 != 0) { { self_check_in_wl_tree((struct ubi_device const *)ubi, e, & ubi->erroneous); rb_erase(& e->u.rb, & ubi->erroneous); ubi->erroneous_peb_count = ubi->erroneous_peb_count + -1; tmp___12 = ldv__builtin_expect(ubi->erroneous_peb_count < 0, 0L); } if (tmp___12 != 0L) { { tmp___11 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_put_peb", 1608, tmp___11->pid); dump_stack(); } } else { } torture = 1; } else { { err = prot_queue_del(ubi, e->pnum); } if (err != 0) { { printk("\vubi%d error: %s: PEB %d not found\n", ubi->ubi_num, "ubi_wl_put_peb", pnum); ubi_ro_mode(ubi); ldv_spin_unlock_115(& ubi->wl_lock); } return (err); } else { } } } } } { ldv_spin_unlock_115(& ubi->wl_lock); err = schedule_erase(ubi, e, vol_id, lnum, torture); } if (err != 0) { { ldv_spin_lock_114(& ubi->wl_lock); wl_tree_add(e, & ubi->used); ldv_spin_unlock_115(& ubi->wl_lock); } } else { } return (err); } } int ubi_wl_scrub_peb(struct ubi_device *ubi , int pnum ) { struct ubi_wl_entry *e ; int tmp ; int tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; int err ; int tmp___3 ; int tmp___4 ; { { printk("\rubi%d: schedule PEB %d for scrubbing\n", ubi->ubi_num, pnum); } retry: { ldv_spin_lock_114(& ubi->wl_lock); e = *(ubi->lookuptbl + (unsigned long )pnum); } if ((unsigned long )e == (unsigned long )ubi->move_from) { { ldv_spin_unlock_115(& ubi->wl_lock); } return (0); } else { { tmp = in_wl_tree(e, & ubi->scrub); } if (tmp != 0) { { ldv_spin_unlock_115(& ubi->wl_lock); } return (0); } else { { tmp___0 = in_wl_tree(e, & ubi->erroneous); } if (tmp___0 != 0) { { ldv_spin_unlock_115(& ubi->wl_lock); } return (0); } else { } } } if ((unsigned long )e == (unsigned long )ubi->move_to) { { ldv_spin_unlock_115(& ubi->wl_lock); descriptor.modname = "ubi"; descriptor.function = "ubi_wl_scrub_peb"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): the PEB %d is not in proper tree, retry\n"; descriptor.lineno = 1666U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): the PEB %d is not in proper tree, retry\n", tmp___1->pid, pnum); } } else { } { yield(); } goto retry; } else { } { tmp___3 = in_wl_tree(e, & ubi->used); } if (tmp___3 != 0) { { self_check_in_wl_tree((struct ubi_device const *)ubi, e, & ubi->used); rb_erase(& e->u.rb, & ubi->used); } } else { { err = prot_queue_del(ubi, e->pnum); } if (err != 0) { { printk("\vubi%d error: %s: PEB %d not found\n", ubi->ubi_num, "ubi_wl_scrub_peb", pnum); ubi_ro_mode(ubi); ldv_spin_unlock_115(& ubi->wl_lock); } return (err); } else { } } { wl_tree_add(e, & ubi->scrub); ldv_spin_unlock_115(& ubi->wl_lock); tmp___4 = ensure_wear_leveling(ubi, 0); } return (tmp___4); } } int ubi_wl_flush(struct ubi_device *ubi , int vol_id , int lnum ) { int err ; int found ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct ubi_work *wrk ; struct ubi_work *tmp___1 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___2 ; long tmp___3 ; struct list_head const *__mptr___1 ; { { err = 0; found = 1; descriptor.modname = "ubi"; descriptor.function = "ubi_wl_flush"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): flush pending work for LEB %d:%d (%d pending works)\n"; descriptor.lineno = 1718U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): flush pending work for LEB %d:%d (%d pending works)\n", tmp->pid, vol_id, lnum, ubi->works_count); } } else { } goto ldv_32287; ldv_32286: { found = 0; down_read(& ubi->work_sem); ldv_spin_lock_114(& ubi->wl_lock); __mptr = (struct list_head const *)ubi->works.next; wrk = (struct ubi_work *)__mptr; __mptr___0 = (struct list_head const *)wrk->list.next; tmp___1 = (struct ubi_work *)__mptr___0; } goto ldv_32285; ldv_32284: ; if ((vol_id == -1 || wrk->vol_id == vol_id) && (lnum == -1 || wrk->lnum == lnum)) { { list_del(& wrk->list); ubi->works_count = ubi->works_count + -1; tmp___3 = ldv__builtin_expect(ubi->works_count < 0, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_flush", 1731, tmp___2->pid); dump_stack(); } } else { } { ldv_spin_unlock_115(& ubi->wl_lock); err = (*(wrk->func))(ubi, wrk, 0); } if (err != 0) { { up_read(& ubi->work_sem); } return (err); } else { } { ldv_spin_lock_114(& ubi->wl_lock); found = 1; } goto ldv_32283; } else { } wrk = tmp___1; __mptr___1 = (struct list_head const *)tmp___1->list.next; tmp___1 = (struct ubi_work *)__mptr___1; ldv_32285: ; if ((unsigned long )(& wrk->list) != (unsigned long )(& ubi->works)) { goto ldv_32284; } else { } ldv_32283: { ldv_spin_unlock_115(& ubi->wl_lock); up_read(& ubi->work_sem); } ldv_32287: ; if (found != 0) { goto ldv_32286; } else { } { down_write(& ubi->work_sem); up_write(& ubi->work_sem); } return (err); } } static void tree_destroy(struct rb_root *root ) { struct rb_node *rb ; struct ubi_wl_entry *e ; struct rb_node const *__mptr ; { rb = root->rb_node; goto ldv_32297; ldv_32296: ; if ((unsigned long )rb->rb_left != (unsigned long )((struct rb_node *)0)) { rb = rb->rb_left; } else if ((unsigned long )rb->rb_right != (unsigned long )((struct rb_node *)0)) { rb = rb->rb_right; } else { __mptr = (struct rb_node const *)rb; e = (struct ubi_wl_entry *)__mptr; rb = (struct rb_node *)(rb->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )rb->rb_left == (unsigned long )(& e->u.rb)) { rb->rb_left = (struct rb_node *)0; } else { rb->rb_right = (struct rb_node *)0; } } else { } { kmem_cache_free(ubi_wl_entry_slab, (void *)e); } } ldv_32297: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_32296; } else { } return; } } int ubi_thread(void *u ) { int failures ; struct ubi_device *ubi ; struct task_struct *tmp ; pid_t tmp___0 ; int err ; bool tmp___1 ; bool tmp___2 ; struct task_struct *tmp___3 ; long volatile __ret ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; struct _ddebug descriptor ; struct task_struct *tmp___11 ; long tmp___12 ; { { failures = 0; ubi = (struct ubi_device *)u; tmp = get_current___1(); tmp___0 = task_pid_nr(tmp); printk("\rubi%d: background thread \"%s\" started, PID %d\n", ubi->ubi_num, (char *)(& ubi->bgt_name), tmp___0); set_freezable(); } ldv_32319: { tmp___1 = kthread_should_stop(); } if ((int )tmp___1) { goto ldv_32305; } else { } { tmp___2 = try_to_freeze(); } if ((int )tmp___2) { goto ldv_32306; } else { } { ldv_spin_lock_114(& ubi->wl_lock); tmp___8 = list_empty((struct list_head const *)(& ubi->works)); } if ((tmp___8 != 0 || ubi->ro_mode != 0) || ubi->thread_enabled == 0) { goto _L; } else { { tmp___9 = ubi_dbg_is_bgt_disabled((struct ubi_device const *)ubi); } if (tmp___9 != 0) { _L: /* CIL Label */ { tmp___3 = get_current___1(); } tmp___3->task_state_change = (unsigned long )((void *)0); __ret = 1L; { if (8UL == 1UL) { goto case_1; } else { } if (8UL == 2UL) { goto case_2; } else { } if (8UL == 4UL) { goto case_4; } else { } if (8UL == 8UL) { goto case_8; } else { } goto switch_default; case_1: /* CIL Label */ { tmp___4 = get_current___1(); __asm__ volatile ("xchgb %b0, %1\n": "+q" (__ret), "+m" (tmp___4->state): : "memory", "cc"); } goto ldv_32311; case_2: /* CIL Label */ { tmp___5 = get_current___1(); __asm__ volatile ("xchgw %w0, %1\n": "+r" (__ret), "+m" (tmp___5->state): : "memory", "cc"); } goto ldv_32311; case_4: /* CIL Label */ { tmp___6 = get_current___1(); __asm__ volatile ("xchgl %0, %1\n": "+r" (__ret), "+m" (tmp___6->state): : "memory", "cc"); } goto ldv_32311; case_8: /* CIL Label */ { tmp___7 = get_current___1(); __asm__ volatile ("xchgq %q0, %1\n": "+r" (__ret), "+m" (tmp___7->state): : "memory", "cc"); } goto ldv_32311; switch_default: /* CIL Label */ { __xchg_wrong_size(); } switch_break: /* CIL Label */ ; } ldv_32311: { ldv_spin_unlock_115(& ubi->wl_lock); schedule(); } goto ldv_32306; } else { } } { ldv_spin_unlock_115(& ubi->wl_lock); err = do_work(ubi); } if (err != 0) { { printk("\vubi%d error: %s: %s: work failed with error code %d\n", ubi->ubi_num, "ubi_thread", (char *)(& ubi->bgt_name), err); tmp___10 = failures; failures = failures + 1; } if (tmp___10 > 32) { { printk("\rubi%d: %s: %d consecutive failures\n", ubi->ubi_num, (char *)(& ubi->bgt_name), 32); ubi_ro_mode(ubi); ubi->thread_enabled = 0; } goto ldv_32306; } else { } } else { failures = 0; } { ___might_sleep("drivers/mtd/ubi/wl.c", 1840, 0); _cond_resched(); } ldv_32306: ; goto ldv_32319; ldv_32305: { descriptor.modname = "ubi"; descriptor.function = "ubi_thread"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): background thread \"%s\" is killed\n"; descriptor.lineno = 1843U; descriptor.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___12 != 0L) { { tmp___11 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): background thread \"%s\" is killed\n", tmp___11->pid, (char *)(& ubi->bgt_name)); } } else { } return (0); } } static void shutdown_work(struct ubi_device *ubi ) { struct ubi_work *wrk ; struct list_head const *__mptr ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { goto ldv_32329; ldv_32328: { __mptr = (struct list_head const *)ubi->works.next; wrk = (struct ubi_work *)__mptr; list_del(& wrk->list); (*(wrk->func))(ubi, wrk, 1); ubi->works_count = ubi->works_count + -1; tmp___0 = ldv__builtin_expect(ubi->works_count < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "shutdown_work", 1860, tmp->pid); dump_stack(); } } else { } ldv_32329: { tmp___1 = list_empty((struct list_head const *)(& ubi->works)); } if (tmp___1 == 0) { goto ldv_32328; } else { } return; } } int ubi_wl_init(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int err ; int i ; int reserved_pebs ; int found_pebs ; struct rb_node *rb1 ; struct rb_node *rb2 ; struct ubi_ainf_volume *av ; struct ubi_ainf_peb *aeb ; struct ubi_ainf_peb *tmp ; struct ubi_wl_entry *e ; struct rb_root tmp___0 ; struct rb_root tmp___1 ; struct rb_root tmp___2 ; struct rb_root __constr_expr_0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; atomic_long_t __constr_expr_1 ; void *tmp___3 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; void *tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; int tmp___8 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; void *tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; struct task_struct *tmp___12 ; int tmp___13 ; long tmp___14 ; struct list_head const *__mptr___3 ; struct rb_node const *__mptr___4 ; struct rb_node const *__mptr___5 ; void *tmp___15 ; struct _ddebug descriptor ; struct task_struct *tmp___16 ; long tmp___17 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___18 ; long tmp___19 ; struct rb_node const *__mptr___6 ; struct rb_node const *__mptr___7 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___20 ; long tmp___21 ; struct task_struct *tmp___22 ; long tmp___23 ; struct task_struct *tmp___24 ; long tmp___25 ; { { found_pebs = 0; __constr_expr_0.rb_node = (struct rb_node *)0; tmp___2 = __constr_expr_0; ubi->scrub = tmp___2; tmp___1 = tmp___2; ubi->free = tmp___1; tmp___0 = tmp___1; ubi->erroneous = tmp___0; ubi->used = tmp___0; spinlock_check(& ubi->wl_lock); __raw_spin_lock_init(& ubi->wl_lock.__annonCompField18.rlock, "&(&ubi->wl_lock)->rlock", & __key); __mutex_init(& ubi->move_mutex, "&ubi->move_mutex", & __key___0); __init_rwsem(& ubi->work_sem, "&ubi->work_sem", & __key___1); ubi->max_ec = ai->max_ec; INIT_LIST_HEAD(& ubi->works); __init_work(& ubi->fm_work, 0); __constr_expr_1.counter = 137438953408L; ubi->fm_work.data = __constr_expr_1; lockdep_init_map(& ubi->fm_work.lockdep_map, "(&ubi->fm_work)", & __key___2, 0); INIT_LIST_HEAD(& ubi->fm_work.entry); ubi->fm_work.func = & update_fastmap_work_fn; sprintf((char *)(& ubi->bgt_name), "ubi_bgt%dd", ubi->ubi_num); err = -12; tmp___3 = kzalloc((unsigned long )ubi->peb_count * 8UL, 208U); ubi->lookuptbl = (struct ubi_wl_entry **)tmp___3; } if ((unsigned long )ubi->lookuptbl == (unsigned long )((struct ubi_wl_entry **)0)) { return (err); } else { } i = 0; goto ldv_32352; ldv_32351: { INIT_LIST_HEAD((struct list_head *)(& ubi->pq) + (unsigned long )i); i = i + 1; } ldv_32352: ; if (i <= 9) { goto ldv_32351; } else { } ubi->pq_head = 0; __mptr = (struct list_head const *)ai->erase.next; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; __mptr___0 = (struct list_head const *)aeb->u.list.next; tmp = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; goto ldv_32364; ldv_32363: { ___might_sleep("drivers/mtd/ubi/wl.c", 1902, 0); _cond_resched(); tmp___4 = ldv_kmem_cache_alloc_166(ubi_wl_entry_slab, 208U); e = (struct ubi_wl_entry *)tmp___4; } if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { goto out_free; } else { } { e->pnum = aeb->pnum; e->ec = aeb->ec; tmp___6 = ubi_is_fm_block(ubi, e->pnum); tmp___7 = ldv__builtin_expect(tmp___6 != 0, 0L); } if (tmp___7 != 0L) { { tmp___5 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_init", 1910, tmp___5->pid); dump_stack(); } } else { } { *(ubi->lookuptbl + (unsigned long )e->pnum) = e; tmp___8 = schedule_erase(ubi, e, aeb->vol_id, aeb->lnum, 0); } if (tmp___8 != 0) { { kmem_cache_free(ubi_wl_entry_slab, (void *)e); } goto out_free; } else { } found_pebs = found_pebs + 1; aeb = tmp; __mptr___1 = (struct list_head const *)tmp->u.list.next; tmp = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; ldv_32364: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->erase)) { goto ldv_32363; } else { } ubi->free_count = 0; __mptr___2 = (struct list_head const *)ai->free.next; aeb = (struct ubi_ainf_peb *)__mptr___2 + 0xffffffffffffffe0UL; goto ldv_32372; ldv_32371: { ___might_sleep("drivers/mtd/ubi/wl.c", 1922, 0); _cond_resched(); tmp___9 = ldv_kmem_cache_alloc_167(ubi_wl_entry_slab, 208U); e = (struct ubi_wl_entry *)tmp___9; } if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { goto out_free; } else { } { e->pnum = aeb->pnum; e->ec = aeb->ec; tmp___11 = ldv__builtin_expect(e->ec < 0, 0L); } if (tmp___11 != 0L) { { tmp___10 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_init", 1930, tmp___10->pid); dump_stack(); } } else { } { tmp___13 = ubi_is_fm_block(ubi, e->pnum); tmp___14 = ldv__builtin_expect(tmp___13 != 0, 0L); } if (tmp___14 != 0L) { { tmp___12 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_init", 1931, tmp___12->pid); dump_stack(); } } else { } { wl_tree_add(e, & ubi->free); ubi->free_count = ubi->free_count + 1; *(ubi->lookuptbl + (unsigned long )e->pnum) = e; found_pebs = found_pebs + 1; __mptr___3 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___3 + 0xffffffffffffffe0UL; } ldv_32372: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->free)) { goto ldv_32371; } else { } { rb1 = rb_first((struct rb_root const *)(& ai->volumes)); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___4 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___4 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } goto ldv_32389; ldv_32388: { rb2 = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___5 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___5 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_32386; ldv_32385: { ___might_sleep("drivers/mtd/ubi/wl.c", 1943, 0); _cond_resched(); tmp___15 = ldv_kmem_cache_alloc_168(ubi_wl_entry_slab, 208U); e = (struct ubi_wl_entry *)tmp___15; } if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { goto out_free; } else { } e->pnum = aeb->pnum; e->ec = aeb->ec; *(ubi->lookuptbl + (unsigned long )e->pnum) = e; if ((unsigned int )*((unsigned char *)aeb + 16UL) == 0U) { { descriptor.modname = "ubi"; descriptor.function = "ubi_wl_init"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): add PEB %d EC %d to the used tree\n"; descriptor.lineno = 1955U; descriptor.flags = 0U; tmp___17 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___17 != 0L) { { tmp___16 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): add PEB %d EC %d to the used tree\n", tmp___16->pid, e->pnum, e->ec); } } else { } { wl_tree_add(e, & ubi->used); } } else { { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_wl_init"; descriptor___0.filename = "drivers/mtd/ubi/wl.c"; descriptor___0.format = "UBI DBG wl (pid %d): add PEB %d EC %d to the scrub tree\n"; descriptor___0.lineno = 1959U; descriptor___0.flags = 0U; tmp___19 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___19 != 0L) { { tmp___18 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG wl (pid %d): add PEB %d EC %d to the scrub tree\n", tmp___18->pid, e->pnum, e->ec); } } else { } { wl_tree_add(e, & ubi->scrub); } } { found_pebs = found_pebs + 1; rb2 = rb_next((struct rb_node const *)rb2); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___6 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___6 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_32386: ; if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { goto ldv_32385; } else { } { rb1 = rb_next((struct rb_node const *)rb1); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___7 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___7 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } ldv_32389: ; if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { goto ldv_32388; } else { } { descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_wl_init"; descriptor___1.filename = "drivers/mtd/ubi/wl.c"; descriptor___1.format = "UBI DBG wl (pid %d): found %i PEBs\n"; descriptor___1.lineno = 1967U; descriptor___1.flags = 0U; tmp___21 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___21 != 0L) { { tmp___20 = get_current___1(); __dynamic_pr_debug(& descriptor___1, "UBI DBG wl (pid %d): found %i PEBs\n", tmp___20->pid, found_pebs); } } else { } if ((unsigned long )ubi->fm != (unsigned long )((struct ubi_fastmap_layout *)0)) { { tmp___23 = ldv__builtin_expect(ubi->good_peb_count != found_pebs + (ubi->fm)->used_blocks, 0L); } if (tmp___23 != 0L) { { tmp___22 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_init", 1971, tmp___22->pid); dump_stack(); } } else { } } else { { tmp___25 = ldv__builtin_expect(ubi->good_peb_count != found_pebs, 0L); } if (tmp___25 != 0L) { { tmp___24 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_wl_init", 1973, tmp___24->pid); dump_stack(); } } else { } } reserved_pebs = 1; reserved_pebs = (int )((unsigned int )reserved_pebs + (unsigned int )(ubi->fm_size / (size_t )ubi->leb_size) * 2U); if (ubi->avail_pebs < reserved_pebs) { { printk("\vubi%d error: %s: no enough physical eraseblocks (%d, need %d)\n", ubi->ubi_num, "ubi_wl_init", ubi->avail_pebs, reserved_pebs); } if (ubi->corr_peb_count != 0) { { printk("\vubi%d error: %s: %d PEBs are corrupted and not used\n", ubi->ubi_num, "ubi_wl_init", ubi->corr_peb_count); } } else { } goto out_free; } else { } { ubi->avail_pebs = ubi->avail_pebs - reserved_pebs; ubi->rsvd_pebs = ubi->rsvd_pebs + reserved_pebs; err = ensure_wear_leveling(ubi, 0); } if (err != 0) { goto out_free; } else { } return (0); out_free: { shutdown_work(ubi); tree_destroy(& ubi->used); tree_destroy(& ubi->free); tree_destroy(& ubi->scrub); kfree((void const *)ubi->lookuptbl); } return (err); } } static void protection_queue_destroy(struct ubi_device *ubi ) { int i ; struct ubi_wl_entry *e ; struct ubi_wl_entry *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { i = 0; goto ldv_32408; ldv_32407: __mptr = (struct list_head const *)((struct list_head *)(& ubi->pq) + (unsigned long )i)->next; e = (struct ubi_wl_entry *)__mptr; __mptr___0 = (struct list_head const *)e->u.list.next; tmp = (struct ubi_wl_entry *)__mptr___0; goto ldv_32405; ldv_32404: { list_del(& e->u.list); kmem_cache_free(ubi_wl_entry_slab, (void *)e); e = tmp; __mptr___1 = (struct list_head const *)tmp->u.list.next; tmp = (struct ubi_wl_entry *)__mptr___1; } ldv_32405: ; if ((unsigned long )(& e->u.list) != (unsigned long )((struct list_head *)(& ubi->pq) + (unsigned long )i)) { goto ldv_32404; } else { } i = i + 1; ldv_32408: ; if (i <= 9) { goto ldv_32407; } else { } return; } } void ubi_wl_close(struct ubi_device *ubi ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_wl_close"; descriptor.filename = "drivers/mtd/ubi/wl.c"; descriptor.format = "UBI DBG wl (pid %d): close the WL sub-system\n"; descriptor.lineno = 2031U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG wl (pid %d): close the WL sub-system\n", tmp->pid); } } else { } { shutdown_work(ubi); protection_queue_destroy(ubi); tree_destroy(& ubi->used); tree_destroy(& ubi->erroneous); tree_destroy(& ubi->free); tree_destroy(& ubi->scrub); kfree((void const *)ubi->lookuptbl); } return; } } static int self_check_ec(struct ubi_device *ubi , int pnum , int ec ) { int err ; long long read_ec ; struct ubi_ec_hdr *ec_hdr ; int tmp ; void *tmp___0 ; __u64 tmp___1 ; { { tmp = ubi_dbg_chk_gen((struct ubi_device const *)ubi); } if (tmp == 0) { return (0); } else { } { tmp___0 = kzalloc((size_t )ubi->ec_hdr_alsize, 80U); ec_hdr = (struct ubi_ec_hdr *)tmp___0; } if ((unsigned long )ec_hdr == (unsigned long )((struct ubi_ec_hdr *)0)) { return (-12); } else { } { err = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0); } if (err != 0 && err != 5) { err = 0; goto out_free; } else { } { tmp___1 = __fswab64(ec_hdr->ec); read_ec = (long long )tmp___1; } if ((long long )ec != read_ec && read_ec - (long long )ec > 1LL) { { printk("\vubi%d error: %s: self-check failed for PEB %d\n", ubi->ubi_num, "self_check_ec", pnum); printk("\vubi%d error: %s: read EC is %lld, should be %d\n", ubi->ubi_num, "self_check_ec", read_ec, ec); dump_stack(); err = 1; } } else { err = 0; } out_free: { kfree((void const *)ec_hdr); } return (err); } } static int self_check_in_wl_tree(struct ubi_device const *ubi , struct ubi_wl_entry *e , struct rb_root *root ) { int tmp ; int tmp___0 ; { { tmp = ubi_dbg_chk_gen(ubi); } if (tmp == 0) { return (0); } else { } { tmp___0 = in_wl_tree(e, root); } if (tmp___0 != 0) { return (0); } else { } { printk("\vubi%d error: %s: self-check failed for PEB %d, EC %d, RB-tree %p \n", ubi->ubi_num, "self_check_in_wl_tree", e->pnum, e->ec, root); dump_stack(); } return (-22); } } static int self_check_in_pq(struct ubi_device const *ubi , struct ubi_wl_entry *e ) { struct ubi_wl_entry *p ; int i ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { { tmp = ubi_dbg_chk_gen(ubi); } if (tmp == 0) { return (0); } else { } i = 0; goto ldv_32445; ldv_32444: __mptr = (struct list_head const *)((struct list_head const *)(& ubi->pq) + (unsigned long )i)->next; p = (struct ubi_wl_entry *)__mptr; goto ldv_32442; ldv_32441: ; if ((unsigned long )p == (unsigned long )e) { return (0); } else { } __mptr___0 = (struct list_head const *)p->u.list.next; p = (struct ubi_wl_entry *)__mptr___0; ldv_32442: ; if ((unsigned long )((struct list_head const *)(& p->u.list)) != (unsigned long )((struct list_head const *)(& ubi->pq) + (unsigned long )i)) { goto ldv_32441; } else { } i = i + 1; ldv_32445: ; if (i <= 9) { goto ldv_32444; } else { } { printk("\vubi%d error: %s: self-check failed for PEB %d, EC %d, Protect queue\n", ubi->ubi_num, "self_check_in_pq", e->pnum, e->ec); dump_stack(); } return (-22); } } static void ldv_mutex_lock_113___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_move_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_118(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_move_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_121___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_move_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_124(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_move_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_126(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_move_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_147(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_move_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_148(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_move_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void *ldv_kmem_cache_alloc_166(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_kmem_cache_alloc_167(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_kmem_cache_alloc_168(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_lock_97___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_101(struct mutex *ldv_func_arg1 ) ; __inline static void *ERR_PTR(long error ) ; __inline static long PTR_ERR(void const *ptr ) ; static void ldv_mutex_unlock_98___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_99___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_102(struct mutex *ldv_func_arg1 ) ; static void *ldv_kmem_cache_alloc_95(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_96(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_100(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; extern void get_random_bytes(void * , int ) ; void ubi_dump_aeb(struct ubi_ainf_peb const *aeb , int type ) ; int ubi_compare_lebs(struct ubi_device *ubi , struct ubi_ainf_peb const *aeb , int pnum , struct ubi_vid_hdr const *vid_hdr ) ; int ubi_scan_fastmap(struct ubi_device *ubi , struct ubi_attach_info *ai , int fm_anchor ) ; __inline static struct ubi_vid_hdr *ubi_zalloc_vid_hdr___3(struct ubi_device const *ubi , gfp_t gfp_flags ) { void *vid_hdr ; { { vid_hdr = kzalloc((size_t )ubi->vid_hdr_alsize, gfp_flags); } if ((unsigned long )vid_hdr == (unsigned long )((void *)0)) { return ((struct ubi_vid_hdr *)0); } else { } return ((struct ubi_vid_hdr *)vid_hdr + (unsigned long )ubi->vid_hdr_shift); } } __inline static int ubi_io_read_data___1(struct ubi_device const *ubi , void *buf , int pnum , int offset , int len ) { struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___0 = ldv__builtin_expect(offset < 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_io_read_data", 974, tmp->pid); dump_stack(); } } else { } { tmp___1 = ubi_io_read(ubi, buf, pnum, offset + (int )ubi->leb_start, len); } return (tmp___1); } } static int self_check_ai(struct ubi_device *ubi , struct ubi_attach_info *ai ) ; static struct ubi_ec_hdr *ech ; static struct ubi_vid_hdr *vidh ; static int add_to_list(struct ubi_attach_info *ai , int pnum , int vol_id , int lnum , int ec , int to_head , struct list_head *list ) { struct ubi_ainf_peb *aeb ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___3 ; long tmp___4 ; void *tmp___5 ; { if ((unsigned long )list == (unsigned long )(& ai->free)) { { descriptor.modname = "ubi"; descriptor.function = "add_to_list"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): add to free: PEB %d, EC %d\n"; descriptor.lineno = 125U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): add to free: PEB %d, EC %d\n", tmp->pid, pnum, ec); } } else { } } else if ((unsigned long )list == (unsigned long )(& ai->erase)) { { descriptor___0.modname = "ubi"; descriptor___0.function = "add_to_list"; descriptor___0.filename = "drivers/mtd/ubi/attach.c"; descriptor___0.format = "UBI DBG bld (pid %d): add to erase: PEB %d, EC %d\n"; descriptor___0.lineno = 127U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): add to erase: PEB %d, EC %d\n", tmp___1->pid, pnum, ec); } } else { } } else if ((unsigned long )list == (unsigned long )(& ai->alien)) { { descriptor___1.modname = "ubi"; descriptor___1.function = "add_to_list"; descriptor___1.filename = "drivers/mtd/ubi/attach.c"; descriptor___1.format = "UBI DBG bld (pid %d): add to alien: PEB %d, EC %d\n"; descriptor___1.lineno = 129U; descriptor___1.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___4 != 0L) { { tmp___3 = get_current___1(); __dynamic_pr_debug(& descriptor___1, "UBI DBG bld (pid %d): add to alien: PEB %d, EC %d\n", tmp___3->pid, pnum, ec); } } else { } ai->alien_peb_count = ai->alien_peb_count + 1; } else { { __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 *)"drivers/mtd/ubi/attach.c"), "i" (132), "i" (12UL)); __builtin_unreachable(); } } { tmp___5 = ldv_kmem_cache_alloc_95(ai->aeb_slab_cache, 208U); aeb = (struct ubi_ainf_peb *)tmp___5; } if ((unsigned long )aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { return (-12); } else { } aeb->pnum = pnum; aeb->vol_id = vol_id; aeb->lnum = lnum; aeb->ec = ec; if (to_head != 0) { { list_add(& aeb->u.list, list); } } else { { list_add_tail(& aeb->u.list, list); } } return (0); } } static int add_corrupted(struct ubi_attach_info *ai , int pnum , int ec ) { struct ubi_ainf_peb *aeb ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; { { descriptor.modname = "ubi"; descriptor.function = "add_corrupted"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): add to corrupted: PEB %d, EC %d\n"; descriptor.lineno = 164U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): add to corrupted: PEB %d, EC %d\n", tmp->pid, pnum, ec); } } else { } { tmp___1 = ldv_kmem_cache_alloc_96(ai->aeb_slab_cache, 208U); aeb = (struct ubi_ainf_peb *)tmp___1; } if ((unsigned long )aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { return (-12); } else { } { ai->corr_peb_count = ai->corr_peb_count + 1; aeb->pnum = pnum; aeb->ec = ec; list_add(& aeb->u.list, & ai->corr); } return (0); } } static int validate_vid_hdr___0(struct ubi_device const *ubi , struct ubi_vid_hdr const *vid_hdr , struct ubi_ainf_volume const *av , int pnum ) { int vol_type ; int vol_id ; __u32 tmp ; int used_ebs ; __u32 tmp___0 ; int data_pad ; __u32 tmp___1 ; int av_vol_type ; { { vol_type = (int )vid_hdr->vol_type; tmp = __fswab32(vid_hdr->vol_id); vol_id = (int )tmp; tmp___0 = __fswab32(vid_hdr->used_ebs); used_ebs = (int )tmp___0; tmp___1 = __fswab32(vid_hdr->data_pad); data_pad = (int )tmp___1; } if ((int )av->leb_count != 0) { if (vol_id != (int )av->vol_id) { { printk("\vubi%d error: %s: inconsistent vol_id\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if ((int )av->vol_type == 4) { av_vol_type = 2; } else { av_vol_type = 1; } if (vol_type != av_vol_type) { { printk("\vubi%d error: %s: inconsistent vol_type\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (used_ebs != (int )av->used_ebs) { { printk("\vubi%d error: %s: inconsistent used_ebs\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } if (data_pad != (int )av->data_pad) { { printk("\vubi%d error: %s: inconsistent data_pad\n", ubi->ubi_num, "validate_vid_hdr"); } goto bad; } else { } } else { } return (0); bad: { printk("\vubi%d error: %s: inconsistent VID header at PEB %d\n", ubi->ubi_num, "validate_vid_hdr", pnum); ubi_dump_vid_hdr(vid_hdr); ubi_dump_av(av); } return (-22); } } static struct ubi_ainf_volume *add_volume(struct ubi_attach_info *ai , int vol_id , int pnum , struct ubi_vid_hdr const *vid_hdr ) { struct ubi_ainf_volume *av ; struct rb_node **p ; struct rb_node *parent ; struct task_struct *tmp ; __u32 tmp___0 ; long tmp___1 ; struct rb_node const *__mptr ; void *tmp___2 ; void *tmp___3 ; int tmp___4 ; struct rb_root __constr_expr_0 ; __u32 tmp___5 ; __u32 tmp___6 ; struct _ddebug descriptor ; struct task_struct *tmp___7 ; long tmp___8 ; { { p = & ai->volumes.rb_node; parent = (struct rb_node *)0; tmp___0 = __fswab32(vid_hdr->vol_id); tmp___1 = ldv__builtin_expect((unsigned int )vol_id != tmp___0, 0L); } if (tmp___1 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "add_volume", 265, tmp->pid); dump_stack(); } } else { } goto ldv_31489; ldv_31488: parent = *p; __mptr = (struct rb_node const *)parent; av = (struct ubi_ainf_volume *)__mptr + 0xffffffffffffffe0UL; if (vol_id == av->vol_id) { return (av); } else { } if (vol_id > av->vol_id) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } ldv_31489: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31488; } else { } { tmp___2 = kmalloc(64UL, 208U); av = (struct ubi_ainf_volume *)tmp___2; } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { { tmp___3 = ERR_PTR(-12L); } return ((struct ubi_ainf_volume *)tmp___3); } else { } { tmp___4 = 0; av->leb_count = tmp___4; av->highest_lnum = tmp___4; av->vol_id = vol_id; __constr_expr_0.rb_node = (struct rb_node *)0; av->root = __constr_expr_0; tmp___5 = __fswab32(vid_hdr->used_ebs); av->used_ebs = (int )tmp___5; tmp___6 = __fswab32(vid_hdr->data_pad); av->data_pad = (int )tmp___6; av->compat = (int )vid_hdr->compat; av->vol_type = (unsigned int )((unsigned char )vid_hdr->vol_type) == 1U ? 3 : 4; } if (vol_id > ai->highest_vol_id) { ai->highest_vol_id = vol_id; } else { } { rb_link_node(& av->rb, parent, p); rb_insert_color(& av->rb, & ai->volumes); ai->vols_found = ai->vols_found + 1; descriptor.modname = "ubi"; descriptor.function = "add_volume"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): added volume %d\n"; descriptor.lineno = 300U; descriptor.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): added volume %d\n", tmp___7->pid, vol_id); } } else { } return (av); } } int ubi_compare_lebs(struct ubi_device *ubi , struct ubi_ainf_peb const *aeb , int pnum , struct ubi_vid_hdr const *vid_hdr ) { int len ; int err ; int second_is_newer ; int bitflips ; int corrupted ; uint32_t data_crc ; uint32_t crc ; struct ubi_vid_hdr *vh ; unsigned long long sqnum2 ; __u64 tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; __u32 tmp___4 ; int tmp___5 ; __u32 tmp___6 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___7 ; long tmp___8 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___9 ; long tmp___10 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___11 ; long tmp___12 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___13 ; long tmp___14 ; { { bitflips = 0; corrupted = 0; vh = (struct ubi_vid_hdr *)0; tmp = __fswab64(vid_hdr->sqnum); sqnum2 = tmp; } if (sqnum2 == (unsigned long long )aeb->sqnum) { { printk("\vubi%d error: %s: unsupported on-flash UBI format\n", ubi->ubi_num, "ubi_compare_lebs"); } return (-22); } else { } second_is_newer = sqnum2 > (unsigned long long )aeb->sqnum; if (second_is_newer != 0) { if ((unsigned int )((unsigned char )vid_hdr->copy_flag) == 0U) { { descriptor.modname = "ubi"; descriptor.function = "ubi_compare_lebs"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): second PEB %d is newer, copy_flag is unset\n"; descriptor.lineno = 361U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): second PEB %d is newer, copy_flag is unset\n", tmp___0->pid, pnum); } } else { } return (1); } else { } } else { if ((unsigned int )*((unsigned char *)aeb + 16UL) == 0U) { { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_compare_lebs"; descriptor___0.filename = "drivers/mtd/ubi/attach.c"; descriptor___0.format = "UBI DBG bld (pid %d): first PEB %d is newer, copy_flag is unset\n"; descriptor___0.lineno = 368U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): first PEB %d is newer, copy_flag is unset\n", tmp___2->pid, pnum); } } else { } return (bitflips << 1); } else { } { vh = ubi_zalloc_vid_hdr___3((struct ubi_device const *)ubi, 208U); } if ((unsigned long )vh == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } { pnum = aeb->pnum; err = ubi_io_read_vid_hdr(ubi, pnum, vh, 0); } if (err != 0) { if (err == 5) { bitflips = 1; } else { { printk("\vubi%d error: %s: VID of PEB %d header is bad, but it was OK earlier, err %d\n", ubi->ubi_num, "ubi_compare_lebs", pnum, err); } if (err > 0) { err = -5; } else { } goto out_free_vidh; } } else { } vid_hdr = (struct ubi_vid_hdr const *)vh; } { tmp___4 = __fswab32(vid_hdr->data_size); len = (int )tmp___4; ldv_mutex_lock_97___0(& ubi->buf_mutex); err = ubi_io_read_data___1((struct ubi_device const *)ubi, ubi->peb_buf, pnum, 0, len); } if (err != 0 && err != 5) { { tmp___5 = mtd_is_eccerr(err); } if (tmp___5 == 0) { goto out_unlock; } else { } } else { } { tmp___6 = __fswab32(vid_hdr->data_crc); data_crc = tmp___6; crc = crc32_le(4294967295U, (unsigned char const *)ubi->peb_buf, (size_t )len); } if (crc != data_crc) { { descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_compare_lebs"; descriptor___1.filename = "drivers/mtd/ubi/attach.c"; descriptor___1.format = "UBI DBG bld (pid %d): PEB %d CRC error: calculated %#08x, must be %#08x\n"; descriptor___1.lineno = 407U; descriptor___1.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___1(); __dynamic_pr_debug(& descriptor___1, "UBI DBG bld (pid %d): PEB %d CRC error: calculated %#08x, must be %#08x\n", tmp___7->pid, pnum, crc, data_crc); } } else { } corrupted = 1; bitflips = 0; second_is_newer = second_is_newer == 0; } else { { descriptor___2.modname = "ubi"; descriptor___2.function = "ubi_compare_lebs"; descriptor___2.filename = "drivers/mtd/ubi/attach.c"; descriptor___2.format = "UBI DBG bld (pid %d): PEB %d CRC is OK\n"; descriptor___2.lineno = 412U; descriptor___2.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); } if (tmp___10 != 0L) { { tmp___9 = get_current___1(); __dynamic_pr_debug(& descriptor___2, "UBI DBG bld (pid %d): PEB %d CRC is OK\n", tmp___9->pid, pnum); } } else { } bitflips = err != 0; } { ldv_mutex_unlock_98___0(& ubi->buf_mutex); ubi_free_vid_hdr((struct ubi_device const *)ubi, vh); } if (second_is_newer != 0) { { descriptor___3.modname = "ubi"; descriptor___3.function = "ubi_compare_lebs"; descriptor___3.filename = "drivers/mtd/ubi/attach.c"; descriptor___3.format = "UBI DBG bld (pid %d): second PEB %d is newer, copy_flag is set\n"; descriptor___3.lineno = 420U; descriptor___3.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); } if (tmp___12 != 0L) { { tmp___11 = get_current___1(); __dynamic_pr_debug(& descriptor___3, "UBI DBG bld (pid %d): second PEB %d is newer, copy_flag is set\n", tmp___11->pid, pnum); } } else { } } else { { descriptor___4.modname = "ubi"; descriptor___4.function = "ubi_compare_lebs"; descriptor___4.filename = "drivers/mtd/ubi/attach.c"; descriptor___4.format = "UBI DBG bld (pid %d): first PEB %d is newer, copy_flag is set\n"; descriptor___4.lineno = 422U; descriptor___4.flags = 0U; tmp___14 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); } if (tmp___14 != 0L) { { tmp___13 = get_current___1(); __dynamic_pr_debug(& descriptor___4, "UBI DBG bld (pid %d): first PEB %d is newer, copy_flag is set\n", tmp___13->pid, pnum); } } else { } } return ((second_is_newer | (bitflips << 1)) | (corrupted << 2)); out_unlock: { ldv_mutex_unlock_99___0(& ubi->buf_mutex); } out_free_vidh: { ubi_free_vid_hdr((struct ubi_device const *)ubi, vh); } return (err); } } int ubi_add_to_av(struct ubi_device *ubi , struct ubi_attach_info *ai , int pnum , int ec , struct ubi_vid_hdr const *vid_hdr , int bitflips ) { int err ; int vol_id ; int lnum ; unsigned long long sqnum ; struct ubi_ainf_volume *av ; struct ubi_ainf_peb *aeb ; struct rb_node **p ; struct rb_node *parent ; __u32 tmp ; __u32 tmp___0 ; __u64 tmp___1 ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; bool tmp___5 ; int cmp_res ; struct rb_node const *__mptr ; struct _ddebug descriptor___0 ; struct task_struct *tmp___6 ; long tmp___7 ; __u32 tmp___8 ; int tmp___9 ; void *tmp___10 ; __u32 tmp___11 ; { { parent = (struct rb_node *)0; tmp = __fswab32(vid_hdr->vol_id); vol_id = (int )tmp; tmp___0 = __fswab32(vid_hdr->lnum); lnum = (int )tmp___0; tmp___1 = __fswab64(vid_hdr->sqnum); sqnum = tmp___1; descriptor.modname = "ubi"; descriptor.function = "ubi_add_to_av"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): PEB %d, LEB %d:%d, EC %d, sqnum %llu, bitflips %d\n"; descriptor.lineno = 463U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): PEB %d, LEB %d:%d, EC %d, sqnum %llu, bitflips %d\n", tmp___2->pid, pnum, vol_id, lnum, ec, sqnum, bitflips); } } else { } { av = add_volume(ai, vol_id, pnum, vid_hdr); tmp___5 = IS_ERR((void const *)av); } if ((int )tmp___5) { { tmp___4 = PTR_ERR((void const *)av); } return ((int )tmp___4); } else { } if (ai->max_sqnum < sqnum) { ai->max_sqnum = sqnum; } else { } p = & av->root.rb_node; goto ldv_31538; ldv_31540: parent = *p; __mptr = (struct rb_node const *)parent; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; if (lnum != aeb->lnum) { if (lnum < aeb->lnum) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } goto ldv_31538; } else { } { descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_add_to_av"; descriptor___0.filename = "drivers/mtd/ubi/attach.c"; descriptor___0.format = "UBI DBG bld (pid %d): this LEB already exists: PEB %d, sqnum %llu, EC %d\n"; descriptor___0.lineno = 496U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___7 != 0L) { { tmp___6 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): this LEB already exists: PEB %d, sqnum %llu, EC %d\n", tmp___6->pid, aeb->pnum, aeb->sqnum, aeb->ec); } } else { } if (aeb->sqnum == sqnum && sqnum != 0ULL) { { printk("\vubi%d error: %s: two LEBs with same sequence number %llu\n", ubi->ubi_num, "ubi_add_to_av", sqnum); ubi_dump_aeb((struct ubi_ainf_peb const *)aeb, 0); ubi_dump_vid_hdr(vid_hdr); } return (-22); } else { } { cmp_res = ubi_compare_lebs(ubi, (struct ubi_ainf_peb const *)aeb, pnum, vid_hdr); } if (cmp_res < 0) { return (cmp_res); } else { } if (cmp_res & 1) { { err = validate_vid_hdr___0((struct ubi_device const *)ubi, vid_hdr, (struct ubi_ainf_volume const *)av, pnum); } if (err != 0) { return (err); } else { } { err = add_to_list(ai, aeb->pnum, aeb->vol_id, aeb->lnum, aeb->ec, cmp_res & 4, & ai->erase); } if (err != 0) { return (err); } else { } aeb->ec = ec; aeb->pnum = pnum; aeb->vol_id = vol_id; aeb->lnum = lnum; aeb->scrub = ((cmp_res & 2) | bitflips) != 0; aeb->copy_flag = (unsigned char )vid_hdr->copy_flag; aeb->sqnum = sqnum; if (av->highest_lnum == lnum) { { tmp___8 = __fswab32(vid_hdr->data_size); av->last_data_size = (int )tmp___8; } } else { } return (0); } else { { tmp___9 = add_to_list(ai, pnum, vol_id, lnum, ec, cmp_res & 4, & ai->erase); } return (tmp___9); } ldv_31538: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31540; } else { } { err = validate_vid_hdr___0((struct ubi_device const *)ubi, vid_hdr, (struct ubi_ainf_volume const *)av, pnum); } if (err != 0) { return (err); } else { } { tmp___10 = ldv_kmem_cache_alloc_100(ai->aeb_slab_cache, 208U); aeb = (struct ubi_ainf_peb *)tmp___10; } if ((unsigned long )aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { return (-12); } else { } aeb->ec = ec; aeb->pnum = pnum; aeb->vol_id = vol_id; aeb->lnum = lnum; aeb->scrub = (unsigned char )bitflips; aeb->copy_flag = (unsigned char )vid_hdr->copy_flag; aeb->sqnum = sqnum; if (av->highest_lnum <= lnum) { { av->highest_lnum = lnum; tmp___11 = __fswab32(vid_hdr->data_size); av->last_data_size = (int )tmp___11; } } else { } { av->leb_count = av->leb_count + 1; rb_link_node(& aeb->u.rb, parent, p); rb_insert_color(& aeb->u.rb, & av->root); } return (0); } } struct ubi_ainf_volume *ubi_find_av(struct ubi_attach_info const *ai , int vol_id ) { struct ubi_ainf_volume *av ; struct rb_node *p ; struct rb_node const *__mptr ; { p = ai->volumes.rb_node; goto ldv_31551; ldv_31550: __mptr = (struct rb_node const *)p; av = (struct ubi_ainf_volume *)__mptr + 0xffffffffffffffe0UL; if (vol_id == av->vol_id) { return (av); } else { } if (vol_id > av->vol_id) { p = p->rb_left; } else { p = p->rb_right; } ldv_31551: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_31550; } else { } return ((struct ubi_ainf_volume *)0); } } void ubi_remove_av(struct ubi_attach_info *ai , struct ubi_ainf_volume *av ) { struct rb_node *rb ; struct ubi_ainf_peb *aeb ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct rb_node const *__mptr ; { { descriptor.modname = "ubi"; descriptor.function = "ubi_remove_av"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): remove attaching information about volume %d\n"; descriptor.lineno = 636U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): remove attaching information about volume %d\n", tmp->pid, av->vol_id); } } else { } goto ldv_31564; ldv_31563: { __mptr = (struct rb_node const *)rb; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; rb_erase(& aeb->u.rb, & av->root); list_add_tail(& aeb->u.list, & ai->erase); } ldv_31564: { rb = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_31563; } else { } { rb_erase(& av->rb, & ai->volumes); kfree((void const *)av); ai->vols_found = ai->vols_found + -1; } return; } } static int early_erase_peb(struct ubi_device *ubi , struct ubi_attach_info const *ai , int pnum , int ec ) { int err ; struct ubi_ec_hdr *ec_hdr ; void *tmp ; __u64 tmp___0 ; { if (ec == 2147483647) { { printk("\vubi%d error: %s: erase counter overflow at PEB %d, EC %d\n", ubi->ubi_num, "early_erase_peb", pnum, ec); } return (-22); } else { } { tmp = kzalloc((size_t )ubi->ec_hdr_alsize, 208U); ec_hdr = (struct ubi_ec_hdr *)tmp; } if ((unsigned long )ec_hdr == (unsigned long )((struct ubi_ec_hdr *)0)) { return (-12); } else { } { tmp___0 = __fswab64((__u64 )ec); ec_hdr->ec = tmp___0; err = ubi_io_sync_erase(ubi, pnum, 0); } if (err < 0) { goto out_free; } else { } { err = ubi_io_write_ec_hdr(ubi, pnum, ec_hdr); } out_free: { kfree((void const *)ec_hdr); } return (err); } } struct ubi_ainf_peb *ubi_early_get_peb(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int err ; struct ubi_ainf_peb *aeb ; struct ubi_ainf_peb *tmp_aeb ; struct list_head const *__mptr ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; struct list_head const *__mptr___2 ; void *tmp___4 ; { { err = 0; tmp___1 = list_empty((struct list_head const *)(& ai->free)); } if (tmp___1 == 0) { { __mptr = (struct list_head const *)ai->free.next; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; list_del(& aeb->u.list); descriptor.modname = "ubi"; descriptor.function = "ubi_early_get_peb"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): return free PEB %d, EC %d\n"; descriptor.lineno = 718U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): return free PEB %d, EC %d\n", tmp->pid, aeb->pnum, aeb->ec); } } else { } return (aeb); } else { } __mptr___0 = (struct list_head const *)ai->erase.next; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; __mptr___1 = (struct list_head const *)aeb->u.list.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; goto ldv_31596; ldv_31595: ; if (aeb->ec == -1) { aeb->ec = ai->mean_ec; } else { } { err = early_erase_peb(ubi, (struct ubi_attach_info const *)ai, aeb->pnum, aeb->ec + 1); } if (err != 0) { goto ldv_31593; } else { } { aeb->ec = aeb->ec + 1; list_del(& aeb->u.list); descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_early_get_peb"; descriptor___0.filename = "drivers/mtd/ubi/attach.c"; descriptor___0.format = "UBI DBG bld (pid %d): return PEB %d, EC %d\n"; descriptor___0.lineno = 738U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___3 != 0L) { { tmp___2 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): return PEB %d, EC %d\n", tmp___2->pid, aeb->pnum, aeb->ec); } } else { } return (aeb); ldv_31593: aeb = tmp_aeb; __mptr___2 = (struct list_head const *)tmp_aeb->u.list.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___2 + 0xffffffffffffffe0UL; ldv_31596: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->erase)) { goto ldv_31595; } else { } { printk("\vubi%d error: %s: no free eraseblocks\n", ubi->ubi_num, "ubi_early_get_peb"); tmp___4 = ERR_PTR(-28L); } return ((struct ubi_ainf_peb *)tmp___4); } } static int check_corruption(struct ubi_device *ubi , struct ubi_vid_hdr *vid_hdr , int pnum ) { int err ; int tmp ; int tmp___0 ; { { ldv_mutex_lock_101(& ubi->buf_mutex); __memset(ubi->peb_buf, 0, (size_t )ubi->leb_size); err = ubi_io_read((struct ubi_device const *)ubi, ubi->peb_buf, pnum, ubi->leb_start, ubi->leb_size); } if (err == 5) { err = 0; goto out_unlock; } else { { tmp = mtd_is_eccerr(err); } if (tmp != 0) { err = 0; goto out_unlock; } else { } } if (err != 0) { goto out_unlock; } else { } { tmp___0 = ubi_check_pattern((void const *)ubi->peb_buf, 255, ubi->leb_size); } if (tmp___0 != 0) { goto out_unlock; } else { } { printk("\vubi%d error: %s: PEB %d contains corrupted VID header, and the data does not contain all 0xFF\n", ubi->ubi_num, "check_corruption", pnum); printk("\vubi%d error: %s: this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection\n", ubi->ubi_num, "check_corruption"); ubi_dump_vid_hdr((struct ubi_vid_hdr const *)vid_hdr); printk("\vhexdump of PEB %d offset %d, length %d", pnum, ubi->leb_start, ubi->leb_size); print_hex_dump("\017", "", 2, 32, 1, (void const *)ubi->peb_buf, (size_t )ubi->leb_size, 1); err = 1; } out_unlock: { ldv_mutex_unlock_102(& ubi->buf_mutex); } return (err); } } static int scan_peb(struct ubi_device *ubi , struct ubi_attach_info *ai , int pnum , int *vid , unsigned long long *sqnum ) { long long ec ; int err ; int bitflips ; int vol_id ; int ec_err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; int image_seq ; __u64 tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; __u64 tmp___6 ; int lnum ; __u32 tmp___7 ; { { ec = ec; bitflips = 0; vol_id = -1; ec_err = 0; descriptor.modname = "ubi"; descriptor.function = "scan_peb"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG bld (pid %d): scan PEB %d\n"; descriptor.lineno = 825U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): scan PEB %d\n", tmp->pid, pnum); } } else { } { err = ubi_io_is_bad((struct ubi_device const *)ubi, pnum); } if (err < 0) { return (err); } else if (err != 0) { ai->bad_peb_count = ai->bad_peb_count + 1; return (0); } else { } { err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0); } if (err < 0) { return (err); } else { } { if (err == 0) { goto case_0; } else { } if (err == 5) { goto case_5; } else { } if (err == 1) { goto case_1; } else { } if (err == 2) { goto case_2; } else { } if (err == 4) { goto case_4; } else { } if (err == 3) { goto case_3; } else { } goto switch_default; case_0: /* CIL Label */ ; goto ldv_31621; case_5: /* CIL Label */ bitflips = 1; goto ldv_31621; case_1: /* CIL Label */ { ai->empty_peb_count = ai->empty_peb_count + 1; tmp___1 = add_to_list(ai, pnum, -1, -1, -1, 0, & ai->erase); } return (tmp___1); case_2: /* CIL Label */ { ai->empty_peb_count = ai->empty_peb_count + 1; tmp___2 = add_to_list(ai, pnum, -1, -1, -1, 1, & ai->erase); } return (tmp___2); case_4: /* CIL Label */ ; case_3: /* CIL Label */ ec_err = err; ec = -1LL; bitflips = 1; goto ldv_31621; switch_default: /* CIL Label */ { printk("\vubi%d error: %s: \'ubi_io_read_ec_hdr()\' returned unknown code %d\n", ubi->ubi_num, "scan_peb", err); } return (-22); switch_break: /* CIL Label */ ; } ldv_31621: ; if (ec_err == 0) { if ((unsigned int )ech->version != 1U) { { printk("\vubi%d error: %s: this UBI version is %d, image version is %d\n", ubi->ubi_num, "scan_peb", 1, (int )ech->version); } return (-22); } else { } { tmp___3 = __fswab64(ech->ec); ec = (long long )tmp___3; } if (ec > 2147483647LL) { { printk("\vubi%d error: %s: erase counter overflow, max is %d\n", ubi->ubi_num, "scan_peb", 2147483647); ubi_dump_ec_hdr((struct ubi_ec_hdr const *)ech); } return (-22); } else { } { tmp___4 = __fswab32(ech->image_seq); image_seq = (int )tmp___4; } if (ubi->image_seq == 0) { ubi->image_seq = image_seq; } else { } if (image_seq != 0 && ubi->image_seq != image_seq) { { printk("\vubi%d error: %s: bad image sequence number %d in PEB %d, expected %d\n", ubi->ubi_num, "scan_peb", image_seq, pnum, ubi->image_seq); ubi_dump_ec_hdr((struct ubi_ec_hdr const *)ech); } return (-22); } else { } } else { } { err = ubi_io_read_vid_hdr(ubi, pnum, vidh, 0); } if (err < 0) { return (err); } else { } { if (err == 0) { goto case_0___0; } else { } if (err == 5) { goto case_5___0; } else { } if (err == 4) { goto case_4___0; } else { } if (err == 3) { goto case_3___0; } else { } if (err == 2) { goto case_2___0; } else { } if (err == 1) { goto case_1___0; } else { } goto switch_default___0; case_0___0: /* CIL Label */ ; goto ldv_31630; case_5___0: /* CIL Label */ bitflips = 1; goto ldv_31630; case_4___0: /* CIL Label */ ; if (ec_err == 4) { ai->maybe_bad_peb_count = ai->maybe_bad_peb_count + 1; } else { } case_3___0: /* CIL Label */ ; if (ec_err != 0) { err = 0; } else { { err = check_corruption(ubi, vidh, pnum); } } if (err < 0) { return (err); } else if (err == 0) { { err = add_to_list(ai, pnum, -1, -1, (int )ec, 1, & ai->erase); } } else { { err = add_corrupted(ai, pnum, (int )ec); } } if (err != 0) { return (err); } else { } goto adjust_mean_ec; case_2___0: /* CIL Label */ { err = add_to_list(ai, pnum, -1, -1, (int )ec, 1, & ai->erase); } if (err != 0) { return (err); } else { } goto adjust_mean_ec; case_1___0: /* CIL Label */ ; if ((ec_err | bitflips) != 0) { { err = add_to_list(ai, pnum, -1, -1, (int )ec, 1, & ai->erase); } } else { { err = add_to_list(ai, pnum, -1, -1, (int )ec, 0, & ai->free); } } if (err != 0) { return (err); } else { } goto adjust_mean_ec; switch_default___0: /* CIL Label */ { printk("\vubi%d error: %s: \'ubi_io_read_vid_hdr()\' returned unknown code %d\n", ubi->ubi_num, "scan_peb", err); } return (-22); switch_break___0: /* CIL Label */ ; } ldv_31630: { tmp___5 = __fswab32(vidh->vol_id); vol_id = (int )tmp___5; } if ((unsigned long )vid != (unsigned long )((int *)0)) { *vid = vol_id; } else { } if ((unsigned long )sqnum != (unsigned long )((unsigned long long *)0ULL)) { { tmp___6 = __fswab64(vidh->sqnum); *sqnum = tmp___6; } } else { } if (vol_id > 128 && vol_id != 2147479551) { { tmp___7 = __fswab32(vidh->lnum); lnum = (int )tmp___7; } { if ((int )vidh->compat == 1) { goto case_1___1; } else { } if ((int )vidh->compat == 2) { goto case_2___1; } else { } if ((int )vidh->compat == 4) { goto case_4___1; } else { } if ((int )vidh->compat == 5) { goto case_5___1; } else { } goto switch_break___1; case_1___1: /* CIL Label */ ; if ((unsigned int )vol_id - 2147479552U > 1U) { { printk("\rubi%d: \"delete\" compatible internal volume %d:%d found, will remove it\n", ubi->ubi_num, vol_id, lnum); } } else { } { err = add_to_list(ai, pnum, vol_id, lnum, (int )ec, 1, & ai->erase); } if (err != 0) { return (err); } else { } return (0); case_2___1: /* CIL Label */ { printk("\rubi%d: read-only compatible internal volume %d:%d found, switch to read-only mode\n", ubi->ubi_num, vol_id, lnum); ubi->ro_mode = 1; } goto ldv_31641; case_4___1: /* CIL Label */ { printk("\rubi%d: \"preserve\" compatible internal volume %d:%d found\n", ubi->ubi_num, vol_id, lnum); err = add_to_list(ai, pnum, vol_id, lnum, (int )ec, 0, & ai->alien); } if (err != 0) { return (err); } else { } return (0); case_5___1: /* CIL Label */ { printk("\vubi%d error: %s: incompatible internal volume %d:%d found\n", ubi->ubi_num, "scan_peb", vol_id, lnum); } return (-22); switch_break___1: /* CIL Label */ ; } ldv_31641: ; } else { } if (ec_err != 0) { { printk("\fubi%d warning: %s: valid VID header but corrupted EC header at PEB %d\n", ubi->ubi_num, "scan_peb", pnum); } } else { } { err = ubi_add_to_av(ubi, ai, pnum, (int )ec, (struct ubi_vid_hdr const *)vidh, bitflips); } if (err != 0) { return (err); } else { } adjust_mean_ec: ; if (ec_err == 0) { ai->ec_sum = ai->ec_sum + (unsigned long long )ec; ai->ec_count = ai->ec_count + 1; if (ec > (long long )ai->max_ec) { ai->max_ec = (int )ec; } else { } if (ec < (long long )ai->min_ec) { ai->min_ec = (int )ec; } else { } } else { } return (0); } } static int late_analysis(struct ubi_device *ubi , struct ubi_attach_info *ai ) { struct ubi_ainf_peb *aeb ; int max_corr ; int peb_count ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { peb_count = (ubi->peb_count - ai->bad_peb_count) - ai->alien_peb_count; max_corr = peb_count / 20 != 0 ? peb_count / 20 != 0 : 8; if (ai->corr_peb_count != 0) { { printk("\vubi%d error: %s: %d PEBs are corrupted and preserved\n", ubi->ubi_num, "late_analysis", ai->corr_peb_count); printk("\vCorrupted PEBs are:"); __mptr = (struct list_head const *)ai->corr.next; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; } goto ldv_31657; ldv_31656: { printk(" %d", aeb->pnum); __mptr___0 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; } ldv_31657: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->corr)) { goto ldv_31656; } else { } { printk("\n"); } if (ai->corr_peb_count >= max_corr) { { printk("\vubi%d error: %s: too many corrupted PEBs, refusing\n", ubi->ubi_num, "late_analysis"); } return (-22); } else { } } else { } if (ai->empty_peb_count + ai->maybe_bad_peb_count == peb_count) { if (ai->maybe_bad_peb_count <= 2) { { ai->is_empty = 1; printk("\rubi%d: empty MTD device detected\n", ubi->ubi_num); get_random_bytes((void *)(& ubi->image_seq), 4); } } else { { printk("\vubi%d error: %s: MTD device is not UBI-formatted and possibly contains non-UBI data - refusing it\n", ubi->ubi_num, "late_analysis"); } return (-22); } } else { } return (0); } } static void destroy_av(struct ubi_attach_info *ai , struct ubi_ainf_volume *av ) { struct ubi_ainf_peb *aeb ; struct rb_node *this ; struct rb_node const *__mptr ; { this = av->root.rb_node; goto ldv_31668; ldv_31667: ; if ((unsigned long )this->rb_left != (unsigned long )((struct rb_node *)0)) { this = this->rb_left; } else if ((unsigned long )this->rb_right != (unsigned long )((struct rb_node *)0)) { this = this->rb_right; } else { __mptr = (struct rb_node const *)this; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; this = (struct rb_node *)(this->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )this->rb_left == (unsigned long )(& aeb->u.rb)) { this->rb_left = (struct rb_node *)0; } else { this->rb_right = (struct rb_node *)0; } } else { } { kmem_cache_free(ai->aeb_slab_cache, (void *)aeb); } } ldv_31668: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_31667; } else { } { kfree((void const *)av); } return; } } static void destroy_ai(struct ubi_attach_info *ai ) { struct ubi_ainf_peb *aeb ; struct ubi_ainf_peb *aeb_tmp ; struct ubi_ainf_volume *av ; struct rb_node *rb ; 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 ; struct list_head const *__mptr___4 ; struct list_head const *__mptr___5 ; struct list_head const *__mptr___6 ; struct list_head const *__mptr___7 ; struct list_head const *__mptr___8 ; struct list_head const *__mptr___9 ; struct list_head const *__mptr___10 ; struct rb_node const *__mptr___11 ; { __mptr = (struct list_head const *)ai->alien.next; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; __mptr___0 = (struct list_head const *)aeb->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; goto ldv_31684; ldv_31683: { list_del(& aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)aeb); aeb = aeb_tmp; __mptr___1 = (struct list_head const *)aeb_tmp->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; } ldv_31684: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->alien)) { goto ldv_31683; } else { } __mptr___2 = (struct list_head const *)ai->erase.next; aeb = (struct ubi_ainf_peb *)__mptr___2 + 0xffffffffffffffe0UL; __mptr___3 = (struct list_head const *)aeb->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___3 + 0xffffffffffffffe0UL; goto ldv_31693; ldv_31692: { list_del(& aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)aeb); aeb = aeb_tmp; __mptr___4 = (struct list_head const *)aeb_tmp->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___4 + 0xffffffffffffffe0UL; } ldv_31693: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->erase)) { goto ldv_31692; } else { } __mptr___5 = (struct list_head const *)ai->corr.next; aeb = (struct ubi_ainf_peb *)__mptr___5 + 0xffffffffffffffe0UL; __mptr___6 = (struct list_head const *)aeb->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___6 + 0xffffffffffffffe0UL; goto ldv_31702; ldv_31701: { list_del(& aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)aeb); aeb = aeb_tmp; __mptr___7 = (struct list_head const *)aeb_tmp->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___7 + 0xffffffffffffffe0UL; } ldv_31702: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->corr)) { goto ldv_31701; } else { } __mptr___8 = (struct list_head const *)ai->free.next; aeb = (struct ubi_ainf_peb *)__mptr___8 + 0xffffffffffffffe0UL; __mptr___9 = (struct list_head const *)aeb->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___9 + 0xffffffffffffffe0UL; goto ldv_31711; ldv_31710: { list_del(& aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)aeb); aeb = aeb_tmp; __mptr___10 = (struct list_head const *)aeb_tmp->u.list.next; aeb_tmp = (struct ubi_ainf_peb *)__mptr___10 + 0xffffffffffffffe0UL; } ldv_31711: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->free)) { goto ldv_31710; } else { } rb = ai->volumes.rb_node; goto ldv_31716; ldv_31715: ; if ((unsigned long )rb->rb_left != (unsigned long )((struct rb_node *)0)) { rb = rb->rb_left; } else if ((unsigned long )rb->rb_right != (unsigned long )((struct rb_node *)0)) { rb = rb->rb_right; } else { __mptr___11 = (struct rb_node const *)rb; av = (struct ubi_ainf_volume *)__mptr___11 + 0xffffffffffffffe0UL; rb = (struct rb_node *)(rb->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )rb->rb_left == (unsigned long )(& av->rb)) { rb->rb_left = (struct rb_node *)0; } else { rb->rb_right = (struct rb_node *)0; } } else { } { destroy_av(ai, av); } } ldv_31716: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_31715; } else { } if ((unsigned long )ai->aeb_slab_cache != (unsigned long )((struct kmem_cache *)0)) { { kmem_cache_destroy(ai->aeb_slab_cache); } } else { } { kfree((void const *)ai); } return; } } static int scan_all(struct ubi_device *ubi , struct ubi_attach_info *ai , int start ) { int err ; int pnum ; struct rb_node *rb1 ; struct rb_node *rb2 ; struct ubi_ainf_volume *av ; struct ubi_ainf_peb *aeb ; void *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; u64 tmp___2 ; struct rb_node const *__mptr ; struct rb_node const *__mptr___0 ; struct rb_node const *__mptr___1 ; struct rb_node const *__mptr___2 ; struct list_head const *__mptr___3 ; struct list_head const *__mptr___4 ; struct list_head const *__mptr___5 ; struct list_head const *__mptr___6 ; struct list_head const *__mptr___7 ; struct list_head const *__mptr___8 ; { { err = -12; tmp = kzalloc((size_t )ubi->ec_hdr_alsize, 208U); ech = (struct ubi_ec_hdr *)tmp; } if ((unsigned long )ech == (unsigned long )((struct ubi_ec_hdr *)0)) { return (err); } else { } { vidh = ubi_zalloc_vid_hdr___3((struct ubi_device const *)ubi, 208U); } if ((unsigned long )vidh == (unsigned long )((struct ubi_vid_hdr *)0)) { goto out_ech; } else { } pnum = start; goto ldv_31735; ldv_31734: { ___might_sleep("drivers/mtd/ubi/attach.c", 1247, 0); _cond_resched(); descriptor.modname = "ubi"; descriptor.function = "scan_all"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG gen (pid %d): process PEB %d\n"; descriptor.lineno = 1249U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): process PEB %d\n", tmp___0->pid, pnum); } } else { } { err = scan_peb(ubi, ai, pnum, (int *)0, (unsigned long long *)0ULL); } if (err < 0) { goto out_vidh; } else { } pnum = pnum + 1; ldv_31735: ; if (pnum < ubi->peb_count) { goto ldv_31734; } else { } { printk("\rubi%d: scanning is finished\n", ubi->ubi_num); } if (ai->ec_count != 0) { { tmp___2 = div_u64(ai->ec_sum, (u32 )ai->ec_count); ai->mean_ec = (int )tmp___2; } } else { } { err = late_analysis(ubi, ai); } if (err != 0) { goto out_vidh; } else { } { rb1 = rb_first((struct rb_root const *)(& ai->volumes)); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } goto ldv_31749; ldv_31748: { rb2 = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___0 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31746; ldv_31745: ; if (aeb->ec == -1) { aeb->ec = ai->mean_ec; } else { } { rb2 = rb_next((struct rb_node const *)rb2); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___1 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31746: ; if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { goto ldv_31745; } else { } { rb1 = rb_next((struct rb_node const *)rb1); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___2 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___2 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } ldv_31749: ; if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { goto ldv_31748; } else { } __mptr___3 = (struct list_head const *)ai->free.next; aeb = (struct ubi_ainf_peb *)__mptr___3 + 0xffffffffffffffe0UL; goto ldv_31756; ldv_31755: ; if (aeb->ec == -1) { aeb->ec = ai->mean_ec; } else { } __mptr___4 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___4 + 0xffffffffffffffe0UL; ldv_31756: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->free)) { goto ldv_31755; } else { } __mptr___5 = (struct list_head const *)ai->corr.next; aeb = (struct ubi_ainf_peb *)__mptr___5 + 0xffffffffffffffe0UL; goto ldv_31763; ldv_31762: ; if (aeb->ec == -1) { aeb->ec = ai->mean_ec; } else { } __mptr___6 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___6 + 0xffffffffffffffe0UL; ldv_31763: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->corr)) { goto ldv_31762; } else { } __mptr___7 = (struct list_head const *)ai->erase.next; aeb = (struct ubi_ainf_peb *)__mptr___7 + 0xffffffffffffffe0UL; goto ldv_31770; ldv_31769: ; if (aeb->ec == -1) { aeb->ec = ai->mean_ec; } else { } __mptr___8 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___8 + 0xffffffffffffffe0UL; ldv_31770: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->erase)) { goto ldv_31769; } else { } { err = self_check_ai(ubi, ai); } if (err != 0) { goto out_vidh; } else { } { ubi_free_vid_hdr((struct ubi_device const *)ubi, vidh); kfree((void const *)ech); } return (0); out_vidh: { ubi_free_vid_hdr((struct ubi_device const *)ubi, vidh); } out_ech: { kfree((void const *)ech); } return (err); } } static int scan_fast(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int err ; int pnum ; int fm_anchor ; unsigned long long max_sqnum ; void *tmp ; int vol_id ; unsigned long long sqnum ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; { { fm_anchor = -1; max_sqnum = 0ULL; err = -12; tmp = kzalloc((size_t )ubi->ec_hdr_alsize, 208U); ech = (struct ubi_ec_hdr *)tmp; } if ((unsigned long )ech == (unsigned long )((struct ubi_ec_hdr *)0)) { goto out; } else { } { vidh = ubi_zalloc_vid_hdr___3((struct ubi_device const *)ubi, 208U); } if ((unsigned long )vidh == (unsigned long )((struct ubi_vid_hdr *)0)) { goto out_ech; } else { } pnum = 0; goto ldv_31789; ldv_31788: { vol_id = -1; sqnum = 0xffffffffffffffffULL; ___might_sleep("drivers/mtd/ubi/attach.c", 1334, 0); _cond_resched(); descriptor.modname = "ubi"; descriptor.function = "scan_fast"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG gen (pid %d): process PEB %d\n"; descriptor.lineno = 1336U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): process PEB %d\n", tmp___0->pid, pnum); } } else { } { err = scan_peb(ubi, ai, pnum, & vol_id, & sqnum); } if (err < 0) { goto out_vidh; } else { } if (vol_id == 2147479552 && sqnum > max_sqnum) { max_sqnum = sqnum; fm_anchor = pnum; } else { } pnum = pnum + 1; ldv_31789: ; if (pnum <= 63) { goto ldv_31788; } else { } { ubi_free_vid_hdr((struct ubi_device const *)ubi, vidh); kfree((void const *)ech); } if (fm_anchor < 0) { return (1); } else { } { tmp___2 = ubi_scan_fastmap(ubi, ai, fm_anchor); } return (tmp___2); out_vidh: { ubi_free_vid_hdr((struct ubi_device const *)ubi, vidh); } out_ech: { kfree((void const *)ech); } out: ; return (err); } } static struct ubi_attach_info *alloc_ai(char const *slab_name ) { struct ubi_attach_info *ai ; void *tmp ; struct rb_root __constr_expr_0 ; { { tmp = kzalloc(152UL, 208U); ai = (struct ubi_attach_info *)tmp; } if ((unsigned long )ai == (unsigned long )((struct ubi_attach_info *)0)) { return (ai); } else { } { INIT_LIST_HEAD(& ai->corr); INIT_LIST_HEAD(& ai->free); INIT_LIST_HEAD(& ai->erase); INIT_LIST_HEAD(& ai->alien); __constr_expr_0.rb_node = (struct rb_node *)0; ai->volumes = __constr_expr_0; ai->aeb_slab_cache = kmem_cache_create(slab_name, 56UL, 0UL, 0UL, (void (*)(void * ))0); } if ((unsigned long )ai->aeb_slab_cache == (unsigned long )((struct kmem_cache *)0)) { { kfree((void const *)ai); ai = (struct ubi_attach_info *)0; } } else { } return (ai); } } int ubi_attach(struct ubi_device *ubi , int force_scan ) { int err ; struct ubi_attach_info *ai ; uint32_t tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct ubi_attach_info *scan_ai ; int tmp___2 ; { { ai = alloc_ai("ubi_aeb_slab_cache"); } if ((unsigned long )ai == (unsigned long )((struct ubi_attach_info *)0)) { return (-12); } else { } { tmp = mtd_div_by_eb((ubi->mtd)->size, ubi->mtd); } if ((int )tmp <= 64) { ubi->fm_disabled = 1; force_scan = 1; } else { } if (force_scan != 0) { { err = scan_all(ubi, ai, 0); } } else { { err = scan_fast(ubi, ai); } if (err > 0) { if (err != 1) { { destroy_ai(ai); ai = alloc_ai("ubi_aeb_slab_cache2"); } if ((unsigned long )ai == (unsigned long )((struct ubi_attach_info *)0)) { return (-12); } else { } { err = scan_all(ubi, ai, 0); } } else { { err = scan_all(ubi, ai, 64); } } } else { } } if (err != 0) { goto out_ai; } else { } { ubi->bad_peb_count = ai->bad_peb_count; ubi->good_peb_count = ubi->peb_count - ubi->bad_peb_count; ubi->corr_peb_count = ai->corr_peb_count; ubi->max_ec = ai->max_ec; ubi->mean_ec = ai->mean_ec; descriptor.modname = "ubi"; descriptor.function = "ubi_attach"; descriptor.filename = "drivers/mtd/ubi/attach.c"; descriptor.format = "UBI DBG gen (pid %d): max. sequence number: %llu\n"; descriptor.lineno = 1441U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG gen (pid %d): max. sequence number: %llu\n", tmp___0->pid, ai->max_sqnum); } } else { } { err = ubi_read_volume_table(ubi, ai); } if (err != 0) { goto out_ai; } else { } { err = ubi_wl_init(ubi, ai); } if (err != 0) { goto out_vtbl; } else { } { err = ubi_eba_init(ubi, ai); } if (err != 0) { goto out_wl; } else { } if ((unsigned long )ubi->fm != (unsigned long )((struct ubi_fastmap_layout *)0)) { { tmp___2 = ubi_dbg_chk_gen((struct ubi_device const *)ubi); } if (tmp___2 != 0) { { scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache"); } if ((unsigned long )scan_ai == (unsigned long )((struct ubi_attach_info *)0)) { err = -12; goto out_wl; } else { } { err = scan_all(ubi, scan_ai, 0); } if (err != 0) { { destroy_ai(scan_ai); } goto out_wl; } else { } { err = self_check_eba(ubi, ai, scan_ai); destroy_ai(scan_ai); } if (err != 0) { goto out_wl; } else { } } else { } } else { } { destroy_ai(ai); } return (0); out_wl: { ubi_wl_close(ubi); } out_vtbl: { ubi_free_internal_volumes(ubi); vfree((void const *)ubi->vtbl); } out_ai: { destroy_ai(ai); } return (err); } } static int self_check_ai(struct ubi_device *ubi , struct ubi_attach_info *ai ) { int pnum ; int err ; int vols_found ; struct rb_node *rb1 ; struct rb_node *rb2 ; struct ubi_ainf_volume *av ; struct ubi_ainf_peb *aeb ; struct ubi_ainf_peb *last_aeb ; uint8_t *buf ; int tmp ; struct rb_node const *__mptr ; int leb_count ; struct rb_node const *__mptr___0 ; struct rb_node const *__mptr___1 ; struct rb_node const *__mptr___2 ; struct rb_node const *__mptr___3 ; struct rb_node const *__mptr___4 ; int vol_type ; __u64 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; struct rb_node const *__mptr___5 ; __u32 tmp___5 ; __u32 tmp___6 ; struct rb_node const *__mptr___6 ; void *tmp___7 ; struct rb_node const *__mptr___7 ; struct rb_node const *__mptr___8 ; struct rb_node const *__mptr___9 ; struct rb_node const *__mptr___10 ; struct list_head const *__mptr___11 ; struct list_head const *__mptr___12 ; struct list_head const *__mptr___13 ; struct list_head const *__mptr___14 ; struct list_head const *__mptr___15 ; struct list_head const *__mptr___16 ; struct list_head const *__mptr___17 ; struct list_head const *__mptr___18 ; { { vols_found = 0; tmp = ubi_dbg_chk_gen((struct ubi_device const *)ubi); } if (tmp == 0) { return (0); } else { } { rb1 = rb_first((struct rb_root const *)(& ai->volumes)); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } goto ldv_31841; ldv_31840: { leb_count = 0; ___might_sleep("drivers/mtd/ubi/attach.c", 1517, 0); _cond_resched(); vols_found = vols_found + 1; } if (ai->is_empty != 0) { { printk("\vubi%d error: %s: bad is_empty flag\n", ubi->ubi_num, "self_check_ai"); } goto bad_av; } else { } if ((((((av->vol_id < 0 || av->highest_lnum < 0) || av->leb_count < 0) || av->vol_type < 0) || av->used_ebs < 0) || av->data_pad < 0) || av->last_data_size < 0) { { printk("\vubi%d error: %s: negative values\n", ubi->ubi_num, "self_check_ai"); } goto bad_av; } else { } if ((unsigned int )av->vol_id - 128U <= 2147479422U) { { printk("\vubi%d error: %s: bad vol_id\n", ubi->ubi_num, "self_check_ai"); } goto bad_av; } else { } if (av->vol_id > ai->highest_vol_id) { { printk("\vubi%d error: %s: highest_vol_id is %d, but vol_id %d is there\n", ubi->ubi_num, "self_check_ai", ai->highest_vol_id, av->vol_id); } goto out; } else { } if ((unsigned int )av->vol_type - 3U > 1U) { { printk("\vubi%d error: %s: bad vol_type\n", ubi->ubi_num, "self_check_ai"); } goto bad_av; } else { } if (av->data_pad > ubi->leb_size / 2) { { printk("\vubi%d error: %s: bad data_pad\n", ubi->ubi_num, "self_check_ai"); } goto bad_av; } else { } { last_aeb = (struct ubi_ainf_peb *)0; rb2 = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___0 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31837; ldv_31836: { ___might_sleep("drivers/mtd/ubi/attach.c", 1558, 0); _cond_resched(); last_aeb = aeb; leb_count = leb_count + 1; } if (aeb->pnum < 0 || aeb->ec < 0) { { printk("\vubi%d error: %s: negative values\n", ubi->ubi_num, "self_check_ai"); } goto bad_aeb; } else { } if (aeb->ec < ai->min_ec) { { printk("\vubi%d error: %s: bad ai->min_ec (%d), %d found\n", ubi->ubi_num, "self_check_ai", ai->min_ec, aeb->ec); } goto bad_aeb; } else { } if (aeb->ec > ai->max_ec) { { printk("\vubi%d error: %s: bad ai->max_ec (%d), %d found\n", ubi->ubi_num, "self_check_ai", ai->max_ec, aeb->ec); } goto bad_aeb; } else { } if (aeb->pnum >= ubi->peb_count) { { printk("\vubi%d error: %s: too high PEB number %d, total PEBs %d\n", ubi->ubi_num, "self_check_ai", aeb->pnum, ubi->peb_count); } goto bad_aeb; } else { } if (av->vol_type == 4) { if (aeb->lnum >= av->used_ebs) { { printk("\vubi%d error: %s: bad lnum or used_ebs\n", ubi->ubi_num, "self_check_ai"); } goto bad_aeb; } else { } } else if (av->used_ebs != 0) { { printk("\vubi%d error: %s: non-zero used_ebs\n", ubi->ubi_num, "self_check_ai"); } goto bad_aeb; } else { } if (aeb->lnum > av->highest_lnum) { { printk("\vubi%d error: %s: incorrect highest_lnum or lnum\n", ubi->ubi_num, "self_check_ai"); } goto bad_aeb; } else { } { rb2 = rb_next((struct rb_node const *)rb2); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___1 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31837: ; if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { goto ldv_31836; } else { } if (av->leb_count != leb_count) { { printk("\vubi%d error: %s: bad leb_count, %d objects in the tree\n", ubi->ubi_num, "self_check_ai", leb_count); } goto bad_av; } else { } if ((unsigned long )last_aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { goto ldv_31839; } else { } aeb = last_aeb; if (aeb->lnum != av->highest_lnum) { { printk("\vubi%d error: %s: bad highest_lnum\n", ubi->ubi_num, "self_check_ai"); } goto bad_aeb; } else { } ldv_31839: { rb1 = rb_next((struct rb_node const *)rb1); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___2 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___2 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } ldv_31841: ; if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { goto ldv_31840; } else { } if (vols_found != ai->vols_found) { { printk("\vubi%d error: %s: bad ai->vols_found %d, should be %d\n", ubi->ubi_num, "self_check_ai", ai->vols_found, vols_found); } goto out; } else { } { rb1 = rb_first((struct rb_root const *)(& ai->volumes)); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___3 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___3 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } goto ldv_31859; ldv_31858: { last_aeb = (struct ubi_ainf_peb *)0; rb2 = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___4 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___4 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31855; ldv_31854: { ___might_sleep("drivers/mtd/ubi/attach.c", 1633, 0); _cond_resched(); last_aeb = aeb; err = ubi_io_read_vid_hdr(ubi, aeb->pnum, vidh, 1); } if (err != 0 && err != 5) { { printk("\vubi%d error: %s: VID header is not OK (%d)\n", ubi->ubi_num, "self_check_ai", err); } if (err > 0) { err = -5; } else { } return (err); } else { } vol_type = (unsigned int )vidh->vol_type == 1U ? 3 : 4; if (av->vol_type != vol_type) { { printk("\vubi%d error: %s: bad vol_type\n", ubi->ubi_num, "self_check_ai"); } goto bad_vid_hdr; } else { } { tmp___0 = __fswab64(vidh->sqnum); } if (aeb->sqnum != tmp___0) { { printk("\vubi%d error: %s: bad sqnum %llu\n", ubi->ubi_num, "self_check_ai", aeb->sqnum); } goto bad_vid_hdr; } else { } { tmp___1 = __fswab32(vidh->vol_id); } if ((unsigned int )av->vol_id != tmp___1) { { printk("\vubi%d error: %s: bad vol_id %d\n", ubi->ubi_num, "self_check_ai", av->vol_id); } goto bad_vid_hdr; } else { } if (av->compat != (int )vidh->compat) { { printk("\vubi%d error: %s: bad compat %d\n", ubi->ubi_num, "self_check_ai", (int )vidh->compat); } goto bad_vid_hdr; } else { } { tmp___2 = __fswab32(vidh->lnum); } if ((unsigned int )aeb->lnum != tmp___2) { { printk("\vubi%d error: %s: bad lnum %d\n", ubi->ubi_num, "self_check_ai", aeb->lnum); } goto bad_vid_hdr; } else { } { tmp___3 = __fswab32(vidh->used_ebs); } if ((unsigned int )av->used_ebs != tmp___3) { { printk("\vubi%d error: %s: bad used_ebs %d\n", ubi->ubi_num, "self_check_ai", av->used_ebs); } goto bad_vid_hdr; } else { } { tmp___4 = __fswab32(vidh->data_pad); } if ((unsigned int )av->data_pad != tmp___4) { { printk("\vubi%d error: %s: bad data_pad %d\n", ubi->ubi_num, "self_check_ai", av->data_pad); } goto bad_vid_hdr; } else { } { rb2 = rb_next((struct rb_node const *)rb2); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___5 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___5 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31855: ; if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { goto ldv_31854; } else { } if ((unsigned long )last_aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { goto ldv_31857; } else { } { tmp___5 = __fswab32(vidh->lnum); } if ((unsigned int )av->highest_lnum != tmp___5) { { printk("\vubi%d error: %s: bad highest_lnum %d\n", ubi->ubi_num, "self_check_ai", av->highest_lnum); } goto bad_vid_hdr; } else { } { tmp___6 = __fswab32(vidh->data_size); } if ((unsigned int )av->last_data_size != tmp___6) { { printk("\vubi%d error: %s: bad last_data_size %d\n", ubi->ubi_num, "self_check_ai", av->last_data_size); } goto bad_vid_hdr; } else { } ldv_31857: { rb1 = rb_next((struct rb_node const *)rb1); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___6 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___6 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } ldv_31859: ; if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { goto ldv_31858; } else { } { tmp___7 = kzalloc((size_t )ubi->peb_count, 208U); buf = (uint8_t *)tmp___7; } if ((unsigned long )buf == (unsigned long )((uint8_t *)0U)) { return (-12); } else { } pnum = 0; goto ldv_31862; ldv_31861: { err = ubi_io_is_bad((struct ubi_device const *)ubi, pnum); } if (err < 0) { { kfree((void const *)buf); } return (err); } else if (err != 0) { *(buf + (unsigned long )pnum) = 1U; } else { } pnum = pnum + 1; ldv_31862: ; if (pnum < ubi->peb_count) { goto ldv_31861; } else { } { rb1 = rb_first((struct rb_root const *)(& ai->volumes)); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___7 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___7 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } goto ldv_31876; ldv_31875: { rb2 = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___8 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___8 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31873; ldv_31872: { *(buf + (unsigned long )aeb->pnum) = 1U; rb2 = rb_next((struct rb_node const *)rb2); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___9 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___9 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31873: ; if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { goto ldv_31872; } else { } { rb1 = rb_next((struct rb_node const *)rb1); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___10 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___10 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } ldv_31876: ; if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { goto ldv_31875; } else { } __mptr___11 = (struct list_head const *)ai->free.next; aeb = (struct ubi_ainf_peb *)__mptr___11 + 0xffffffffffffffe0UL; goto ldv_31883; ldv_31882: *(buf + (unsigned long )aeb->pnum) = 1U; __mptr___12 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___12 + 0xffffffffffffffe0UL; ldv_31883: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->free)) { goto ldv_31882; } else { } __mptr___13 = (struct list_head const *)ai->corr.next; aeb = (struct ubi_ainf_peb *)__mptr___13 + 0xffffffffffffffe0UL; goto ldv_31890; ldv_31889: *(buf + (unsigned long )aeb->pnum) = 1U; __mptr___14 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___14 + 0xffffffffffffffe0UL; ldv_31890: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->corr)) { goto ldv_31889; } else { } __mptr___15 = (struct list_head const *)ai->erase.next; aeb = (struct ubi_ainf_peb *)__mptr___15 + 0xffffffffffffffe0UL; goto ldv_31897; ldv_31896: *(buf + (unsigned long )aeb->pnum) = 1U; __mptr___16 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___16 + 0xffffffffffffffe0UL; ldv_31897: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->erase)) { goto ldv_31896; } else { } __mptr___17 = (struct list_head const *)ai->alien.next; aeb = (struct ubi_ainf_peb *)__mptr___17 + 0xffffffffffffffe0UL; goto ldv_31904; ldv_31903: *(buf + (unsigned long )aeb->pnum) = 1U; __mptr___18 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___18 + 0xffffffffffffffe0UL; ldv_31904: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->alien)) { goto ldv_31903; } else { } err = 0; pnum = 0; goto ldv_31907; ldv_31906: ; if ((unsigned int )*(buf + (unsigned long )pnum) == 0U) { { printk("\vubi%d error: %s: PEB %d is not referred\n", ubi->ubi_num, "self_check_ai", pnum); err = 1; } } else { } pnum = pnum + 1; ldv_31907: ; if (pnum < ubi->peb_count) { goto ldv_31906; } else { } { kfree((void const *)buf); } if (err != 0) { goto out; } else { } return (0); bad_aeb: { printk("\vubi%d error: %s: bad attaching information about LEB %d\n", ubi->ubi_num, "self_check_ai", aeb->lnum); ubi_dump_aeb((struct ubi_ainf_peb const *)aeb, 0); ubi_dump_av((struct ubi_ainf_volume const *)av); } goto out; bad_av: { printk("\vubi%d error: %s: bad attaching information about volume %d\n", ubi->ubi_num, "self_check_ai", av->vol_id); ubi_dump_av((struct ubi_ainf_volume const *)av); } goto out; bad_vid_hdr: { printk("\vubi%d error: %s: bad attaching information about volume %d\n", ubi->ubi_num, "self_check_ai", av->vol_id); ubi_dump_av((struct ubi_ainf_volume const *)av); ubi_dump_vid_hdr((struct ubi_vid_hdr const *)vidh); } out: { dump_stack(); } return (-22); } } static void *ldv_kmem_cache_alloc_95(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_kmem_cache_alloc_96(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_lock_97___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_98___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_99___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void *ldv_kmem_cache_alloc_100(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_lock_101(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_102(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void *ldv_vmalloc_95(unsigned long ldv_func_arg1 ) ; int ubi_calc_data_len(struct ubi_device const *ubi , void const *buf , int length ) { int i ; struct task_struct *tmp ; long tmp___0 ; { { tmp___0 = ldv__builtin_expect((length & ((int )ubi->min_io_size + -1)) != 0, 0L); } if (tmp___0 != 0L) { { tmp = get_current(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_calc_data_len", 40, tmp->pid); dump_stack(); } } else { } i = length + -1; goto ldv_31373; ldv_31372: ; if ((unsigned int )((unsigned char )*((uint8_t const *)buf + (unsigned long )i)) != 255U) { goto ldv_31371; } else { } i = i - 1; ldv_31373: ; if (i >= 0) { goto ldv_31372; } else { } ldv_31371: length = ((i + 1) + ((int )ubi->min_io_size + -1)) & - ((int )ubi->min_io_size); return (length); } } int ubi_check_volume(struct ubi_device *ubi , int vol_id ) { void *buf ; int err ; int i ; struct ubi_volume *vol ; int size ; int tmp ; { err = 0; vol = ubi->volumes[vol_id]; if (vol->vol_type != 4) { return (0); } else { } { buf = ldv_vmalloc_95((unsigned long )vol->usable_leb_size); } if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } i = 0; goto ldv_31386; ldv_31385: { ___might_sleep("drivers/mtd/ubi/misc.c", 77, 0); _cond_resched(); } if (i == vol->used_ebs + -1) { size = vol->last_eb_bytes; } else { size = vol->usable_leb_size; } { err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1); } if (err != 0) { { tmp = mtd_is_eccerr(err); } if (tmp != 0) { err = 1; } else { } goto ldv_31384; } else { } i = i + 1; ldv_31386: ; if (i < vol->used_ebs) { goto ldv_31385; } else { } ldv_31384: { vfree((void const *)buf); } return (err); } } void ubi_update_reserved(struct ubi_device *ubi ) { int need ; int __min1 ; int __min2 ; { need = ubi->beb_rsvd_level - ubi->beb_rsvd_pebs; if (need <= 0 || ubi->avail_pebs == 0) { return; } else { } { __min1 = need; __min2 = ubi->avail_pebs; need = __min1 < __min2 ? __min1 : __min2; ubi->avail_pebs = ubi->avail_pebs - need; ubi->rsvd_pebs = ubi->rsvd_pebs + need; ubi->beb_rsvd_pebs = ubi->beb_rsvd_pebs + need; printk("\rubi%d: reserved more %d PEBs for bad PEB handling\n", ubi->ubi_num, need); } return; } } void ubi_calculate_reserved(struct ubi_device *ubi ) { { ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count; if (ubi->beb_rsvd_level < 0) { { ubi->beb_rsvd_level = 0; printk("\fubi%d warning: %s: number of bad PEBs (%d) is above the expected limit (%d), not reserving any PEBs for bad PEB handling, will use available PEBs (if any)\n", ubi->ubi_num, "ubi_calculate_reserved", ubi->bad_peb_count, ubi->bad_peb_limit); } } else { } return; } } int ubi_check_pattern(void const *buf , uint8_t patt , int size ) { int i ; { i = 0; goto ldv_31405; ldv_31404: ; if ((int )((unsigned char )*((uint8_t const *)buf + (unsigned long )i)) != (int )patt) { return (0); } else { } i = i + 1; ldv_31405: ; if (i < size) { goto ldv_31404; } else { } return (1); } } static void *ldv_vmalloc_95(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } extern int snprintf(char * , size_t , char const * , ...) ; __inline static void *ERR_PTR(long error ) ; __inline static long PTR_ERR(void const *ptr ) ; __inline static bool IS_ERR_OR_NULL(void const *ptr ) { long tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { { tmp = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); } if (tmp != 0L) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((bool )tmp___0); } } static void *ldv_vmalloc_95___0(unsigned long ldv_func_arg1 ) ; extern int simple_open(struct inode * , struct file * ) ; extern ssize_t simple_read_from_buffer(void * , size_t , loff_t * , void const * , size_t ) ; extern struct dentry *debugfs_create_file(char const * , umode_t , struct dentry * , void * , struct file_operations const * ) ; extern struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern void debugfs_remove(struct dentry * ) ; extern void debugfs_remove_recursive(struct dentry * ) ; void ubi_dump_flash(struct ubi_device *ubi , int pnum , int offset , int len ) { int err ; size_t read ; void *buf ; loff_t addr ; { { addr = (long long )pnum * (long long )ubi->peb_size + (long long )offset; buf = ldv_vmalloc_95___0((unsigned long )len); } if ((unsigned long )buf == (unsigned long )((void *)0)) { return; } else { } { err = mtd_read(ubi->mtd, addr, (size_t )len, & read, (u_char *)buf); } if (err != 0 && err != -117) { { printk("\vubi%d error: %s: err %d while reading %d bytes from PEB %d:%d, read %zd bytes\n", ubi->ubi_num, "ubi_dump_flash", err, len, pnum, offset, read); } goto out; } else { } { printk("\rubi%d: dumping %d bytes of data from PEB %d, offset %d\n", ubi->ubi_num, len, pnum, offset); print_hex_dump("\017", "", 2, 32, 1, (void const *)buf, (size_t )len, 1); } out: { vfree((void const *)buf); } return; } } void ubi_dump_ec_hdr(struct ubi_ec_hdr const *ec_hdr ) { __u32 tmp ; __u64 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; { { printk("\vErase counter header dump:\n"); tmp = __fswab32(ec_hdr->magic); printk("\v\tmagic %#08x\n", tmp); printk("\v\tversion %d\n", (int )ec_hdr->version); tmp___0 = __fswab64(ec_hdr->ec); printk("\v\tec %llu\n", (long long )tmp___0); tmp___1 = __fswab32(ec_hdr->vid_hdr_offset); printk("\v\tvid_hdr_offset %d\n", tmp___1); tmp___2 = __fswab32(ec_hdr->data_offset); printk("\v\tdata_offset %d\n", tmp___2); tmp___3 = __fswab32(ec_hdr->image_seq); printk("\v\timage_seq %d\n", tmp___3); tmp___4 = __fswab32(ec_hdr->hdr_crc); printk("\v\thdr_crc %#08x\n", tmp___4); printk("\verase counter header hexdump:\n"); print_hex_dump("\017", "", 2, 32, 1, (void const *)ec_hdr, 64UL, 1); } return; } } void ubi_dump_vid_hdr(struct ubi_vid_hdr const *vid_hdr ) { __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u64 tmp___5 ; __u32 tmp___6 ; { { printk("\vVolume identifier header dump:\n"); tmp = __fswab32(vid_hdr->magic); printk("\v\tmagic %08x\n", tmp); printk("\v\tversion %d\n", (int )vid_hdr->version); printk("\v\tvol_type %d\n", (int )vid_hdr->vol_type); printk("\v\tcopy_flag %d\n", (int )vid_hdr->copy_flag); printk("\v\tcompat %d\n", (int )vid_hdr->compat); tmp___0 = __fswab32(vid_hdr->vol_id); printk("\v\tvol_id %d\n", tmp___0); tmp___1 = __fswab32(vid_hdr->lnum); printk("\v\tlnum %d\n", tmp___1); tmp___2 = __fswab32(vid_hdr->data_size); printk("\v\tdata_size %d\n", tmp___2); tmp___3 = __fswab32(vid_hdr->used_ebs); printk("\v\tused_ebs %d\n", tmp___3); tmp___4 = __fswab32(vid_hdr->data_pad); printk("\v\tdata_pad %d\n", tmp___4); tmp___5 = __fswab64(vid_hdr->sqnum); printk("\v\tsqnum %llu\n", tmp___5); tmp___6 = __fswab32(vid_hdr->hdr_crc); printk("\v\thdr_crc %08x\n", tmp___6); printk("\vVolume identifier header hexdump:\n"); print_hex_dump("\017", "", 2, 32, 1, (void const *)vid_hdr, 64UL, 1); } return; } } void ubi_dump_vol_info(struct ubi_volume const *vol ) { __kernel_size_t tmp ; { { printk("\vVolume information dump:\n"); printk("\v\tvol_id %d\n", vol->vol_id); printk("\v\treserved_pebs %d\n", vol->reserved_pebs); printk("\v\talignment %d\n", vol->alignment); printk("\v\tdata_pad %d\n", vol->data_pad); printk("\v\tvol_type %d\n", vol->vol_type); printk("\v\tname_len %d\n", vol->name_len); printk("\v\tusable_leb_size %d\n", vol->usable_leb_size); printk("\v\tused_ebs %d\n", vol->used_ebs); printk("\v\tused_bytes %lld\n", vol->used_bytes); printk("\v\tlast_eb_bytes %d\n", vol->last_eb_bytes); printk("\v\tcorrupted %d\n", (int )vol->corrupted); printk("\v\tupd_marker %d\n", (int )vol->upd_marker); } if ((int )vol->name_len <= 127) { { tmp = strnlen((char const *)(& vol->name), (__kernel_size_t )((int )vol->name_len + 1)); } if (tmp == (__kernel_size_t )vol->name_len) { { printk("\v\tname %s\n", (char const *)(& vol->name)); } } else { { printk("\v\t1st 5 characters of name: %c%c%c%c%c\n", (int )vol->name[0], (int )vol->name[1], (int )vol->name[2], (int )vol->name[3], (int )vol->name[4]); } } } else { { printk("\v\t1st 5 characters of name: %c%c%c%c%c\n", (int )vol->name[0], (int )vol->name[1], (int )vol->name[2], (int )vol->name[3], (int )vol->name[4]); } } return; } } void ubi_dump_vtbl_record(struct ubi_vtbl_record const *r , int idx ) { int name_len ; __u16 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __kernel_size_t tmp___3 ; __u32 tmp___4 ; { { tmp = __fswab16((int )r->name_len); name_len = (int )tmp; printk("\vVolume table record %d dump:\n", idx); tmp___0 = __fswab32(r->reserved_pebs); printk("\v\treserved_pebs %d\n", tmp___0); tmp___1 = __fswab32(r->alignment); printk("\v\talignment %d\n", tmp___1); tmp___2 = __fswab32(r->data_pad); printk("\v\tdata_pad %d\n", tmp___2); printk("\v\tvol_type %d\n", (int )r->vol_type); printk("\v\tupd_marker %d\n", (int )r->upd_marker); printk("\v\tname_len %d\n", name_len); } if ((unsigned int )r->name[0] == 0U) { { printk("\v\tname NULL\n"); } return; } else { } if (name_len <= 127) { { tmp___3 = strnlen((char const *)(& r->name), (__kernel_size_t )(name_len + 1)); } if (tmp___3 == (__kernel_size_t )name_len) { { printk("\v\tname %s\n", (__u8 const *)(& r->name)); } } else { { printk("\v\t1st 5 characters of name: %c%c%c%c%c\n", (int )r->name[0], (int )r->name[1], (int )r->name[2], (int )r->name[3], (int )r->name[4]); } } } else { { printk("\v\t1st 5 characters of name: %c%c%c%c%c\n", (int )r->name[0], (int )r->name[1], (int )r->name[2], (int )r->name[3], (int )r->name[4]); } } { tmp___4 = __fswab32(r->crc); printk("\v\tcrc %#08x\n", tmp___4); } return; } } void ubi_dump_av(struct ubi_ainf_volume const *av ) { { { printk("\vVolume attaching information dump:\n"); printk("\v\tvol_id %d\n", av->vol_id); printk("\v\thighest_lnum %d\n", av->highest_lnum); printk("\v\tleb_count %d\n", av->leb_count); printk("\v\tcompat %d\n", av->compat); printk("\v\tvol_type %d\n", av->vol_type); printk("\v\tused_ebs %d\n", av->used_ebs); printk("\v\tlast_data_size %d\n", av->last_data_size); printk("\v\tdata_pad %d\n", av->data_pad); } return; } } void ubi_dump_aeb(struct ubi_ainf_peb const *aeb , int type ) { { { printk("\veraseblock attaching information dump:\n"); printk("\v\tec %d\n", aeb->ec); printk("\v\tpnum %d\n", aeb->pnum); } if (type == 0) { { printk("\v\tlnum %d\n", aeb->lnum); printk("\v\tscrub %d\n", (int )aeb->scrub); printk("\v\tsqnum %llu\n", aeb->sqnum); } } else { } return; } } void ubi_dump_mkvol_req(struct ubi_mkvol_req const *req ) { char nm[17U] ; { { printk("\vVolume creation request dump:\n"); printk("\v\tvol_id %d\n", req->vol_id); printk("\v\talignment %d\n", req->alignment); printk("\v\tbytes %lld\n", req->bytes); printk("\v\tvol_type %d\n", (int )req->vol_type); printk("\v\tname_len %d\n", (int )req->name_len); __memcpy((void *)(& nm), (void const *)(& req->name), 16UL); nm[16] = 0; printk("\v\t1st 16 characters of name: %s\n", (char *)(& nm)); } return; } } static struct dentry *dfs_rootdir ; int ubi_debugfs_init(void) { int err ; long tmp ; int tmp___0 ; bool tmp___1 ; { { dfs_rootdir = debugfs_create_dir("ubi", (struct dentry *)0); tmp___1 = IS_ERR_OR_NULL((void const *)dfs_rootdir); } if ((int )tmp___1) { if ((unsigned long )dfs_rootdir == (unsigned long )((struct dentry *)0)) { { tmp = PTR_ERR((void const *)dfs_rootdir); tmp___0 = (int )tmp; } } else { tmp___0 = -19; } { err = tmp___0; printk("\vUBI error: cannot create \"ubi\" debugfs directory, error %d\n", err); } return (err); } else { } return (0); } } void ubi_debugfs_exit(void) { { { debugfs_remove(dfs_rootdir); } return; } } static ssize_t dfs_file_read(struct file *file , char *user_buf , size_t count , loff_t *ppos ) { unsigned long ubi_num ; struct dentry *dent ; struct ubi_device *ubi ; struct ubi_debug_info *d ; char buf[3U] ; int val ; ssize_t tmp ; { { ubi_num = (unsigned long )file->private_data; dent = file->f_path.dentry; ubi = ubi_get_device((int )ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19L); } else { } d = & ubi->dbg; if ((unsigned long )dent == (unsigned long )d->dfs_chk_gen) { val = (int )d->chk_gen; } else if ((unsigned long )dent == (unsigned long )d->dfs_chk_io) { val = (int )d->chk_io; } else if ((unsigned long )dent == (unsigned long )d->dfs_disable_bgt) { val = (int )d->disable_bgt; } else if ((unsigned long )dent == (unsigned long )d->dfs_emulate_bitflips) { val = (int )d->emulate_bitflips; } else if ((unsigned long )dent == (unsigned long )d->dfs_emulate_io_failures) { val = (int )d->emulate_io_failures; } else { count = 0xffffffffffffffeaUL; goto out; } if (val != 0) { buf[0] = 49; } else { buf[0] = 48; } { buf[1] = 10; buf[2] = 0; tmp = simple_read_from_buffer((void *)user_buf, count, ppos, (void const *)(& buf), 2UL); count = (size_t )tmp; } out: { ubi_put_device(ubi); } return ((ssize_t )count); } } static ssize_t dfs_file_write(struct file *file , char const *user_buf , size_t count , loff_t *ppos ) { unsigned long ubi_num ; struct dentry *dent ; struct ubi_device *ubi ; struct ubi_debug_info *d ; size_t buf_size ; char buf[8U] ; int val ; size_t __min1 ; size_t __min2 ; unsigned long tmp ; { { ubi_num = (unsigned long )file->private_data; dent = file->f_path.dentry; ubi = ubi_get_device((int )ubi_num); } if ((unsigned long )ubi == (unsigned long )((struct ubi_device *)0)) { return (-19L); } else { } { d = & ubi->dbg; __min1 = count; __min2 = 7UL; buf_size = __min1 < __min2 ? __min1 : __min2; tmp = copy_from_user((void *)(& buf), (void const *)user_buf, buf_size); } if (tmp != 0UL) { count = 0xfffffffffffffff2UL; goto out; } else { } if ((int )((signed char )buf[0]) == 49) { val = 1; } else if ((int )((signed char )buf[0]) == 48) { val = 0; } else { count = 0xffffffffffffffeaUL; goto out; } if ((unsigned long )dent == (unsigned long )d->dfs_chk_gen) { d->chk_gen = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )d->dfs_chk_io) { d->chk_io = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )d->dfs_disable_bgt) { d->disable_bgt = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )d->dfs_emulate_bitflips) { d->emulate_bitflips = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )d->dfs_emulate_io_failures) { d->emulate_io_failures = (unsigned char )val; } else { count = 0xffffffffffffffeaUL; } out: { ubi_put_device(ubi); } return ((ssize_t )count); } } static struct file_operations const dfs_fops = {& __this_module, & no_llseek, & dfs_file_read, & dfs_file_write, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & simple_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int ubi_debugfs_init_dev(struct ubi_device *ubi ) { int err ; int n ; unsigned long ubi_num ; char const *fname ; struct dentry *dent ; struct ubi_debug_info *d ; void *tmp ; bool tmp___0 ; bool tmp___1 ; bool tmp___2 ; bool tmp___3 ; bool tmp___4 ; bool tmp___5 ; long tmp___6 ; { { ubi_num = (unsigned long )ubi->ubi_num; d = & ubi->dbg; n = snprintf((char *)(& d->dfs_dir_name), 7UL, "ubi%d", ubi->ubi_num); } if (n == 6) { { fname = "ubi%d"; tmp = ERR_PTR(-22L); dent = (struct dentry *)tmp; } goto out; } else { } { fname = (char const *)(& d->dfs_dir_name); dent = debugfs_create_dir(fname, dfs_rootdir); tmp___0 = IS_ERR_OR_NULL((void const *)dent); } if ((int )tmp___0) { goto out; } else { } { d->dfs_dir = dent; fname = "chk_gen"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)ubi_num, & dfs_fops); tmp___1 = IS_ERR_OR_NULL((void const *)dent); } if ((int )tmp___1) { goto out_remove; } else { } { d->dfs_chk_gen = dent; fname = "chk_io"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)ubi_num, & dfs_fops); tmp___2 = IS_ERR_OR_NULL((void const *)dent); } if ((int )tmp___2) { goto out_remove; } else { } { d->dfs_chk_io = dent; fname = "tst_disable_bgt"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)ubi_num, & dfs_fops); tmp___3 = IS_ERR_OR_NULL((void const *)dent); } if ((int )tmp___3) { goto out_remove; } else { } { d->dfs_disable_bgt = dent; fname = "tst_emulate_bitflips"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)ubi_num, & dfs_fops); tmp___4 = IS_ERR_OR_NULL((void const *)dent); } if ((int )tmp___4) { goto out_remove; } else { } { d->dfs_emulate_bitflips = dent; fname = "tst_emulate_io_failures"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)ubi_num, & dfs_fops); tmp___5 = IS_ERR_OR_NULL((void const *)dent); } if ((int )tmp___5) { goto out_remove; } else { } d->dfs_emulate_io_failures = dent; return (0); out_remove: { debugfs_remove_recursive(d->dfs_dir); } out: ; if ((unsigned long )dent != (unsigned long )((struct dentry *)0)) { { tmp___6 = PTR_ERR((void const *)dent); err = (int )tmp___6; } } else { err = -19; } { printk("\vubi%d error: %s: cannot create \"%s\" debugfs file or directory, error %d\n\n", ubi->ubi_num, "ubi_debugfs_init_dev", fname, err); } return (err); } } void ubi_debugfs_exit_dev(struct ubi_device *ubi ) { { { debugfs_remove_recursive(ubi->dbg.dfs_dir); } return; } } void ldv_file_operations_instance_callback_0_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) ; void ldv_file_operations_instance_callback_0_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) ; void ldv_file_operations_instance_callback_0_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; int ldv_file_operations_instance_probe_0_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) ; void ldv_file_operations_instance_write_0_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) ; struct ldv_thread ldv_thread_0 ; void ldv_file_operations_file_operations_instance_0(void *arg0 ) { long (*ldv_0_callback_compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*ldv_0_callback_fsync)(struct file * , long long , long long , int ) ; int (*ldv_0_callback_getgeo)(struct block_device * , struct hd_geometry * ) ; long long (*ldv_0_callback_llseek)(struct file * , long long , int ) ; long (*ldv_0_callback_read)(struct file * , char * , unsigned long , long long * ) ; long (*ldv_0_callback_unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; struct file_operations *ldv_0_container_file_operations ; long long ldv_0_ldv_param_22_1_default ; long long ldv_0_ldv_param_22_2_default ; int ldv_0_ldv_param_22_3_default ; long long ldv_0_ldv_param_26_1_default ; int ldv_0_ldv_param_26_2_default ; char *ldv_0_ldv_param_29_1_default ; long long *ldv_0_ldv_param_29_3_default ; unsigned int ldv_0_ldv_param_32_1_default ; char *ldv_0_ldv_param_4_1_default ; long long *ldv_0_ldv_param_4_3_default ; unsigned int ldv_0_ldv_param_5_1_default ; struct file *ldv_0_resource_file ; struct inode *ldv_0_resource_inode ; struct block_device *ldv_0_resource_struct_block_device_ptr ; int ldv_0_ret_default ; struct hd_geometry *ldv_0_size_cnt_struct_hd_geometry_ptr ; unsigned long ldv_0_size_cnt_write_size ; struct ldv_struct_file_operations_instance_0 *data ; void *tmp ; void *tmp___0 ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; void *tmp___6 ; void *tmp___7 ; int tmp___8 ; void *tmp___9 ; void *tmp___10 ; { data = (struct ldv_struct_file_operations_instance_0 *)arg0; ldv_0_ret_default = 1; if ((unsigned long )data != (unsigned long )((struct ldv_struct_file_operations_instance_0 *)0)) { { ldv_0_container_file_operations = data->arg0; ldv_free((void *)data); } } else { } { tmp = ldv_xmalloc(504UL); ldv_0_resource_file = (struct file *)tmp; tmp___0 = ldv_xmalloc(976UL); ldv_0_resource_inode = (struct inode *)tmp___0; tmp___1 = ldv_xmalloc(480UL); ldv_0_resource_struct_block_device_ptr = (struct block_device *)tmp___1; tmp___2 = ldv_undef_int(); ldv_0_size_cnt_struct_hd_geometry_ptr = (struct hd_geometry *)((long )tmp___2); } goto ldv_main_0; return; ldv_main_0: { tmp___4 = ldv_undef_int(); } if (tmp___4 != 0) { { ldv_0_ret_default = ldv_file_operations_instance_probe_0_12(ldv_0_container_file_operations->open, ldv_0_resource_inode, ldv_0_resource_file); ldv_0_ret_default = ldv_filter_err_code(ldv_0_ret_default); tmp___3 = ldv_undef_int(); } if (tmp___3 != 0) { { ldv_assume(ldv_0_ret_default == 0); } goto ldv_call_0; } else { { ldv_assume(ldv_0_ret_default != 0); } goto ldv_main_0; } } else { { ldv_free((void *)ldv_0_resource_file); ldv_free((void *)ldv_0_resource_inode); ldv_free((void *)ldv_0_resource_struct_block_device_ptr); } return; } return; ldv_call_0: { tmp___5 = ldv_undef_int(); } { if (tmp___5 == 1) { goto case_1; } else { } if (tmp___5 == 2) { goto case_2; } else { } if (tmp___5 == 3) { goto case_3; } else { } goto switch_default___0; case_1: /* CIL Label */ { tmp___6 = ldv_xmalloc(1UL); ldv_0_ldv_param_4_1_default = (char *)tmp___6; tmp___7 = ldv_xmalloc(8UL); ldv_0_ldv_param_4_3_default = (long long *)tmp___7; ldv_assume((unsigned long )ldv_0_size_cnt_struct_hd_geometry_ptr <= (unsigned long )((struct hd_geometry *)2147479552)); ldv_file_operations_instance_write_0_4((long (*)(struct file * , char * , unsigned long , long long * ))ldv_0_container_file_operations->write, ldv_0_resource_file, ldv_0_ldv_param_4_1_default, ldv_0_size_cnt_write_size, ldv_0_ldv_param_4_3_default); ldv_free((void *)ldv_0_ldv_param_4_1_default); ldv_free((void *)ldv_0_ldv_param_4_3_default); } goto ldv_call_0; case_2: /* CIL Label */ ; if ((unsigned long )ldv_0_container_file_operations->release != (unsigned long )((int (*)(struct inode * , struct file * ))0)) { { ldv_file_operations_instance_release_0_2(ldv_0_container_file_operations->release, ldv_0_resource_inode, ldv_0_resource_file); } } else { } goto ldv_main_0; case_3: /* CIL Label */ { tmp___8 = ldv_undef_int(); } { if (tmp___8 == 1) { goto case_1___0; } else { } if (tmp___8 == 2) { goto case_2___0; } else { } if (tmp___8 == 3) { goto case_3___0; } else { } if (tmp___8 == 4) { goto case_4; } else { } if (tmp___8 == 5) { goto case_5; } else { } if (tmp___8 == 6) { goto case_6; } else { } goto switch_default; case_1___0: /* CIL Label */ ; if ((unsigned long )ldv_0_callback_unlocked_ioctl != (unsigned long )((long (*)(struct file * , unsigned int , unsigned long ))0)) { { ldv_file_operations_instance_callback_0_32(ldv_0_callback_unlocked_ioctl, ldv_0_resource_file, ldv_0_ldv_param_32_1_default, ldv_0_size_cnt_write_size); } } else { } goto ldv_32517; case_2___0: /* CIL Label */ { tmp___9 = ldv_xmalloc(1UL); ldv_0_ldv_param_29_1_default = (char *)tmp___9; tmp___10 = ldv_xmalloc(8UL); ldv_0_ldv_param_29_3_default = (long long *)tmp___10; ldv_file_operations_instance_callback_0_29(ldv_0_callback_read, ldv_0_resource_file, ldv_0_ldv_param_29_1_default, ldv_0_size_cnt_write_size, ldv_0_ldv_param_29_3_default); ldv_free((void *)ldv_0_ldv_param_29_1_default); ldv_free((void *)ldv_0_ldv_param_29_3_default); } goto ldv_32517; case_3___0: /* CIL Label */ { ldv_file_operations_instance_callback_0_26(ldv_0_callback_llseek, ldv_0_resource_file, ldv_0_ldv_param_26_1_default, ldv_0_ldv_param_26_2_default); } goto ldv_32517; case_4: /* CIL Label */ { ldv_file_operations_instance_callback_0_25(ldv_0_callback_getgeo, ldv_0_resource_struct_block_device_ptr, ldv_0_size_cnt_struct_hd_geometry_ptr); } goto ldv_32517; case_5: /* CIL Label */ ; if ((unsigned long )ldv_0_callback_fsync != (unsigned long )((int (*)(struct file * , long long , long long , int ))0)) { { ldv_file_operations_instance_callback_0_22(ldv_0_callback_fsync, ldv_0_resource_file, ldv_0_ldv_param_22_1_default, ldv_0_ldv_param_22_2_default, ldv_0_ldv_param_22_3_default); } } else { } goto ldv_32517; case_6: /* CIL Label */ ; if ((unsigned long )ldv_0_callback_compat_ioctl != (unsigned long )((long (*)(struct file * , unsigned int , unsigned long ))0)) { { ldv_file_operations_instance_callback_0_5(ldv_0_callback_compat_ioctl, ldv_0_resource_file, ldv_0_ldv_param_5_1_default, ldv_0_size_cnt_write_size); } } else { } goto ldv_32517; switch_default: /* CIL Label */ { ldv_stop(); } switch_break___0: /* CIL Label */ ; } ldv_32517: ; goto ldv_32524; switch_default___0: /* CIL Label */ { ldv_stop(); } switch_break: /* CIL Label */ ; } ldv_32524: ; goto ldv_call_0; goto ldv_call_0; return; } } void ldv_file_operations_instance_callback_0_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) { { { no_llseek(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_0_29(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { dfs_file_read(arg1, arg2, arg3, arg4); } return; } } void ldv_file_operations_instance_callback_1_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) { { { no_llseek(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_2_26(long long (*arg0)(struct file * , long long , int ) , struct file *arg1 , long long arg2 , int arg3 ) { { { no_llseek(arg1, arg2, arg3); } return; } } int ldv_file_operations_instance_probe_0_12(int (*arg0)(struct inode * , struct file * ) , struct inode *arg1 , struct file *arg2 ) { int tmp ; { { tmp = simple_open(arg1, arg2); } return (tmp); } } void ldv_file_operations_instance_write_0_4(long (*arg0)(struct file * , char * , unsigned long , long long * ) , struct file *arg1 , char *arg2 , unsigned long arg3 , long long *arg4 ) { { { dfs_file_write(arg1, (char const *)arg2, arg3, arg4); } return; } } static void *ldv_vmalloc_95___0(unsigned long ldv_func_arg1 ) { void *tmp ; { { ldv_check_alloc_nonatomic(); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_lock_99___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_106(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_fm_mutex_of_ubi_device(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(struct mutex *lock ) ; extern void __list_del_entry(struct list_head * ) ; __inline static void list_move_tail(struct list_head *list , struct list_head *head ) { { { __list_del_entry(list); list_add_tail(list, head); } return; } } extern void warn_slowpath_null(char const * , int const ) ; static void ldv_mutex_unlock_101(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_107___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_108___1(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_109(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_111(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_116___0(struct mutex *ldv_func_arg1 ) ; __inline static void ldv_spin_lock_95(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_lock_114(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_96(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_115(spinlock_t *lock ) ; static void *ldv_kmem_cache_alloc_95___0(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_96___0(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_97(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_98(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_100___0(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; static void *ldv_kmem_cache_alloc_110(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static struct ubi_vid_hdr *ubi_zalloc_vid_hdr___4(struct ubi_device const *ubi , gfp_t gfp_flags ) { void *vid_hdr ; { { vid_hdr = kzalloc((size_t )ubi->vid_hdr_alsize, gfp_flags); } if ((unsigned long )vid_hdr == (unsigned long )((void *)0)) { return ((struct ubi_vid_hdr *)0); } else { } return ((struct ubi_vid_hdr *)vid_hdr + (unsigned long )ubi->vid_hdr_shift); } } size_t ubi_calc_fm_size(struct ubi_device *ubi ) { size_t size ; int __y ; { size = ((((unsigned long )ubi->peb_count + 305UL) * 2UL + (unsigned long )ubi->peb_count) + 1026UL) * 4UL; __y = ubi->leb_size; return (((size + (size_t )(__y + -1)) / (size_t )__y) * (size_t )__y); } } static struct ubi_vid_hdr *new_fm_vhdr(struct ubi_device *ubi , int vol_id ) { struct ubi_vid_hdr *new ; __u32 tmp ; { { new = ubi_zalloc_vid_hdr___4((struct ubi_device const *)ubi, 208U); } if ((unsigned long )new == (unsigned long )((struct ubi_vid_hdr *)0)) { goto out; } else { } { new->vol_type = 1U; tmp = __fswab32((__u32 )vol_id); new->vol_id = tmp; new->compat = 1U; } out: ; return (new); } } static int add_aeb(struct ubi_attach_info *ai , struct list_head *list , int pnum , int ec , int scrub ) { struct ubi_ainf_peb *aeb ; void *tmp ; { { tmp = ldv_kmem_cache_alloc_95___0(ai->aeb_slab_cache, 208U); aeb = (struct ubi_ainf_peb *)tmp; } if ((unsigned long )aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { return (-12); } else { } aeb->pnum = pnum; aeb->ec = ec; aeb->lnum = -1; aeb->scrub = (unsigned char )scrub; aeb->sqnum = 0ULL; aeb->copy_flag = 0U; ai->ec_sum = ai->ec_sum + (uint64_t )aeb->ec; ai->ec_count = ai->ec_count + 1; if (ai->max_ec < aeb->ec) { ai->max_ec = aeb->ec; } else { } if (ai->min_ec > aeb->ec) { ai->min_ec = aeb->ec; } else { } { list_add_tail(& aeb->u.list, list); } return (0); } } static struct ubi_ainf_volume *add_vol(struct ubi_attach_info *ai , int vol_id , int used_ebs , int data_pad , u8 vol_type , int last_eb_bytes ) { struct ubi_ainf_volume *av ; struct rb_node **p ; struct rb_node *parent ; struct rb_node const *__mptr ; void *tmp ; int tmp___0 ; struct rb_root __constr_expr_0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { p = & ai->volumes.rb_node; parent = (struct rb_node *)0; goto ldv_31540; ldv_31539: parent = *p; __mptr = (struct rb_node const *)parent; av = (struct ubi_ainf_volume *)__mptr + 0xffffffffffffffe0UL; if (vol_id > av->vol_id) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } ldv_31540: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31539; } else { } { tmp = kmalloc(64UL, 208U); av = (struct ubi_ainf_volume *)tmp; } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { goto out; } else { } { tmp___0 = 0; av->leb_count = tmp___0; av->highest_lnum = tmp___0; av->vol_id = vol_id; av->used_ebs = used_ebs; av->data_pad = data_pad; av->last_data_size = last_eb_bytes; av->compat = 0; av->vol_type = (int )vol_type; __constr_expr_0.rb_node = (struct rb_node *)0; av->root = __constr_expr_0; descriptor.modname = "ubi"; descriptor.function = "add_vol"; descriptor.filename = "drivers/mtd/ubi/fastmap.c"; descriptor.format = "UBI DBG bld (pid %d): found volume (ID %i)\n"; descriptor.lineno = 148U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): found volume (ID %i)\n", tmp___1->pid, vol_id); } } else { } { rb_link_node(& av->rb, parent, p); rb_insert_color(& av->rb, & ai->volumes); } out: ; return (av); } } static void assign_aeb_to_av(struct ubi_attach_info *ai , struct ubi_ainf_peb *aeb , struct ubi_ainf_volume *av ) { struct ubi_ainf_peb *tmp_aeb ; struct rb_node **p ; struct rb_node *parent ; struct rb_node const *__mptr ; { p = & ai->volumes.rb_node; parent = (struct rb_node *)0; p = & av->root.rb_node; goto ldv_31556; ldv_31558: parent = *p; __mptr = (struct rb_node const *)parent; tmp_aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; if (aeb->lnum != tmp_aeb->lnum) { if (aeb->lnum < tmp_aeb->lnum) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } goto ldv_31556; } else { goto ldv_31557; } ldv_31556: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31558; } else { } ldv_31557: { list_del(& aeb->u.list); av->leb_count = av->leb_count + 1; rb_link_node(& aeb->u.rb, parent, p); rb_insert_color(& aeb->u.rb, & av->root); } return; } } static int update_vol(struct ubi_device *ubi , struct ubi_attach_info *ai , struct ubi_ainf_volume *av , struct ubi_vid_hdr *new_vh , struct ubi_ainf_peb *new_aeb ) { struct rb_node **p ; struct rb_node *parent ; struct ubi_ainf_peb *aeb ; struct ubi_ainf_peb *victim ; int cmp_res ; struct rb_node const *__mptr ; __u32 tmp ; __u32 tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; void *tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; struct _ddebug descriptor ; struct task_struct *tmp___6 ; long tmp___7 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___8 ; long tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; __u32 tmp___13 ; { p = & av->root.rb_node; parent = (struct rb_node *)0; goto ldv_31573; ldv_31577: { parent = *p; __mptr = (struct rb_node const *)parent; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; tmp___0 = __fswab32(new_vh->lnum); } if (tmp___0 != (unsigned int )aeb->lnum) { { tmp = __fswab32(new_vh->lnum); } if (tmp < (unsigned int )aeb->lnum) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } goto ldv_31573; } else { } if (aeb->pnum == new_aeb->pnum) { { tmp___2 = ldv__builtin_expect(aeb->lnum != new_aeb->lnum, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "update_vol", 230, tmp___1->pid); dump_stack(); } } else { } { kmem_cache_free(ai->aeb_slab_cache, (void *)new_aeb); } return (0); } else { } { cmp_res = ubi_compare_lebs(ubi, (struct ubi_ainf_peb const *)aeb, new_aeb->pnum, (struct ubi_vid_hdr const *)new_vh); } if (cmp_res < 0) { return (cmp_res); } else { } if (cmp_res & 1) { { tmp___3 = ldv_kmem_cache_alloc_96___0(ai->aeb_slab_cache, 208U); victim = (struct ubi_ainf_peb *)tmp___3; } if ((unsigned long )victim == (unsigned long )((struct ubi_ainf_peb *)0)) { return (-12); } else { } { victim->ec = aeb->ec; victim->pnum = aeb->pnum; list_add_tail(& victim->u.list, & ai->erase); tmp___5 = __fswab32(new_vh->lnum); } if ((unsigned int )av->highest_lnum == tmp___5) { { tmp___4 = __fswab32(new_vh->data_size); av->last_data_size = (int )tmp___4; } } else { } { descriptor.modname = "ubi"; descriptor.function = "update_vol"; descriptor.filename = "drivers/mtd/ubi/fastmap.c"; descriptor.format = "UBI DBG bld (pid %d): vol %i: AEB %i\'s PEB %i is the newer\n"; descriptor.lineno = 256U; descriptor.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___7 != 0L) { { tmp___6 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): vol %i: AEB %i\'s PEB %i is the newer\n", tmp___6->pid, av->vol_id, aeb->lnum, new_aeb->pnum); } } else { } { aeb->ec = new_aeb->ec; aeb->pnum = new_aeb->pnum; aeb->copy_flag = new_vh->copy_flag; aeb->scrub = new_aeb->scrub; kmem_cache_free(ai->aeb_slab_cache, (void *)new_aeb); } } else { { descriptor___0.modname = "ubi"; descriptor___0.function = "update_vol"; descriptor___0.filename = "drivers/mtd/ubi/fastmap.c"; descriptor___0.format = "UBI DBG bld (pid %d): vol %i: AEB %i\'s PEB %i is old, dropping it\n"; descriptor___0.lineno = 267U; descriptor___0.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___9 != 0L) { { tmp___8 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): vol %i: AEB %i\'s PEB %i is old, dropping it\n", tmp___8->pid, av->vol_id, aeb->lnum, new_aeb->pnum); } } else { } { list_add_tail(& new_aeb->u.list, & ai->erase); } } return (0); ldv_31573: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31577; } else { } { tmp___12 = __fswab32(new_vh->lnum); } if ((unsigned int )av->highest_lnum <= tmp___12) { { tmp___10 = __fswab32(new_vh->lnum); av->highest_lnum = (int )tmp___10; tmp___11 = __fswab32(new_vh->data_size); av->last_data_size = (int )tmp___11; } } else { } if (av->vol_type == 4) { { tmp___13 = __fswab32(new_vh->used_ebs); av->used_ebs = (int )tmp___13; } } else { } { av->leb_count = av->leb_count + 1; rb_link_node(& new_aeb->u.rb, parent, p); rb_insert_color(& new_aeb->u.rb, & av->root); } return (0); } } static int process_pool_aeb(struct ubi_device *ubi , struct ubi_attach_info *ai , struct ubi_vid_hdr *new_vh , struct ubi_ainf_peb *new_aeb ) { struct ubi_ainf_volume *av ; struct ubi_ainf_volume *tmp_av ; struct rb_node **p ; struct rb_node *parent ; int found ; __u32 tmp ; __u32 tmp___0 ; struct rb_node const *__mptr ; __u32 tmp___1 ; __u32 tmp___2 ; struct task_struct *tmp___3 ; __u32 tmp___4 ; long tmp___5 ; int tmp___6 ; { { tmp_av = (struct ubi_ainf_volume *)0; p = & ai->volumes.rb_node; parent = (struct rb_node *)0; found = 0; tmp = __fswab32(new_vh->vol_id); } if (tmp == 2147479552U) { { kmem_cache_free(ai->aeb_slab_cache, (void *)new_aeb); } return (0); } else { { tmp___0 = __fswab32(new_vh->vol_id); } if (tmp___0 == 2147479553U) { { kmem_cache_free(ai->aeb_slab_cache, (void *)new_aeb); } return (0); } else { } } goto ldv_31594; ldv_31593: { parent = *p; __mptr = (struct rb_node const *)parent; tmp_av = (struct ubi_ainf_volume *)__mptr + 0xffffffffffffffe0UL; tmp___2 = __fswab32(new_vh->vol_id); } if (tmp___2 > (unsigned int )tmp_av->vol_id) { p = & (*p)->rb_left; } else { { tmp___1 = __fswab32(new_vh->vol_id); } if (tmp___1 < (unsigned int )tmp_av->vol_id) { p = & (*p)->rb_right; } else { found = 1; goto ldv_31592; } } ldv_31594: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_31593; } else { } ldv_31592: ; if (found != 0) { av = tmp_av; } else { { printk("\vubi%d error: %s: orphaned volume in fastmap pool!\n", ubi->ubi_num, "process_pool_aeb"); kmem_cache_free(ai->aeb_slab_cache, (void *)new_aeb); } return (2); } { tmp___4 = __fswab32(new_vh->vol_id); tmp___5 = ldv__builtin_expect(tmp___4 != (unsigned int )av->vol_id, 0L); } if (tmp___5 != 0L) { { tmp___3 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "process_pool_aeb", 338, tmp___3->pid); dump_stack(); } } else { } { tmp___6 = update_vol(ubi, ai, av, new_vh, new_aeb); } return (tmp___6); } } static void unmap_peb(struct ubi_attach_info *ai , int pnum ) { struct ubi_ainf_volume *av ; struct rb_node *node ; struct rb_node *node2 ; struct ubi_ainf_peb *aeb ; struct rb_node const *__mptr ; struct rb_node const *__mptr___0 ; { { node = rb_first((struct rb_root const *)(& ai->volumes)); } goto ldv_31612; ldv_31611: { __mptr = (struct rb_node const *)node; av = (struct ubi_ainf_volume *)__mptr + 0xffffffffffffffe0UL; node2 = rb_first((struct rb_root const *)(& av->root)); } goto ldv_31609; ldv_31608: __mptr___0 = (struct rb_node const *)node2; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; if (aeb->pnum == pnum) { { rb_erase(& aeb->u.rb, & av->root); kmem_cache_free(ai->aeb_slab_cache, (void *)aeb); } return; } else { } { node2 = rb_next((struct rb_node const *)node2); } ldv_31609: ; if ((unsigned long )node2 != (unsigned long )((struct rb_node *)0)) { goto ldv_31608; } else { } { node = rb_next((struct rb_node const *)node); } ldv_31612: ; if ((unsigned long )node != (unsigned long )((struct rb_node *)0)) { goto ldv_31611; } else { } return; } } static int scan_pool(struct ubi_device *ubi , struct ubi_attach_info *ai , int *pebs , int pool_size , unsigned long long *max_sqnum , struct list_head *eba_orphans , struct list_head *free___0 ) { struct ubi_vid_hdr *vh ; struct ubi_ec_hdr *ech___0 ; struct ubi_ainf_peb *new_aeb ; struct ubi_ainf_peb *tmp_aeb ; int i ; int pnum ; int err ; int found_orphan ; int ret ; void *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int scrub ; int image_seq ; __u32 tmp___2 ; int tmp___3 ; __u32 tmp___4 ; __u32 tmp___5 ; unsigned long long ec ; __u64 tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___9 ; long tmp___10 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; void *tmp___11 ; __u64 tmp___12 ; __u32 tmp___13 ; __u64 tmp___14 ; { { ret = 0; tmp = kzalloc((size_t )ubi->ec_hdr_alsize, 208U); ech___0 = (struct ubi_ec_hdr *)tmp; } if ((unsigned long )ech___0 == (unsigned long )((struct ubi_ec_hdr *)0)) { return (-12); } else { } { vh = ubi_zalloc_vid_hdr___4((struct ubi_device const *)ubi, 208U); } if ((unsigned long )vh == (unsigned long )((struct ubi_vid_hdr *)0)) { { kfree((void const *)ech___0); } return (-12); } else { } { descriptor.modname = "ubi"; descriptor.function = "scan_pool"; descriptor.filename = "drivers/mtd/ubi/fastmap.c"; descriptor.format = "UBI DBG bld (pid %d): scanning fastmap pool: size = %i\n"; descriptor.lineno = 404U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___1 != 0L) { { tmp___0 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): scanning fastmap pool: size = %i\n", tmp___0->pid, pool_size); } } else { } i = 0; goto ldv_31649; ldv_31648: { scrub = 0; tmp___2 = __fswab32((unsigned int )*(pebs + (unsigned long )i)); pnum = (int )tmp___2; tmp___3 = ubi_io_is_bad((struct ubi_device const *)ubi, pnum); } if (tmp___3 != 0) { { printk("\vubi%d error: %s: bad PEB in fastmap pool!\n", ubi->ubi_num, "scan_pool"); ret = 2; } goto out; } else { } { err = ubi_io_read_ec_hdr(ubi, pnum, ech___0, 0); } if (err != 0 && err != 5) { { printk("\vubi%d error: %s: unable to read EC header! PEB:%i err:%i\n", ubi->ubi_num, "scan_pool", pnum, err); ret = err <= 0 ? err : 2; } goto out; } else if (err == 5) { scrub = 1; } else { } { tmp___4 = __fswab32(ech___0->image_seq); image_seq = (int )tmp___4; } if (image_seq != 0 && image_seq != ubi->image_seq) { { tmp___5 = __fswab32(ech___0->image_seq); printk("\vubi%d error: %s: bad image seq: 0x%x, expected: 0x%x\n", ubi->ubi_num, "scan_pool", tmp___5, ubi->image_seq); ret = 2; } goto out; } else { } { err = ubi_io_read_vid_hdr(ubi, pnum, vh, 0); } if ((unsigned int )err - 1U <= 1U) { { tmp___6 = __fswab64(ech___0->ec); ec = tmp___6; unmap_peb(ai, pnum); descriptor___0.modname = "ubi"; descriptor___0.function = "scan_pool"; descriptor___0.filename = "drivers/mtd/ubi/fastmap.c"; descriptor___0.format = "UBI DBG bld (pid %d): Adding PEB to free: %i\n"; descriptor___0.lineno = 448U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___8 != 0L) { { tmp___7 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): Adding PEB to free: %i\n", tmp___7->pid, pnum); } } else { } if (err == 2) { { add_aeb(ai, free___0, pnum, (int )ec, 1); } } else { { add_aeb(ai, free___0, pnum, (int )ec, 0); } } goto ldv_31639; } else if (err == 0 || err == 5) { { descriptor___1.modname = "ubi"; descriptor___1.function = "scan_pool"; descriptor___1.filename = "drivers/mtd/ubi/fastmap.c"; descriptor___1.format = "UBI DBG bld (pid %d): Found non empty PEB:%i in pool\n"; descriptor___1.lineno = 455U; descriptor___1.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___10 != 0L) { { tmp___9 = get_current___1(); __dynamic_pr_debug(& descriptor___1, "UBI DBG bld (pid %d): Found non empty PEB:%i in pool\n", tmp___9->pid, pnum); } } else { } if (err == 5) { scrub = 1; } else { } found_orphan = 0; __mptr = (struct list_head const *)eba_orphans->next; tmp_aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; goto ldv_31647; ldv_31646: ; if (tmp_aeb->pnum == pnum) { found_orphan = 1; goto ldv_31645; } else { } __mptr___0 = (struct list_head const *)tmp_aeb->u.list.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; ldv_31647: ; if ((unsigned long )(& tmp_aeb->u.list) != (unsigned long )eba_orphans) { goto ldv_31646; } else { } ldv_31645: ; if (found_orphan != 0) { { list_del(& tmp_aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)tmp_aeb); } } else { } { tmp___11 = ldv_kmem_cache_alloc_97(ai->aeb_slab_cache, 208U); new_aeb = (struct ubi_ainf_peb *)tmp___11; } if ((unsigned long )new_aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { ret = -12; goto out; } else { } { tmp___12 = __fswab64(ech___0->ec); new_aeb->ec = (int )tmp___12; new_aeb->pnum = pnum; tmp___13 = __fswab32(vh->lnum); new_aeb->lnum = (int )tmp___13; tmp___14 = __fswab64(vh->sqnum); new_aeb->sqnum = tmp___14; new_aeb->copy_flag = vh->copy_flag; new_aeb->scrub = (unsigned char )scrub; } if (*max_sqnum < new_aeb->sqnum) { *max_sqnum = new_aeb->sqnum; } else { } { err = process_pool_aeb(ubi, ai, vh, new_aeb); } if (err != 0) { ret = err <= 0 ? err : 2; goto out; } else { } } else { { printk("\vubi%d error: %s: fastmap pool PEBs contains damaged PEBs!\n", ubi->ubi_num, "scan_pool"); ret = err <= 0 ? err : 2; } goto out; } ldv_31639: i = i + 1; ldv_31649: ; if (i < pool_size) { goto ldv_31648; } else { } out: { ubi_free_vid_hdr((struct ubi_device const *)ubi, vh); kfree((void const *)ech___0); } return (ret); } } static int count_fastmap_pebs(struct ubi_attach_info *ai ) { struct ubi_ainf_peb *aeb ; struct ubi_ainf_volume *av ; struct rb_node *rb1 ; struct rb_node *rb2 ; int n ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; struct rb_node const *__mptr___3 ; struct rb_node const *__mptr___4 ; struct rb_node const *__mptr___5 ; struct rb_node const *__mptr___6 ; { n = 0; __mptr = (struct list_head const *)ai->erase.next; aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; goto ldv_31664; ldv_31663: n = n + 1; __mptr___0 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; ldv_31664: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->erase)) { goto ldv_31663; } else { } __mptr___1 = (struct list_head const *)ai->free.next; aeb = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; goto ldv_31671; ldv_31670: n = n + 1; __mptr___2 = (struct list_head const *)aeb->u.list.next; aeb = (struct ubi_ainf_peb *)__mptr___2 + 0xffffffffffffffe0UL; ldv_31671: ; if ((unsigned long )(& aeb->u.list) != (unsigned long )(& ai->free)) { goto ldv_31670; } else { } { rb1 = rb_first((struct rb_root const *)(& ai->volumes)); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___3 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___3 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } goto ldv_31685; ldv_31684: { rb2 = rb_first((struct rb_root const *)(& av->root)); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___4 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___4 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } goto ldv_31682; ldv_31681: { n = n + 1; rb2 = rb_next((struct rb_node const *)rb2); } if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { __mptr___5 = (struct rb_node const *)rb2; aeb = (struct ubi_ainf_peb *)__mptr___5 + 0xffffffffffffffe0UL; } else { aeb = (struct ubi_ainf_peb *)0; } ldv_31682: ; if ((unsigned long )rb2 != (unsigned long )((struct rb_node *)0)) { goto ldv_31681; } else { } { rb1 = rb_next((struct rb_node const *)rb1); } if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { __mptr___6 = (struct rb_node const *)rb1; av = (struct ubi_ainf_volume *)__mptr___6 + 0xffffffffffffffe0UL; } else { av = (struct ubi_ainf_volume *)0; } ldv_31685: ; if ((unsigned long )rb1 != (unsigned long )((struct rb_node *)0)) { goto ldv_31684; } else { } return (n); } } static int ubi_attach_fastmap(struct ubi_device *ubi , struct ubi_attach_info *ai , struct ubi_fastmap_layout *fm ) { struct list_head used ; struct list_head eba_orphans ; struct list_head free___0 ; struct ubi_ainf_volume *av ; struct ubi_ainf_peb *aeb ; struct ubi_ainf_peb *tmp_aeb ; struct ubi_ainf_peb *_tmp_aeb ; struct ubi_ec_hdr *ech___0 ; struct ubi_fm_sb *fmsb ; struct ubi_fm_hdr *fmhdr ; struct ubi_fm_scan_pool *fmpl1 ; struct ubi_fm_scan_pool *fmpl2 ; struct ubi_fm_ec *fmec ; struct ubi_fm_volhdr *fmvhdr ; struct ubi_fm_eba *fm_eba ; int ret ; int i ; int j ; int pool_size ; int wl_pool_size ; size_t fm_pos ; size_t fm_size ; unsigned long long max_sqnum ; void *fm_raw ; struct rb_root __constr_expr_0 ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; __u16 tmp___5 ; __u16 tmp___6 ; __u16 tmp___7 ; __u16 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; __u32 tmp___13 ; __u32 tmp___14 ; __u32 tmp___15 ; __u32 tmp___16 ; __u32 tmp___17 ; __u32 tmp___18 ; __u32 tmp___19 ; __u32 tmp___20 ; u64 tmp___21 ; __u32 tmp___22 ; __u32 tmp___23 ; __u32 tmp___24 ; __u32 tmp___25 ; __u32 tmp___26 ; __u32 tmp___27 ; __u32 tmp___28 ; __u32 tmp___29 ; __u32 tmp___30 ; __u32 tmp___31 ; __u32 tmp___32 ; __u32 tmp___33 ; int pnum ; __u32 tmp___34 ; __u32 tmp___35 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; void *tmp___36 ; __u32 tmp___37 ; unsigned char tmp___38 ; struct _ddebug descriptor ; struct task_struct *tmp___39 ; long tmp___40 ; __u32 tmp___41 ; void *tmp___42 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; int err ; int tmp___43 ; __u64 tmp___44 ; struct list_head const *__mptr___3 ; __u32 tmp___45 ; struct list_head const *__mptr___4 ; struct list_head const *__mptr___5 ; struct list_head const *__mptr___6 ; struct task_struct *tmp___46 ; int tmp___47 ; long tmp___48 ; struct task_struct *tmp___49 ; int tmp___50 ; long tmp___51 ; struct task_struct *tmp___52 ; int tmp___53 ; long tmp___54 ; int __ret_warn_on ; int tmp___55 ; long tmp___56 ; long tmp___57 ; struct list_head const *__mptr___7 ; struct list_head const *__mptr___8 ; struct list_head const *__mptr___9 ; struct list_head const *__mptr___10 ; struct list_head const *__mptr___11 ; struct list_head const *__mptr___12 ; struct list_head const *__mptr___13 ; struct list_head const *__mptr___14 ; struct list_head const *__mptr___15 ; { { fm_pos = 0UL; fm_size = ubi->fm_size; max_sqnum = 0ULL; fm_raw = ubi->fm_buf; INIT_LIST_HEAD(& used); INIT_LIST_HEAD(& free___0); INIT_LIST_HEAD(& eba_orphans); INIT_LIST_HEAD(& ai->corr); INIT_LIST_HEAD(& ai->free); INIT_LIST_HEAD(& ai->erase); INIT_LIST_HEAD(& ai->alien); __constr_expr_0.rb_node = (struct rb_node *)0; ai->volumes = __constr_expr_0; ai->min_ec = 2147483647; ai->aeb_slab_cache = kmem_cache_create("ubi_ainf_peb_slab", 56UL, 0UL, 0UL, (void (*)(void * ))0); } if ((unsigned long )ai->aeb_slab_cache == (unsigned long )((struct kmem_cache *)0)) { ret = -12; goto fail; } else { } fmsb = (struct ubi_fm_sb *)fm_raw; ai->max_sqnum = fmsb->sqnum; fm_pos = fm_pos + 312UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } fmhdr = (struct ubi_fm_hdr *)(fm_raw + fm_pos); fm_pos = fm_pos + 32UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___0 = __fswab32(fmhdr->magic); } if (tmp___0 != 3568840439U) { { tmp = __fswab32(fmhdr->magic); printk("\vubi%d error: %s: bad fastmap header magic: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_attach_fastmap", tmp, 3568840439U); } goto fail_bad; } else { } fmpl1 = (struct ubi_fm_scan_pool *)(fm_raw + fm_pos); fm_pos = fm_pos + 1048UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___2 = __fswab32(fmpl1->magic); } if (tmp___2 != 1739541768U) { { tmp___1 = __fswab32(fmpl1->magic); printk("\vubi%d error: %s: bad fastmap pool magic: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_attach_fastmap", tmp___1, 1739541768); } goto fail_bad; } else { } fmpl2 = (struct ubi_fm_scan_pool *)(fm_raw + fm_pos); fm_pos = fm_pos + 1048UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___4 = __fswab32(fmpl2->magic); } if (tmp___4 != 1739541768U) { { tmp___3 = __fswab32(fmpl2->magic); printk("\vubi%d error: %s: bad fastmap pool magic: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_attach_fastmap", tmp___3, 1739541768); } goto fail_bad; } else { } { tmp___5 = __fswab16((int )fmpl1->size); pool_size = (int )tmp___5; tmp___6 = __fswab16((int )fmpl2->size); wl_pool_size = (int )tmp___6; tmp___7 = __fswab16((int )fmpl1->max_size); fm->max_pool_size = (int )tmp___7; tmp___8 = __fswab16((int )fmpl2->max_size); fm->max_wl_pool_size = (int )tmp___8; } if ((unsigned int )pool_size > 256U) { { printk("\vubi%d error: %s: bad pool size: %i\n", ubi->ubi_num, "ubi_attach_fastmap", pool_size); } goto fail_bad; } else { } if ((unsigned int )wl_pool_size > 256U) { { printk("\vubi%d error: %s: bad WL pool size: %i\n", ubi->ubi_num, "ubi_attach_fastmap", wl_pool_size); } goto fail_bad; } else { } if ((unsigned int )fm->max_pool_size > 256U) { { printk("\vubi%d error: %s: bad maximal pool size: %i\n", ubi->ubi_num, "ubi_attach_fastmap", fm->max_pool_size); } goto fail_bad; } else { } if ((unsigned int )fm->max_wl_pool_size > 256U) { { printk("\vubi%d error: %s: bad maximal WL pool size: %i\n", ubi->ubi_num, "ubi_attach_fastmap", fm->max_wl_pool_size); } goto fail_bad; } else { } i = 0; goto ldv_31721; ldv_31720: fmec = (struct ubi_fm_ec *)(fm_raw + fm_pos); fm_pos = fm_pos + 8UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___9 = __fswab32(fmec->ec); tmp___10 = __fswab32(fmec->pnum); add_aeb(ai, & ai->free, (int )tmp___10, (int )tmp___9, 0); i = i + 1; } ldv_31721: { tmp___11 = __fswab32(fmhdr->free_peb_count); } if ((unsigned int )i < tmp___11) { goto ldv_31720; } else { } i = 0; goto ldv_31724; ldv_31723: fmec = (struct ubi_fm_ec *)(fm_raw + fm_pos); fm_pos = fm_pos + 8UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___12 = __fswab32(fmec->ec); tmp___13 = __fswab32(fmec->pnum); add_aeb(ai, & used, (int )tmp___13, (int )tmp___12, 0); i = i + 1; } ldv_31724: { tmp___14 = __fswab32(fmhdr->used_peb_count); } if ((unsigned int )i < tmp___14) { goto ldv_31723; } else { } i = 0; goto ldv_31727; ldv_31726: fmec = (struct ubi_fm_ec *)(fm_raw + fm_pos); fm_pos = fm_pos + 8UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___15 = __fswab32(fmec->ec); tmp___16 = __fswab32(fmec->pnum); add_aeb(ai, & used, (int )tmp___16, (int )tmp___15, 1); i = i + 1; } ldv_31727: { tmp___17 = __fswab32(fmhdr->scrub_peb_count); } if ((unsigned int )i < tmp___17) { goto ldv_31726; } else { } i = 0; goto ldv_31730; ldv_31729: fmec = (struct ubi_fm_ec *)(fm_raw + fm_pos); fm_pos = fm_pos + 8UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___18 = __fswab32(fmec->ec); tmp___19 = __fswab32(fmec->pnum); add_aeb(ai, & ai->erase, (int )tmp___19, (int )tmp___18, 1); i = i + 1; } ldv_31730: { tmp___20 = __fswab32(fmhdr->erase_peb_count); } if ((unsigned int )i < tmp___20) { goto ldv_31729; } else { } { tmp___21 = div_u64(ai->ec_sum, (u32 )ai->ec_count); ai->mean_ec = (int )tmp___21; tmp___22 = __fswab32(fmhdr->bad_peb_count); ai->bad_peb_count = (int )tmp___22; i = 0; } goto ldv_31756; ldv_31755: fmvhdr = (struct ubi_fm_volhdr *)(fm_raw + fm_pos); fm_pos = fm_pos + 32UL; if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___24 = __fswab32(fmvhdr->magic); } if (tmp___24 != 4197912273U) { { tmp___23 = __fswab32(fmvhdr->magic); printk("\vubi%d error: %s: bad fastmap vol header magic: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_attach_fastmap", tmp___23, 4197912273U); } goto fail_bad; } else { } { tmp___25 = __fswab32(fmvhdr->last_eb_bytes); tmp___26 = __fswab32(fmvhdr->data_pad); tmp___27 = __fswab32(fmvhdr->used_ebs); tmp___28 = __fswab32(fmvhdr->vol_id); av = add_vol(ai, (int )tmp___28, (int )tmp___27, (int )tmp___26, (int )fmvhdr->vol_type, (int )tmp___25); } if ((unsigned long )av == (unsigned long )((struct ubi_ainf_volume *)0)) { goto fail_bad; } else { } { ai->vols_found = ai->vols_found + 1; tmp___30 = __fswab32(fmvhdr->vol_id); } if ((unsigned int )ai->highest_vol_id < tmp___30) { { tmp___29 = __fswab32(fmvhdr->vol_id); ai->highest_vol_id = (int )tmp___29; } } else { } { fm_eba = (struct ubi_fm_eba *)(fm_raw + fm_pos); fm_pos = fm_pos + 8UL; tmp___31 = __fswab32(fm_eba->reserved_pebs); fm_pos = fm_pos + (unsigned long )tmp___31 * 4UL; } if (fm_pos >= fm_size) { goto fail_bad; } else { } { tmp___33 = __fswab32(fm_eba->magic); } if (tmp___33 != 4039131304U) { { tmp___32 = __fswab32(fm_eba->magic); printk("\vubi%d error: %s: bad fastmap EBA header magic: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_attach_fastmap", tmp___32, 4039131304U); } goto fail_bad; } else { } j = 0; goto ldv_31743; ldv_31742: { tmp___34 = __fswab32(fm_eba->pnum[j]); pnum = (int )tmp___34; tmp___35 = __fswab32(fm_eba->pnum[j]); } if ((int )tmp___35 < 0) { goto ldv_31733; } else { } aeb = (struct ubi_ainf_peb *)0; __mptr = (struct list_head const *)used.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr + 0xffffffffffffffe0UL; goto ldv_31740; ldv_31739: ; if (tmp_aeb->pnum == pnum) { aeb = tmp_aeb; goto ldv_31738; } else { } __mptr___0 = (struct list_head const *)tmp_aeb->u.list.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___0 + 0xffffffffffffffe0UL; ldv_31740: ; if ((unsigned long )(& tmp_aeb->u.list) != (unsigned long )(& used)) { goto ldv_31739; } else { } ldv_31738: ; if ((unsigned long )aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { { tmp___36 = ldv_kmem_cache_alloc_98(ai->aeb_slab_cache, 208U); aeb = (struct ubi_ainf_peb *)tmp___36; } if ((unsigned long )aeb == (unsigned long )((struct ubi_ainf_peb *)0)) { ret = -12; goto fail; } else { } { aeb->lnum = j; tmp___37 = __fswab32(fm_eba->pnum[j]); aeb->pnum = (int )tmp___37; aeb->ec = -1; aeb->sqnum = 0ULL; tmp___38 = 0U; aeb->copy_flag = tmp___38; aeb->scrub = tmp___38; list_add_tail(& aeb->u.list, & eba_orphans); } goto ldv_31733; } else { } aeb->lnum = j; if (av->highest_lnum <= aeb->lnum) { av->highest_lnum = aeb->lnum; } else { } { assign_aeb_to_av(ai, aeb, av); descriptor.modname = "ubi"; descriptor.function = "ubi_attach_fastmap"; descriptor.filename = "drivers/mtd/ubi/fastmap.c"; descriptor.format = "UBI DBG bld (pid %d): inserting PEB:%i (LEB %i) to vol %i\n"; descriptor.lineno = 776U; descriptor.flags = 0U; tmp___40 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___40 != 0L) { { tmp___39 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): inserting PEB:%i (LEB %i) to vol %i\n", tmp___39->pid, aeb->pnum, aeb->lnum, av->vol_id); } } else { } ldv_31733: j = j + 1; ldv_31743: { tmp___41 = __fswab32(fm_eba->reserved_pebs); } if ((unsigned int )j < tmp___41) { goto ldv_31742; } else { } { tmp___42 = kzalloc((size_t )ubi->ec_hdr_alsize, 208U); ech___0 = (struct ubi_ec_hdr *)tmp___42; } if ((unsigned long )ech___0 == (unsigned long )((struct ubi_ec_hdr *)0)) { ret = -12; goto fail; } else { } __mptr___1 = (struct list_head const *)eba_orphans.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___1 + 0xffffffffffffffe0UL; __mptr___2 = (struct list_head const *)tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___2 + 0xffffffffffffffe0UL; goto ldv_31753; ldv_31752: { tmp___43 = ubi_io_is_bad((struct ubi_device const *)ubi, tmp_aeb->pnum); } if (tmp___43 != 0) { { printk("\vubi%d error: %s: bad PEB in fastmap EBA orphan list\n", ubi->ubi_num, "ubi_attach_fastmap"); ret = 2; kfree((void const *)ech___0); } goto fail; } else { } { err = ubi_io_read_ec_hdr(ubi, tmp_aeb->pnum, ech___0, 0); } if (err != 0 && err != 5) { { printk("\vubi%d error: %s: unable to read EC header! PEB:%i err:%i\n", ubi->ubi_num, "ubi_attach_fastmap", tmp_aeb->pnum, err); ret = err <= 0 ? err : 2; kfree((void const *)ech___0); } goto fail; } else if (err == 5) { tmp_aeb->scrub = 1U; } else { } { tmp___44 = __fswab64(ech___0->ec); tmp_aeb->ec = (int )tmp___44; assign_aeb_to_av(ai, tmp_aeb, av); tmp_aeb = _tmp_aeb; __mptr___3 = (struct list_head const *)_tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___3 + 0xffffffffffffffe0UL; } ldv_31753: ; if ((unsigned long )(& tmp_aeb->u.list) != (unsigned long )(& eba_orphans)) { goto ldv_31752; } else { } { kfree((void const *)ech___0); i = i + 1; } ldv_31756: { tmp___45 = __fswab32(fmhdr->vol_count); } if ((unsigned int )i < tmp___45) { goto ldv_31755; } else { } { ret = scan_pool(ubi, ai, (int *)(& fmpl1->pebs), pool_size, & max_sqnum, & eba_orphans, & free___0); } if (ret != 0) { goto fail; } else { } { ret = scan_pool(ubi, ai, (int *)(& fmpl2->pebs), wl_pool_size, & max_sqnum, & eba_orphans, & free___0); } if (ret != 0) { goto fail; } else { } if (max_sqnum > ai->max_sqnum) { ai->max_sqnum = max_sqnum; } else { } __mptr___4 = (struct list_head const *)free___0.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___4 + 0xffffffffffffffe0UL; __mptr___5 = (struct list_head const *)tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___5 + 0xffffffffffffffe0UL; goto ldv_31765; ldv_31764: { list_move_tail(& tmp_aeb->u.list, & ai->free); tmp_aeb = _tmp_aeb; __mptr___6 = (struct list_head const *)_tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___6 + 0xffffffffffffffe0UL; } ldv_31765: ; if ((unsigned long )(& tmp_aeb->u.list) != (unsigned long )(& free___0)) { goto ldv_31764; } else { } { tmp___47 = list_empty((struct list_head const *)(& used)); tmp___48 = ldv__builtin_expect(tmp___47 == 0, 0L); } if (tmp___48 != 0L) { { tmp___46 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_attach_fastmap", 830, tmp___46->pid); dump_stack(); } } else { } { tmp___50 = list_empty((struct list_head const *)(& eba_orphans)); tmp___51 = ldv__builtin_expect(tmp___50 == 0, 0L); } if (tmp___51 != 0L) { { tmp___49 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_attach_fastmap", 831, tmp___49->pid); dump_stack(); } } else { } { tmp___53 = list_empty((struct list_head const *)(& free___0)); tmp___54 = ldv__builtin_expect(tmp___53 == 0, 0L); } if (tmp___54 != 0L) { { tmp___52 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_attach_fastmap", 832, tmp___52->pid); dump_stack(); } } else { } { tmp___55 = count_fastmap_pebs(ai); __ret_warn_on = tmp___55 != (ubi->peb_count - ai->bad_peb_count) - fm->used_blocks; tmp___56 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___56 != 0L) { { warn_slowpath_null("drivers/mtd/ubi/fastmap.c", 841); } } else { } { tmp___57 = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp___57 != 0L) { goto fail_bad; } else { } return (0); fail_bad: ret = 2; fail: __mptr___7 = (struct list_head const *)used.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___7 + 0xffffffffffffffe0UL; __mptr___8 = (struct list_head const *)tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___8 + 0xffffffffffffffe0UL; goto ldv_31776; ldv_31775: { list_del(& tmp_aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)tmp_aeb); tmp_aeb = _tmp_aeb; __mptr___9 = (struct list_head const *)_tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___9 + 0xffffffffffffffe0UL; } ldv_31776: ; if ((unsigned long )(& tmp_aeb->u.list) != (unsigned long )(& used)) { goto ldv_31775; } else { } __mptr___10 = (struct list_head const *)eba_orphans.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___10 + 0xffffffffffffffe0UL; __mptr___11 = (struct list_head const *)tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___11 + 0xffffffffffffffe0UL; goto ldv_31785; ldv_31784: { list_del(& tmp_aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)tmp_aeb); tmp_aeb = _tmp_aeb; __mptr___12 = (struct list_head const *)_tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___12 + 0xffffffffffffffe0UL; } ldv_31785: ; if ((unsigned long )(& tmp_aeb->u.list) != (unsigned long )(& eba_orphans)) { goto ldv_31784; } else { } __mptr___13 = (struct list_head const *)free___0.next; tmp_aeb = (struct ubi_ainf_peb *)__mptr___13 + 0xffffffffffffffe0UL; __mptr___14 = (struct list_head const *)tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___14 + 0xffffffffffffffe0UL; goto ldv_31794; ldv_31793: { list_del(& tmp_aeb->u.list); kmem_cache_free(ai->aeb_slab_cache, (void *)tmp_aeb); tmp_aeb = _tmp_aeb; __mptr___15 = (struct list_head const *)_tmp_aeb->u.list.next; _tmp_aeb = (struct ubi_ainf_peb *)__mptr___15 + 0xffffffffffffffe0UL; } ldv_31794: ; if ((unsigned long )(& tmp_aeb->u.list) != (unsigned long )(& free___0)) { goto ldv_31793; } else { } return (ret); } } int ubi_scan_fastmap(struct ubi_device *ubi , struct ubi_attach_info *ai , int fm_anchor ) { struct ubi_fm_sb *fmsb ; struct ubi_fm_sb *fmsb2 ; struct ubi_vid_hdr *vh ; struct ubi_ec_hdr *ech___0 ; struct ubi_fastmap_layout *fm ; int i ; int used_blocks ; int pnum ; int ret ; size_t fm_size ; __be32 crc ; __be32 tmp_crc ; unsigned long long sqnum ; void *tmp ; void *tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; void *tmp___4 ; int image_seq ; __u32 tmp___5 ; int tmp___6 ; __u32 tmp___7 ; __u32 tmp___8 ; __u32 tmp___9 ; __u32 tmp___10 ; __u32 tmp___11 ; __u32 tmp___12 ; __u64 tmp___13 ; __u64 tmp___14 ; __u32 tmp___15 ; struct ubi_wl_entry *e ; void *tmp___16 ; int tmp___17 ; __u32 tmp___18 ; __u32 tmp___19 ; { { ret = 0; sqnum = 0ULL; ldv_mutex_lock_99___0(& ubi->fm_mutex); __memset(ubi->fm_buf, 0, ubi->fm_size); tmp = kmalloc(312UL, 208U); fmsb = (struct ubi_fm_sb *)tmp; } if ((unsigned long )fmsb == (unsigned long )((struct ubi_fm_sb *)0)) { ret = -12; goto out; } else { } { tmp___0 = kzalloc(400UL, 208U); fm = (struct ubi_fastmap_layout *)tmp___0; } if ((unsigned long )fm == (unsigned long )((struct ubi_fastmap_layout *)0)) { { ret = -12; kfree((void const *)fmsb); } goto out; } else { } { ret = ubi_io_read((struct ubi_device const *)ubi, (void *)fmsb, fm_anchor, ubi->leb_start, 312); } if (ret != 0 && ret != 5) { goto free_fm_sb; } else if (ret == 5) { fm->to_be_tortured[0] = 1; } else { } { tmp___2 = __fswab32(fmsb->magic); } if (tmp___2 != 2064766623U) { { tmp___1 = __fswab32(fmsb->magic); printk("\vubi%d error: %s: bad super block magic: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_scan_fastmap", tmp___1, 2064766623); ret = 2; } goto free_fm_sb; } else { } if ((unsigned int )fmsb->version != 1U) { { printk("\vubi%d error: %s: bad fastmap version: %i, expected: %i\n", ubi->ubi_num, "ubi_scan_fastmap", (int )fmsb->version, 1); ret = 2; } goto free_fm_sb; } else { } { tmp___3 = __fswab32(fmsb->used_blocks); used_blocks = (int )tmp___3; } if ((unsigned int )used_blocks - 1U > 31U) { { printk("\vubi%d error: %s: number of fastmap blocks is invalid: %i\n", ubi->ubi_num, "ubi_scan_fastmap", used_blocks); ret = 2; } goto free_fm_sb; } else { } fm_size = (size_t )(ubi->leb_size * used_blocks); if (fm_size != ubi->fm_size) { { printk("\vubi%d error: %s: bad fastmap size: %zi, expected: %zi\n", ubi->ubi_num, "ubi_scan_fastmap", fm_size, ubi->fm_size); ret = 2; } goto free_fm_sb; } else { } { tmp___4 = kzalloc((size_t )ubi->ec_hdr_alsize, 208U); ech___0 = (struct ubi_ec_hdr *)tmp___4; } if ((unsigned long )ech___0 == (unsigned long )((struct ubi_ec_hdr *)0)) { ret = -12; goto free_fm_sb; } else { } { vh = ubi_zalloc_vid_hdr___4((struct ubi_device const *)ubi, 208U); } if ((unsigned long )vh == (unsigned long )((struct ubi_vid_hdr *)0)) { ret = -12; goto free_hdr; } else { } i = 0; goto ldv_31820; ldv_31819: { tmp___5 = __fswab32(fmsb->block_loc[i]); pnum = (int )tmp___5; tmp___6 = ubi_io_is_bad((struct ubi_device const *)ubi, pnum); } if (tmp___6 != 0) { ret = 2; goto free_hdr; } else { } { ret = ubi_io_read_ec_hdr(ubi, pnum, ech___0, 0); } if (ret != 0 && ret != 5) { { printk("\vubi%d error: %s: unable to read fastmap block# %i EC (PEB: %i)\n", ubi->ubi_num, "ubi_scan_fastmap", i, pnum); } if (ret > 0) { ret = 2; } else { } goto free_hdr; } else if (ret == 5) { fm->to_be_tortured[i] = 1; } else { } { tmp___7 = __fswab32(ech___0->image_seq); image_seq = (int )tmp___7; } if (ubi->image_seq == 0) { ubi->image_seq = image_seq; } else { } if (image_seq != 0 && image_seq != ubi->image_seq) { { tmp___8 = __fswab32(ech___0->image_seq); printk("\vubi%d error: %s: wrong image seq:%d instead of %d\n", ubi->ubi_num, "ubi_scan_fastmap", tmp___8, ubi->image_seq); ret = 2; } goto free_hdr; } else { } { ret = ubi_io_read_vid_hdr(ubi, pnum, vh, 0); } if (ret != 0 && ret != 5) { { printk("\vubi%d error: %s: unable to read fastmap block# %i (PEB: %i)\n", ubi->ubi_num, "ubi_scan_fastmap", i, pnum); } goto free_hdr; } else { } if (i == 0) { { tmp___10 = __fswab32(vh->vol_id); } if (tmp___10 != 2147479552U) { { tmp___9 = __fswab32(vh->vol_id); printk("\vubi%d error: %s: bad fastmap anchor vol_id: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_scan_fastmap", tmp___9, 2147479552); ret = 2; } goto free_hdr; } else { } } else { { tmp___12 = __fswab32(vh->vol_id); } if (tmp___12 != 2147479553U) { { tmp___11 = __fswab32(vh->vol_id); printk("\vubi%d error: %s: bad fastmap data vol_id: 0x%x, expected: 0x%x\n", ubi->ubi_num, "ubi_scan_fastmap", tmp___11, 2147479553); ret = 2; } goto free_hdr; } else { } } { tmp___14 = __fswab64(vh->sqnum); } if (sqnum < tmp___14) { { tmp___13 = __fswab64(vh->sqnum); sqnum = tmp___13; } } else { } { ret = ubi_io_read((struct ubi_device const *)ubi, ubi->fm_buf + (unsigned long )(ubi->leb_size * i), pnum, ubi->leb_start, ubi->leb_size); } if (ret != 0 && ret != 5) { { printk("\vubi%d error: %s: unable to read fastmap block# %i (PEB: %i, err: %i)\n", ubi->ubi_num, "ubi_scan_fastmap", i, pnum, ret); } goto free_hdr; } else { } i = i + 1; ldv_31820: ; if (i < used_blocks) { goto ldv_31819; } else { } { kfree((void const *)fmsb); fmsb = (struct ubi_fm_sb *)0; fmsb2 = (struct ubi_fm_sb *)ubi->fm_buf; tmp___15 = __fswab32(fmsb2->data_crc); tmp_crc = tmp___15; fmsb2->data_crc = 0U; crc = crc32_le(4294967295U, (unsigned char const *)ubi->fm_buf, fm_size); } if (crc != tmp_crc) { { printk("\vubi%d error: %s: fastmap data CRC is invalid\n", ubi->ubi_num, "ubi_scan_fastmap"); printk("\vubi%d error: %s: CRC should be: 0x%x, calc: 0x%x\n", ubi->ubi_num, "ubi_scan_fastmap", tmp_crc, crc); ret = 2; } goto free_hdr; } else { } { fmsb2->sqnum = sqnum; fm->used_blocks = used_blocks; ret = ubi_attach_fastmap(ubi, ai, fm); } if (ret != 0) { if (ret > 0) { ret = 2; } else { } goto free_hdr; } else { } i = 0; goto ldv_31827; ldv_31826: { tmp___16 = ldv_kmem_cache_alloc_100___0(ubi_wl_entry_slab, 208U); e = (struct ubi_wl_entry *)tmp___16; } if ((unsigned long )e == (unsigned long )((struct ubi_wl_entry *)0)) { goto ldv_31824; ldv_31823: { kfree((void const *)fm->e[i]); } ldv_31824: tmp___17 = i; i = i - 1; if (tmp___17 != 0) { goto ldv_31823; } else { } ret = -12; goto free_hdr; } else { } { tmp___18 = __fswab32(fmsb2->block_loc[i]); e->pnum = (int )tmp___18; tmp___19 = __fswab32(fmsb2->block_ec[i]); e->ec = (int )tmp___19; fm->e[i] = e; i = i + 1; } ldv_31827: ; if (i < used_blocks) { goto ldv_31826; } else { } { ubi->fm = fm; ubi->fm_pool.max_size = (ubi->fm)->max_pool_size; ubi->fm_wl_pool.max_size = (ubi->fm)->max_wl_pool_size; printk("\rubi%d: attached by fastmap\n", ubi->ubi_num); printk("\rubi%d: fastmap pool size: %d\n", ubi->ubi_num, ubi->fm_pool.max_size); printk("\rubi%d: fastmap WL pool size: %d\n", ubi->ubi_num, ubi->fm_wl_pool.max_size); ubi->fm_disabled = 0; ubi_free_vid_hdr((struct ubi_device const *)ubi, vh); kfree((void const *)ech___0); } out: { ldv_mutex_unlock_101(& ubi->fm_mutex); } if (ret == 2) { { printk("\vubi%d error: %s: Attach by fastmap failed, doing a full scan!\n", ubi->ubi_num, "ubi_scan_fastmap"); } } else { } return (ret); free_hdr: { ubi_free_vid_hdr((struct ubi_device const *)ubi, vh); kfree((void const *)ech___0); } free_fm_sb: { kfree((void const *)fmsb); kfree((void const *)fm); } goto out; } } static int ubi_write_fastmap(struct ubi_device *ubi , struct ubi_fastmap_layout *new_fm ) { size_t fm_pos ; void *fm_raw ; struct ubi_fm_sb *fmsb ; struct ubi_fm_hdr *fmh ; struct ubi_fm_scan_pool *fmpl1 ; struct ubi_fm_scan_pool *fmpl2 ; struct ubi_fm_ec *fec ; struct ubi_fm_volhdr *fvh ; struct ubi_fm_eba *feba ; struct rb_node *node ; struct ubi_wl_entry *wl_e ; struct ubi_volume *vol ; struct ubi_vid_hdr *avhdr ; struct ubi_vid_hdr *dvhdr ; struct ubi_work *ubi_wrk ; int ret ; int i ; int j ; int free_peb_count ; int used_peb_count ; int vol_count ; int scrub_peb_count ; int erase_peb_count ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; __u32 tmp___3 ; __u16 tmp___4 ; __u16 tmp___5 ; __u32 tmp___6 ; __u16 tmp___7 ; __u16 tmp___8 ; __u32 tmp___9 ; struct rb_node const *__mptr ; __u32 tmp___10 ; __u32 tmp___11 ; struct task_struct *tmp___12 ; long tmp___13 ; __u32 tmp___14 ; struct rb_node const *__mptr___0 ; __u32 tmp___15 ; __u32 tmp___16 ; struct task_struct *tmp___17 ; long tmp___18 ; struct list_head const *__mptr___1 ; __u32 tmp___19 ; __u32 tmp___20 ; struct task_struct *tmp___21 ; long tmp___22 ; struct list_head const *__mptr___2 ; __u32 tmp___23 ; struct rb_node const *__mptr___3 ; __u32 tmp___24 ; __u32 tmp___25 ; struct task_struct *tmp___26 ; long tmp___27 ; __u32 tmp___28 ; struct list_head const *__mptr___4 ; struct task_struct *tmp___29 ; long tmp___30 ; __u32 tmp___31 ; __u32 tmp___32 ; struct task_struct *tmp___33 ; long tmp___34 ; int tmp___35 ; struct list_head const *__mptr___5 ; __u32 tmp___36 ; struct task_struct *tmp___37 ; long tmp___38 ; __u32 tmp___39 ; __u32 tmp___40 ; __u32 tmp___41 ; __u32 tmp___42 ; struct task_struct *tmp___43 ; long tmp___44 ; struct task_struct *tmp___45 ; long tmp___46 ; __u32 tmp___47 ; __u32 tmp___48 ; __u32 tmp___49 ; __u32 tmp___50 ; unsigned long long tmp___51 ; __u64 tmp___52 ; struct _ddebug descriptor ; struct task_struct *tmp___53 ; long tmp___54 ; __u32 tmp___55 ; __u32 tmp___56 ; u32 tmp___62 ; __u32 tmp___63 ; unsigned long long tmp___64 ; __u64 tmp___65 ; __u32 tmp___66 ; struct _ddebug descriptor___0 ; __u64 tmp___67 ; struct task_struct *tmp___68 ; long tmp___69 ; struct task_struct *tmp___70 ; long tmp___71 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___72 ; long tmp___73 ; { { fm_pos = 0UL; fm_raw = ubi->fm_buf; __memset(ubi->fm_buf, 0, ubi->fm_size); avhdr = new_fm_vhdr(ubi, 2147479552); } if ((unsigned long )avhdr == (unsigned long )((struct ubi_vid_hdr *)0)) { ret = -12; goto out; } else { } { dvhdr = new_fm_vhdr(ubi, 2147479553); } if ((unsigned long )dvhdr == (unsigned long )((struct ubi_vid_hdr *)0)) { ret = -12; goto out_kfree; } else { } { ldv_spin_lock_95(& ubi->volumes_lock); ldv_spin_lock_114(& ubi->wl_lock); fmsb = (struct ubi_fm_sb *)fm_raw; fm_pos = fm_pos + 312UL; tmp___0 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___0 != 0L) { { tmp = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1138, tmp->pid); dump_stack(); } } else { } { fmh = (struct ubi_fm_hdr *)(fm_raw + fm_pos); fm_pos = fm_pos + 32UL; tmp___2 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___2 != 0L) { { tmp___1 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1142, tmp___1->pid); dump_stack(); } } else { } { fmsb->magic = 2681606523U; fmsb->version = 1U; tmp___3 = __fswab32((__u32 )new_fm->used_blocks); fmsb->used_blocks = tmp___3; fmsb->sqnum = 0ULL; fmh->magic = 4147034324U; free_peb_count = 0; used_peb_count = 0; scrub_peb_count = 0; erase_peb_count = 0; vol_count = 0; fmpl1 = (struct ubi_fm_scan_pool *)(fm_raw + fm_pos); fm_pos = fm_pos + 1048UL; fmpl1->magic = 139308903U; tmp___4 = __fswab16((int )((__u16 )ubi->fm_pool.size)); fmpl1->size = tmp___4; tmp___5 = __fswab16((int )((__u16 )ubi->fm_pool.max_size)); fmpl1->max_size = tmp___5; i = 0; } goto ldv_31860; ldv_31859: { tmp___6 = __fswab32((__u32 )ubi->fm_pool.pebs[i]); fmpl1->pebs[i] = tmp___6; i = i + 1; } ldv_31860: ; if (i < ubi->fm_pool.size) { goto ldv_31859; } else { } { fmpl2 = (struct ubi_fm_scan_pool *)(fm_raw + fm_pos); fm_pos = fm_pos + 1048UL; fmpl2->magic = 139308903U; tmp___7 = __fswab16((int )((__u16 )ubi->fm_wl_pool.size)); fmpl2->size = tmp___7; tmp___8 = __fswab16((int )((__u16 )ubi->fm_wl_pool.max_size)); fmpl2->max_size = tmp___8; i = 0; } goto ldv_31863; ldv_31862: { tmp___9 = __fswab32((__u32 )ubi->fm_wl_pool.pebs[i]); fmpl2->pebs[i] = tmp___9; i = i + 1; } ldv_31863: ; if (i < ubi->fm_wl_pool.size) { goto ldv_31862; } else { } { node = rb_first((struct rb_root const *)(& ubi->free)); } goto ldv_31868; ldv_31867: { __mptr = (struct rb_node const *)node; wl_e = (struct ubi_wl_entry *)__mptr; fec = (struct ubi_fm_ec *)(fm_raw + fm_pos); tmp___10 = __fswab32((__u32 )wl_e->pnum); fec->pnum = tmp___10; tmp___11 = __fswab32((__u32 )wl_e->ec); fec->ec = tmp___11; free_peb_count = free_peb_count + 1; fm_pos = fm_pos + 8UL; tmp___13 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___13 != 0L) { { tmp___12 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1184, tmp___12->pid); dump_stack(); } } else { } { node = rb_next((struct rb_node const *)node); } ldv_31868: ; if ((unsigned long )node != (unsigned long )((struct rb_node *)0)) { goto ldv_31867; } else { } { tmp___14 = __fswab32((__u32 )free_peb_count); fmh->free_peb_count = tmp___14; node = rb_first((struct rb_root const *)(& ubi->used)); } goto ldv_31873; ldv_31872: { __mptr___0 = (struct rb_node const *)node; wl_e = (struct ubi_wl_entry *)__mptr___0; fec = (struct ubi_fm_ec *)(fm_raw + fm_pos); tmp___15 = __fswab32((__u32 )wl_e->pnum); fec->pnum = tmp___15; tmp___16 = __fswab32((__u32 )wl_e->ec); fec->ec = tmp___16; used_peb_count = used_peb_count + 1; fm_pos = fm_pos + 8UL; tmp___18 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___18 != 0L) { { tmp___17 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1197, tmp___17->pid); dump_stack(); } } else { } { node = rb_next((struct rb_node const *)node); } ldv_31873: ; if ((unsigned long )node != (unsigned long )((struct rb_node *)0)) { goto ldv_31872; } else { } i = 0; goto ldv_31883; ldv_31882: __mptr___1 = (struct list_head const *)((struct list_head *)(& ubi->pq) + (unsigned long )i)->next; wl_e = (struct ubi_wl_entry *)__mptr___1; goto ldv_31880; ldv_31879: { fec = (struct ubi_fm_ec *)(fm_raw + fm_pos); tmp___19 = __fswab32((__u32 )wl_e->pnum); fec->pnum = tmp___19; tmp___20 = __fswab32((__u32 )wl_e->ec); fec->ec = tmp___20; used_peb_count = used_peb_count + 1; fm_pos = fm_pos + 8UL; tmp___22 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___22 != 0L) { { tmp___21 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1209, tmp___21->pid); dump_stack(); } } else { } __mptr___2 = (struct list_head const *)wl_e->u.list.next; wl_e = (struct ubi_wl_entry *)__mptr___2; ldv_31880: ; if ((unsigned long )(& wl_e->u.list) != (unsigned long )((struct list_head *)(& ubi->pq) + (unsigned long )i)) { goto ldv_31879; } else { } i = i + 1; ldv_31883: ; if (i <= 9) { goto ldv_31882; } else { } { tmp___23 = __fswab32((__u32 )used_peb_count); fmh->used_peb_count = tmp___23; node = rb_first((struct rb_root const *)(& ubi->scrub)); } goto ldv_31888; ldv_31887: { __mptr___3 = (struct rb_node const *)node; wl_e = (struct ubi_wl_entry *)__mptr___3; fec = (struct ubi_fm_ec *)(fm_raw + fm_pos); tmp___24 = __fswab32((__u32 )wl_e->pnum); fec->pnum = tmp___24; tmp___25 = __fswab32((__u32 )wl_e->ec); fec->ec = tmp___25; scrub_peb_count = scrub_peb_count + 1; fm_pos = fm_pos + 8UL; tmp___27 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___27 != 0L) { { tmp___26 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1223, tmp___26->pid); dump_stack(); } } else { } { node = rb_next((struct rb_node const *)node); } ldv_31888: ; if ((unsigned long )node != (unsigned long )((struct rb_node *)0)) { goto ldv_31887; } else { } { tmp___28 = __fswab32((__u32 )scrub_peb_count); fmh->scrub_peb_count = tmp___28; __mptr___4 = (struct list_head const *)ubi->works.next; ubi_wrk = (struct ubi_work *)__mptr___4; } goto ldv_31895; ldv_31894: { tmp___35 = ubi_is_erase_work(ubi_wrk); } if (tmp___35 != 0) { { wl_e = ubi_wrk->e; tmp___30 = ldv__builtin_expect((unsigned long )wl_e == (unsigned long )((struct ubi_wl_entry *)0), 0L); } if (tmp___30 != 0L) { { tmp___29 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1231, tmp___29->pid); dump_stack(); } } else { } { fec = (struct ubi_fm_ec *)(fm_raw + fm_pos); tmp___31 = __fswab32((__u32 )wl_e->pnum); fec->pnum = tmp___31; tmp___32 = __fswab32((__u32 )wl_e->ec); fec->ec = tmp___32; erase_peb_count = erase_peb_count + 1; fm_pos = fm_pos + 8UL; tmp___34 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___34 != 0L) { { tmp___33 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1240, tmp___33->pid); dump_stack(); } } else { } } else { } __mptr___5 = (struct list_head const *)ubi_wrk->list.next; ubi_wrk = (struct ubi_work *)__mptr___5; ldv_31895: ; if ((unsigned long )(& ubi_wrk->list) != (unsigned long )(& ubi->works)) { goto ldv_31894; } else { } { tmp___36 = __fswab32((__u32 )erase_peb_count); fmh->erase_peb_count = tmp___36; i = 0; } goto ldv_31902; ldv_31901: vol = ubi->volumes[i]; if ((unsigned long )vol == (unsigned long )((struct ubi_volume *)0)) { goto ldv_31897; } else { } { vol_count = vol_count + 1; fvh = (struct ubi_fm_volhdr *)(fm_raw + fm_pos); fm_pos = fm_pos + 32UL; tmp___38 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___38 != 0L) { { tmp___37 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1255, tmp___37->pid); dump_stack(); } } else { } { fvh->magic = 3507369978U; tmp___39 = __fswab32((__u32 )vol->vol_id); fvh->vol_id = tmp___39; fvh->vol_type = (__u8 )vol->vol_type; tmp___40 = __fswab32((__u32 )vol->used_ebs); fvh->used_ebs = tmp___40; tmp___41 = __fswab32((__u32 )vol->data_pad); fvh->data_pad = tmp___41; tmp___42 = __fswab32((__u32 )vol->last_eb_bytes); fvh->last_eb_bytes = tmp___42; tmp___44 = ldv__builtin_expect((unsigned int )vol->vol_type - 3U > 1U, 0L); } if (tmp___44 != 0L) { { tmp___43 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1265, tmp___43->pid); dump_stack(); } } else { } { feba = (struct ubi_fm_eba *)(fm_raw + fm_pos); fm_pos = fm_pos + ((unsigned long )vol->reserved_pebs + 2UL) * 4UL; tmp___46 = ldv__builtin_expect(fm_pos > ubi->fm_size, 0L); } if (tmp___46 != 0L) { { tmp___45 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1269, tmp___45->pid); dump_stack(); } } else { } j = 0; goto ldv_31899; ldv_31898: { tmp___47 = __fswab32((__u32 )*(vol->eba_tbl + (unsigned long )j)); feba->pnum[j] = tmp___47; j = j + 1; } ldv_31899: ; if (j < vol->reserved_pebs) { goto ldv_31898; } else { } { tmp___48 = __fswab32((__u32 )j); feba->reserved_pebs = tmp___48; feba->magic = 2822815984U; } ldv_31897: i = i + 1; ldv_31902: ; if (i <= 128) { goto ldv_31901; } else { } { tmp___49 = __fswab32((__u32 )vol_count); fmh->vol_count = tmp___49; tmp___50 = __fswab32((__u32 )ubi->bad_peb_count); fmh->bad_peb_count = tmp___50; tmp___51 = ubi_next_sqnum(ubi); tmp___52 = __fswab64(tmp___51); avhdr->sqnum = tmp___52; avhdr->lnum = 0U; ldv_spin_unlock_115(& ubi->wl_lock); ldv_spin_unlock_96(& ubi->volumes_lock); descriptor.modname = "ubi"; descriptor.function = "ubi_write_fastmap"; descriptor.filename = "drivers/mtd/ubi/fastmap.c"; descriptor.format = "UBI DBG bld (pid %d): writing fastmap SB to PEB %i\n"; descriptor.lineno = 1286U; descriptor.flags = 0U; tmp___54 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); } if (tmp___54 != 0L) { { tmp___53 = get_current___1(); __dynamic_pr_debug(& descriptor, "UBI DBG bld (pid %d): writing fastmap SB to PEB %i\n", tmp___53->pid, (new_fm->e[0])->pnum); } } else { } { ret = ubi_io_write_vid_hdr(ubi, (new_fm->e[0])->pnum, avhdr); } if (ret != 0) { { printk("\vubi%d error: %s: unable to write vid_hdr to fastmap SB!\n", ubi->ubi_num, "ubi_write_fastmap"); } goto out_kfree; } else { } i = 0; goto ldv_31906; ldv_31905: { tmp___55 = __fswab32((__u32 )(new_fm->e[i])->pnum); fmsb->block_loc[i] = tmp___55; tmp___56 = __fswab32((__u32 )(new_fm->e[i])->ec); fmsb->block_ec[i] = tmp___56; i = i + 1; } ldv_31906: ; if (i < new_fm->used_blocks) { goto ldv_31905; } else { } { fmsb->data_crc = 0U; tmp___62 = crc32_le(4294967295U, (unsigned char const *)fm_raw, ubi->fm_size); tmp___63 = __fswab32(tmp___62); fmsb->data_crc = tmp___63; i = 1; } goto ldv_31910; ldv_31909: { tmp___64 = ubi_next_sqnum(ubi); tmp___65 = __fswab64(tmp___64); dvhdr->sqnum = tmp___65; tmp___66 = __fswab32((__u32 )i); dvhdr->lnum = tmp___66; descriptor___0.modname = "ubi"; descriptor___0.function = "ubi_write_fastmap"; descriptor___0.filename = "drivers/mtd/ubi/fastmap.c"; descriptor___0.format = "UBI DBG bld (pid %d): writing fastmap data to PEB %i sqnum %llu\n"; descriptor___0.lineno = 1306U; descriptor___0.flags = 0U; tmp___69 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); } if (tmp___69 != 0L) { { tmp___67 = __fswab64(dvhdr->sqnum); tmp___68 = get_current___1(); __dynamic_pr_debug(& descriptor___0, "UBI DBG bld (pid %d): writing fastmap data to PEB %i sqnum %llu\n", tmp___68->pid, (new_fm->e[i])->pnum, tmp___67); } } else { } { ret = ubi_io_write_vid_hdr(ubi, (new_fm->e[i])->pnum, dvhdr); } if (ret != 0) { { printk("\vubi%d error: %s: unable to write vid_hdr to PEB %i!\n", ubi->ubi_num, "ubi_write_fastmap", (new_fm->e[i])->pnum); } goto out_kfree; } else { } i = i + 1; ldv_31910: ; if (i < new_fm->used_blocks) { goto ldv_31909; } else { } i = 0; goto ldv_31913; ldv_31912: { ret = ubi_io_write(ubi, (void const *)fm_raw + (unsigned long )(i * ubi->leb_size), (new_fm->e[i])->pnum, ubi->leb_start, ubi->leb_size); } if (ret != 0) { { printk("\vubi%d error: %s: unable to write fastmap to PEB %i!\n", ubi->ubi_num, "ubi_write_fastmap", (new_fm->e[i])->pnum); } goto out_kfree; } else { } i = i + 1; ldv_31913: ; if (i < new_fm->used_blocks) { goto ldv_31912; } else { } { tmp___71 = ldv__builtin_expect((unsigned long )new_fm == (unsigned long )((struct ubi_fastmap_layout *)0), 0L); } if (tmp___71 != 0L) { { tmp___70 = get_current___1(); printk("\nUBI assert failed in %s at %u (pid %d)\n", "ubi_write_fastmap", 1325, tmp___70->pid); dump_stack(); } } else { } { ubi->fm = new_fm; descriptor___1.modname = "ubi"; descriptor___1.function = "ubi_write_fastmap"; descriptor___1.filename = "drivers/mtd/ubi/fastmap.c"; descriptor___1.format = "UBI DBG bld (pid %d): fastmap written!\n"; descriptor___1.lineno = 1328U; descriptor___1.flags = 0U; tmp___73 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); } if (tmp___73 != 0L) { { tmp___72 = get_current___1(); __dynamic_pr_debug(& descriptor___1, "UBI DBG bld (pid %d): fastmap written!\n", tmp___72->pid); } } else { } out_kfree: { ubi_free_vid_hdr((struct ubi_device const *)ubi, avhdr); ubi_free_vid_hdr((struct ubi_device const *)ubi, dvhdr); } out: ; return (ret); } } static int erase_block(struct ubi_device *ubi , int pnum ) { int ret ; struct ubi_ec_hdr *ec_hdr ; long long ec ; void *tmp ; __u64 tmp___0 ; __u64 tmp___1 ; { { tmp = kzalloc((size_t )ubi->ec_hdr_alsize, 208U); ec_hdr = (struct ubi_ec_hdr *)tmp; } if ((unsigned long )ec_hdr == (unsigned long )((struct ubi_ec_hdr *)0)) { return (-12); } else { } { ret = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0); } if (ret < 0) { goto out; } else if (ret != 0 && ret != 5) { ret = -22; goto out; } else { } { ret = ubi_io_sync_erase(ubi, pnum, 0); } if (ret < 0) { goto out; } else { } { tmp___0 = __fswab64(ec_hdr->ec); ec = (long long )tmp___0; ec = ec + (long long )ret; } if (ec > 2147483647LL) { ret = -22; goto out; } else { } { tmp___1 = __fswab64((__u64 )ec); ec_hdr->ec = tmp___1; ret = ubi_io_write_ec_hdr(ubi, pnum, ec_hdr); } if (ret < 0) { goto out; } else { } ret = (int )ec; out: { kfree((void const *)ec_hdr); } return (ret); } } static int invalidate_fastmap(struct ubi_device *ubi , struct ubi_fastmap_layout *fm ) { int ret ; struct ubi_vid_hdr *vh ; unsigned long long tmp ; __u64 tmp___0 ; { { ret = erase_block(ubi, (fm->e[0])->pnum); } if (ret < 0) { return (ret); } else { } { vh = new_fm_vhdr(ubi, 2147479552); } if ((unsigned long )vh == (unsigned long )((struct ubi_vid_hdr *)0)) { return (-12); } else { } { tmp = ubi_next_sqnum(ubi); tmp___0 = __fswab64(tmp); vh->sqnum = tmp___0; ret = ubi_io_write_vid_hdr(ubi, (fm->e[0])->pnum, vh); } return (ret); } } int ubi_update_fastmap(struct ubi_device *ubi ) { int ret ; int i ; struct ubi_fastmap_layout *new_fm ; struct ubi_fastmap_layout *old_fm ; struct ubi_wl_entry *tmp_e ; void *tmp ; void *tmp___0 ; int tmp___1 ; int j ; int j___0 ; int i___0 ; int i___1 ; { { ldv_mutex_lock_106(& ubi->fm_mutex); ubi_refill_pools(ubi); } if (ubi->ro_mode != 0 || ubi->fm_disabled != 0) { { ldv_mutex_unlock_107___0(& ubi->fm_mutex); } return (0); } else { } { ret = ubi_ensure_anchor_pebs(ubi); } if (ret != 0) { { ldv_mutex_unlock_108___1(& ubi->fm_mutex); } return (ret); } else { } { tmp = kzalloc(400UL, 208U); new_fm = (struct ubi_fastmap_layout *)tmp; } if ((unsigned long )new_fm == (unsigned long )((struct ubi_fastmap_layout *)0)) { { ldv_mutex_unlock_109(& ubi->fm_mutex); } return (-12); } else { } new_fm->used_blocks = (int )(ubi->fm_size / (size_t )ubi->leb_size); i = 0; goto ldv_31942; ldv_31941: { tmp___0 = ldv_kmem_cache_alloc_110(ubi_wl_entry_slab, 208U); new_fm->e[i] = (struct ubi_wl_entry *)tmp___0; } if ((unsigned long )new_fm->e[i] == (unsigned long )((struct ubi_wl_entry *)0)) { goto ldv_31939; ldv_31938: { kfree((void const *)new_fm->e[i]); } ldv_31939: tmp___1 = i; i = i - 1; if (tmp___1 != 0) { goto ldv_31938; } else { } { kfree((void const *)new_fm); ldv_mutex_unlock_111(& ubi->fm_mutex); } return (-12); } else { } i = i + 1; ldv_31942: ; if (i < new_fm->used_blocks) { goto ldv_31941; } else { } old_fm = ubi->fm; ubi->fm = (struct ubi_fastmap_layout *)0; if (new_fm->used_blocks > 32) { { printk("\vubi%d error: %s: fastmap too large\n", ubi->ubi_num, "ubi_update_fastmap"); ret = -28; } goto err; } else { } i = 1; goto ldv_31955; ldv_31954: { ldv_spin_lock_114(& ubi->wl_lock); tmp_e = ubi_wl_get_fm_peb(ubi, 0); ldv_spin_unlock_115(& ubi->wl_lock); } if ((unsigned long )tmp_e == (unsigned long )((struct ubi_wl_entry *)0) && (unsigned long )old_fm == (unsigned long )((struct ubi_fastmap_layout *)0)) { { printk("\vubi%d error: %s: could not get any free erase block\n", ubi->ubi_num, "ubi_update_fastmap"); j = 1; } goto ldv_31948; ldv_31947: { ubi_wl_put_fm_peb(ubi, new_fm->e[j], j, 0); j = j + 1; } ldv_31948: ; if (j < i) { goto ldv_31947; } else { } ret = -28; goto err; } else if ((unsigned long )tmp_e == (unsigned long )((struct ubi_wl_entry *)0) && (unsigned long )old_fm != (unsigned long )((struct ubi_fastmap_layout *)0)) { { ret = erase_block(ubi, (old_fm->e[i])->pnum); } if (ret < 0) { j___0 = 1; goto ldv_31952; ldv_31951: { ubi_wl_put_fm_peb(ubi, new_fm->e[j___0], j___0, 0); j___0 = j___0 + 1; } ldv_31952: ; if (j___0 < i) { goto ldv_31951; } else { } { printk("\vubi%d error: %s: could not erase old fastmap PEB\n", ubi->ubi_num, "ubi_update_fastmap"); } goto err; } else { } (new_fm->e[i])->pnum = (old_fm->e[i])->pnum; (new_fm->e[i])->ec = (old_fm->e[i])->ec; } else { (new_fm->e[i])->pnum = tmp_e->pnum; (new_fm->e[i])->ec = tmp_e->ec; if ((unsigned long )old_fm != (unsigned long )((struct ubi_fastmap_layout *)0)) { { ubi_wl_put_fm_peb(ubi, old_fm->e[i], i, old_fm->to_be_tortured[i]); } } else { } } i = i + 1; ldv_31955: ; if (i < new_fm->used_blocks) { goto ldv_31954; } else { } { ldv_spin_lock_114(& ubi->wl_lock); tmp_e = ubi_wl_get_fm_peb(ubi, 1); ldv_spin_unlock_115(& ubi->wl_lock); } if ((unsigned long )old_fm != (unsigned long )((struct ubi_fastmap_layout *)0)) { if ((unsigned long )tmp_e == (unsigned long )((struct ubi_wl_entry *)0)) { { ret = erase_block(ubi, (old_fm->e[0])->pnum); } if (ret < 0) { { printk("\vubi%d error: %s: could not erase old anchor PEB\n", ubi->ubi_num, "ubi_update_fastmap"); i___0 = 1; } goto ldv_31959; ldv_31958: { ubi_wl_put_fm_peb(ubi, new_fm->e[i___0], i___0, 0); i___0 = i___0 + 1; } ldv_31959: ; if (i___0 < new_fm->used_blocks) { goto ldv_31958; } else { } goto err; } else { } (new_fm->e[0])->pnum = (old_fm->e[0])->pnum; (new_fm->e[0])->ec = ret; } else { { ubi_wl_put_fm_peb(ubi, old_fm->e[0], 0, old_fm->to_be_tortured[0]); (new_fm->e[0])->pnum = tmp_e->pnum; (new_fm->e[0])->ec = tmp_e->ec; } } } else { if ((unsigned long )tmp_e == (unsigned long )((struct ubi_wl_entry *)0)) { { printk("\vubi%d error: %s: could not find any anchor PEB\n", ubi->ubi_num, "ubi_update_fastmap"); i___1 = 1; } goto ldv_31963; ldv_31962: { ubi_wl_put_fm_peb(ubi, new_fm->e[i___1], i___1, 0); i___1 = i___1 + 1; } ldv_31963: ; if (i___1 < new_fm->used_blocks) { goto ldv_31962; } else { } ret = -28; goto err; } else { } (new_fm->e[0])->pnum = tmp_e->pnum; (new_fm->e[0])->ec = tmp_e->ec; } { down_write(& ubi->work_sem); down_write(& ubi->fm_sem); ret = ubi_write_fastmap(ubi, new_fm); up_write(& ubi->fm_sem); up_write(& ubi->work_sem); } if (ret != 0) { goto err; } else { } out_unlock: { ldv_mutex_unlock_116___0(& ubi->fm_mutex); kfree((void const *)old_fm); } return (ret); err: { kfree((void const *)new_fm); printk("\fubi%d warning: %s: Unable to write new fastmap, err=%i\n", ubi->ubi_num, "ubi_update_fastmap", ret); ret = 0; } if ((unsigned long )old_fm != (unsigned long )((struct ubi_fastmap_layout *)0)) { { ret = invalidate_fastmap(ubi, old_fm); } if (ret < 0) { { printk("\vubi%d error: %s: Unable to invalidiate current fastmap!\n", ubi->ubi_num, "ubi_update_fastmap"); } } else if (ret != 0) { ret = 0; } else { } } else { } goto out_unlock; } } static void *ldv_kmem_cache_alloc_95___0(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_kmem_cache_alloc_96___0(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_kmem_cache_alloc_97(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void *ldv_kmem_cache_alloc_98(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_lock_99___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void *ldv_kmem_cache_alloc_100___0(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_unlock_101(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_lock_106(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_107___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_108___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_109(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void *ldv_kmem_cache_alloc_110(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { void *tmp ; { { ldv_check_alloc_flags(flags); tmp = ldv_malloc_unknown_size(); } return (tmp); } } static void ldv_mutex_unlock_111(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_116___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(ldv_func_arg1); } return; } } struct gendisk *ldv_linux_block_genhd_alloc_disk(void) ; void ldv_linux_block_genhd_add_disk(void) ; void ldv_linux_block_genhd_del_gendisk(void) ; void ldv_linux_block_genhd_put_disk(struct gendisk *disk ) ; static void ldv_mutex_lock_95___2(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_98___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_100(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_104(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_112(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_114(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_119(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_lock_122___0(struct mutex *ldv_func_arg1 ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_dev_mutex_of_ubiblock(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_lock_devices_mutex(struct mutex *lock ) ; void ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(struct mutex *lock ) ; void ldv_linux_block_queue_blk_cleanup_queue(void) ; __inline static long PTR_ERR(void const *ptr ) ; static void ldv_mutex_unlock_96___2(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_97(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_99___1(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_101___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_102___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_105(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_113(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_115(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_116___1(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_117(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_118___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_120(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_123___0(struct mutex *ldv_func_arg1 ) ; static void ldv_mutex_unlock_124___0(struct mutex *ldv_func_arg1 ) ; extern struct workqueue_struct *__alloc_workqueue_key(char const * , unsigned int , int , struct lock_class_key * , char const * , ...) ; extern void destroy_workqueue(struct workqueue_struct * ) ; extern void dev_err(struct device const * , char const * , ...) ; extern void _dev_info(struct device const * , char const * , ...) ; extern int register_blkdev(unsigned int , char const * ) ; extern void unregister_blkdev(unsigned int , char const * ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; extern void sg_init_table(struct scatterlist * , unsigned int ) ; __inline static void ubi_sgl_init(struct ubi_sgl *usgl ) { { usgl->list_pos = 0; usgl->page_pos = 0; return; } } __inline static int ubi_read_sg(struct ubi_volume_desc *desc , int lnum , struct ubi_sgl *sgl , int offset , int len ) { int tmp ; { { tmp = ubi_leb_read_sg(desc, lnum, sgl, offset, len, 0); } return (tmp); } } extern void add_disk(struct gendisk * ) ; static void ldv_add_disk_106(struct gendisk *disk ) ; extern void del_gendisk(struct gendisk * ) ; static void ldv_del_gendisk_109(struct gendisk *gp ) ; __inline static sector_t get_capacity(struct gendisk *disk ) { { return (disk->part0.nr_sects); } } __inline static void set_capacity(struct gendisk *disk , sector_t size ) { { disk->part0.nr_sects = size; return; } } extern struct gendisk *alloc_disk(int ) ; static struct gendisk *ldv_alloc_disk_103(int minors ) ; extern void put_disk(struct gendisk * ) ; static void ldv_put_disk_108(struct gendisk *disk ) ; static void ldv_put_disk_111(struct gendisk *disk ) ; __inline static sector_t blk_rq_pos(struct request const *rq ) { { return ((sector_t )rq->__sector); } } __inline static unsigned int blk_rq_bytes(struct request const *rq ) { { return ((unsigned int )rq->__data_len); } } extern void blk_cleanup_queue(struct request_queue * ) ; static void ldv_blk_cleanup_queue_107(struct request_queue *ldv_func_arg1 ) ; static void ldv_blk_cleanup_queue_110(struct request_queue *ldv_func_arg1 ) ; extern void blk_queue_max_segments(struct request_queue * , unsigned short ) ; extern int blk_rq_map_sg(struct request_queue * , struct request * , struct scatterlist * ) ; extern struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set * ) ; extern int blk_mq_alloc_tag_set(struct blk_mq_tag_set * ) ; extern void blk_mq_free_tag_set(struct blk_mq_tag_set * ) ; extern struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue * , int const ) ; extern void blk_mq_start_request(struct request * ) ; extern void blk_mq_end_request(struct request * , int ) ; __inline static struct request *blk_mq_rq_from_pdu(void *pdu ) { { return ((struct request *)pdu + 0xfffffffffffffe90UL); } } __inline static void *blk_mq_rq_to_pdu(struct request *rq ) { { return ((void *)rq + 368UL); } } static int ubiblock_devs ; static struct ubiblock_param ubiblock_param[32U] ; static struct list_head ubiblock_devices = {& ubiblock_devices, & ubiblock_devices}; static struct mutex devices_mutex = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, (void *)-1, {0, {0, 0}, "devices_mutex.wait_lock", 0, 0UL}}}}, {& devices_mutex.wait_list, & devices_mutex.wait_list}, 0, (void *)(& devices_mutex), {0, {0, 0}, "devices_mutex", 0, 0UL}}; static int ubiblock_major ; static int ubiblock_set_param(char const *val , struct kernel_param const *kp ) { int i ; int ret ; size_t len ; struct ubiblock_param *param ; char buf[63U] ; char *pbuf ; char *tokens[2U] ; { pbuf = (char *)(& buf); if ((unsigned long )val == (unsigned long )((char const *)0)) { return (-22); } else { } { len = strnlen(val, 63UL); } if (len == 0UL) { { printk("\fUBI: block: empty \'block=\' parameter - ignored\n"); } return (0); } else { } if (len == 63UL) { { printk("\vUBI: block: parameter \"%s\" is too long, max. is %d\n", val, 63); } return (-22); } else { } { strcpy((char *)(& buf), val); } if ((int )((signed char )buf[len - 1UL]) == 10) { buf[len - 1UL] = 0; } else { } i = 0; goto ldv_35602; ldv_35601: { tokens[i] = strsep(& pbuf, ","); i = i + 1; } ldv_35602: ; if (i <= 1) { goto ldv_35601; } else { } param = (struct ubiblock_param *)(& ubiblock_param) + (unsigned long )ubiblock_devs; if ((unsigned long )tokens[1] != (unsigned long )((char *)0)) { { ret = kstrtoint((char const *)tokens[0], 10U, & param->ubi_num); } if (ret < 0) { return (-22); } else { } { ret = kstrtoint((char const *)tokens[1], 10U, & param->vol_id); } if (ret < 0) { { param->vol_id = -1; strcpy((char *)(& param->name), (char const *)tokens[1]); } } else { } } else { { strcpy((char *)(& param->name), (char const *)tokens[0]); param->ubi_num = -1; param->vol_id = -1; } } ubiblock_devs = ubiblock_devs + 1; return (0); } } static struct ubiblock *find_dev_nolock(int ubi_num , int vol_id ) { struct ubiblock *dev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)ubiblock_devices.next; dev = (struct ubiblock *)__mptr + 0xffffffffffffff30UL; goto ldv_35628; ldv_35627: ; if (dev->ubi_num == ubi_num && dev->vol_id == vol_id) { return (dev); } else { } __mptr___0 = (struct list_head const *)dev->list.next; dev = (struct ubiblock *)__mptr___0 + 0xffffffffffffff30UL; ldv_35628: ; if ((unsigned long )(& dev->list) != (unsigned long )(& ubiblock_devices)) { goto ldv_35627; } else { } return ((struct ubiblock *)0); } } static int ubiblock_read(struct ubiblock_pdu *pdu ) { int ret ; int leb ; int offset ; int bytes_left ; int to_read ; u64 pos ; struct request *req ; struct request *tmp ; struct ubiblock *dev ; unsigned int tmp___0 ; sector_t tmp___1 ; uint32_t __base ; uint32_t __rem ; { { tmp = blk_mq_rq_from_pdu((void *)pdu); req = tmp; dev = (struct ubiblock *)(req->q)->queuedata; tmp___0 = blk_rq_bytes((struct request const *)req); to_read = (int )tmp___0; tmp___1 = blk_rq_pos((struct request const *)req); pos = (u64 )(tmp___1 << 9); __base = (uint32_t )dev->leb_size; __rem = (uint32_t )(pos % (u64 )__base); pos = pos / (u64 )__base; offset = (int )__rem; leb = (int )pos; bytes_left = to_read; } goto ldv_35645; ldv_35644: ; if (offset + to_read > dev->leb_size) { to_read = dev->leb_size - offset; } else { } { ret = ubi_read_sg(dev->desc, leb, & pdu->usgl, offset, to_read); } if (ret < 0) { return (ret); } else { } bytes_left = bytes_left - to_read; to_read = bytes_left; leb = leb + 1; offset = 0; ldv_35645: ; if (bytes_left != 0) { goto ldv_35644; } else { } return (0); } } static int ubiblock_open(struct block_device *bdev , fmode_t mode ) { struct ubiblock *dev ; int ret ; long tmp ; bool tmp___0 ; { { dev = (struct ubiblock *)(bdev->bd_disk)->private_data; ldv_mutex_lock_95___2(& dev->dev_mutex); } if (dev->refcnt > 0) { goto out_done; } else { } if ((mode & 2U) != 0U) { ret = -1; goto out_unlock; } else { } { dev->desc = ubi_open_volume(dev->ubi_num, dev->vol_id, 1); tmp___0 = IS_ERR((void const *)dev->desc); } if ((int )tmp___0) { { dev_err((struct device const *)(& (dev->gd)->part0.__dev), "failed to open ubi volume %d_%d", dev->ubi_num, dev->vol_id); tmp = PTR_ERR((void const *)dev->desc); ret = (int )tmp; dev->desc = (struct ubi_volume_desc *)0; } goto out_unlock; } else { } out_done: { dev->refcnt = dev->refcnt + 1; ldv_mutex_unlock_96___2(& dev->dev_mutex); } return (0); out_unlock: { ldv_mutex_unlock_97(& dev->dev_mutex); } return (ret); } } static void ubiblock_release(struct gendisk *gd , fmode_t mode ) { struct ubiblock *dev ; { { dev = (struct ubiblock *)gd->private_data; ldv_mutex_lock_98___0(& dev->dev_mutex); dev->refcnt = dev->refcnt - 1; } if (dev->refcnt == 0) { { ubi_close_volume(dev->desc); dev->desc = (struct ubi_volume_desc *)0; } } else { } { ldv_mutex_unlock_99___1(& dev->dev_mutex); } return; } } static int ubiblock_getgeo(struct block_device *bdev , struct hd_geometry *geo ) { sector_t tmp ; { { geo->heads = 1U; geo->cylinders = 1U; tmp = get_capacity(bdev->bd_disk); geo->sectors = (unsigned char )tmp; geo->start = 0UL; } return (0); } } static struct block_device_operations const ubiblock_ops = {& ubiblock_open, & ubiblock_release, 0, 0, 0, 0, 0, 0, 0, 0, & ubiblock_getgeo, 0, & __this_module}; static void ubiblock_do_work(struct work_struct *work ) { int ret ; struct ubiblock_pdu *pdu ; struct work_struct const *__mptr ; struct request *req ; struct request *tmp ; { { __mptr = (struct work_struct const *)work; pdu = (struct ubiblock_pdu *)__mptr; tmp = blk_mq_rq_from_pdu((void *)pdu); req = tmp; blk_mq_start_request(req); blk_rq_map_sg(req->q, req, (struct scatterlist *)(& pdu->usgl.sg)); ret = ubiblock_read(pdu); blk_mq_end_request(req, ret); } return; } } static int ubiblock_queue_rq(struct blk_mq_hw_ctx *hctx , struct blk_mq_queue_data const *bd ) { struct request *req ; struct ubiblock *dev ; struct ubiblock_pdu *pdu ; void *tmp ; { { req = bd->rq; dev = (struct ubiblock *)(hctx->queue)->queuedata; tmp = blk_mq_rq_to_pdu(req); pdu = (struct ubiblock_pdu *)tmp; } if ((unsigned int )req->cmd_type != 1U) { return (2); } else { } if ((int )req->cmd_flags & 1) { return (2); } else { } { ubi_sgl_init(& pdu->usgl); queue_work(dev->wq, & pdu->work); } return (0); } } static int ubiblock_init_request(void *data , struct request *req , unsigned int hctx_idx , unsigned int request_idx , unsigned int numa_node___0 ) { struct ubiblock_pdu *pdu ; void *tmp ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; { { tmp = blk_mq_rq_to_pdu(req); pdu = (struct ubiblock_pdu *)tmp; sg_init_table((struct scatterlist *)(& pdu->usgl.sg), 64U); __init_work(& pdu->work, 0); __constr_expr_0.counter = 137438953408L; pdu->work.data = __constr_expr_0; lockdep_init_map(& pdu->work.lockdep_map, "(&pdu->work)", & __key, 0); INIT_LIST_HEAD(& pdu->work.entry); pdu->work.func = & ubiblock_do_work; } return (0); } } static struct blk_mq_ops ubiblock_mq_ops = {& ubiblock_queue_rq, & blk_mq_map_queue, 0, 0, 0, 0, & ubiblock_init_request, 0}; int ubiblock_create(struct ubi_volume_info *vi ) { struct ubiblock *dev ; struct gendisk *gd ; u64 disk_capacity ; int ret ; struct ubiblock *tmp ; void *tmp___0 ; struct lock_class_key __key ; long tmp___1 ; bool tmp___2 ; struct lock_class_key __key___0 ; char const *__lock_name ; struct workqueue_struct *tmp___3 ; { { disk_capacity = (u64 )(vi->used_bytes >> 9); ldv_mutex_lock_100(& devices_mutex); tmp = find_dev_nolock(vi->ubi_num, vi->vol_id); } if ((unsigned long )tmp != (unsigned long )((struct ubiblock *)0)) { { ldv_mutex_unlock_101___0(& devices_mutex); } return (-17); } else { } { ldv_mutex_unlock_102___0(& devices_mutex); tmp___0 = kzalloc(456UL, 208U); dev = (struct ubiblock *)tmp___0; } if ((unsigned long )dev == (unsigned long )((struct ubiblock *)0)) { return (-12); } else { } { __mutex_init(& dev->dev_mutex, "&dev->dev_mutex", & __key); dev->ubi_num = vi->ubi_num; dev->vol_id = vi->vol_id; dev->leb_size = vi->usable_leb_size; gd = ldv_alloc_disk_103(1); } if ((unsigned long )gd == (unsigned long )((struct gendisk *)0)) { { printk("\vUBI: block: alloc_disk failed"); ret = -19; } goto out_free_dev; } else { } { gd->fops = & ubiblock_ops; gd->major = ubiblock_major; gd->first_minor = dev->ubi_num * 128 + dev->vol_id; gd->private_data = (void *)dev; sprintf((char *)(& gd->disk_name), "ubiblock%d_%d", dev->ubi_num, dev->vol_id); set_capacity(gd, (sector_t )disk_capacity); dev->gd = gd; dev->tag_set.ops = & ubiblock_mq_ops; dev->tag_set.queue_depth = 64U; dev->tag_set.numa_node = -1; dev->tag_set.flags = 1U; dev->tag_set.cmd_size = 2648U; dev->tag_set.driver_data = (void *)dev; dev->tag_set.nr_hw_queues = 1U; ret = blk_mq_alloc_tag_set(& dev->tag_set); } if (ret != 0) { { dev_err((struct device const *)(& (dev->gd)->part0.__dev), "blk_mq_alloc_tag_set failed"); } goto out_put_disk; } else { } { dev->rq = blk_mq_init_queue(& dev->tag_set); tmp___2 = IS_ERR((void const *)dev->rq); } if ((int )tmp___2) { { dev_err((struct device const *)(& gd->part0.__dev), "blk_mq_init_queue failed"); tmp___1 = PTR_ERR((void const *)dev->rq); ret = (int )tmp___1; } goto out_free_tags; } else { } { blk_queue_max_segments(dev->rq, 64); (dev->rq)->queuedata = (void *)dev; (dev->gd)->queue = dev->rq; __lock_name = "\"%s\"gd->disk_name"; tmp___3 = __alloc_workqueue_key("%s", 0U, 0, & __key___0, __lock_name, (char *)(& gd->disk_name)); dev->wq = tmp___3; } if ((unsigned long )dev->wq == (unsigned long )((struct workqueue_struct *)0)) { ret = -12; goto out_free_queue; } else { } { ldv_mutex_lock_104(& devices_mutex); list_add_tail(& dev->list, & ubiblock_devices); ldv_mutex_unlock_105(& devices_mutex); ldv_add_disk_106(dev->gd); _dev_info((struct device const *)(& (dev->gd)->part0.__dev), "created from ubi%d:%d(%s)", dev->ubi_num, dev->vol_id, vi->name); } return (0); out_free_queue: { ldv_blk_cleanup_queue_107(dev->rq); } out_free_tags: { blk_mq_free_tag_set(& dev->tag_set); } out_put_disk: { ldv_put_disk_108(dev->gd); } out_free_dev: { kfree((void const *)dev); } return (ret); } } static void ubiblock_cleanup(struct ubiblock *dev ) { { { ldv_del_gendisk_109(dev->gd); destroy_workqueue(dev->wq); ldv_blk_cleanup_queue_110(dev->rq); blk_mq_free_tag_set(& dev->tag_set); _dev_info((struct device const *)(& (dev->gd)->part0.__dev), "released"); ldv_put_disk_111(dev->gd); } return; } } int ubiblock_remove(struct ubi_volume_info *vi ) { struct ubiblock *dev ; { { ldv_mutex_lock_112(& devices_mutex); dev = find_dev_nolock(vi->ubi_num, vi->vol_id); } if ((unsigned long )dev == (unsigned long )((struct ubiblock *)0)) { { ldv_mutex_unlock_113(& devices_mutex); } return (-19); } else { } { ldv_mutex_lock_114(& dev->dev_mutex); } if (dev->refcnt > 0) { { ldv_mutex_unlock_115(& dev->dev_mutex); ldv_mutex_unlock_116___1(& devices_mutex); } return (-16); } else { } { list_del(& dev->list); ldv_mutex_unlock_117(& devices_mutex); ubiblock_cleanup(dev); ldv_mutex_unlock_118___0(& dev->dev_mutex); kfree((void const *)dev); } return (0); } } static int ubiblock_resize(struct ubi_volume_info *vi ) { struct ubiblock *dev ; u64 disk_capacity ; sector_t tmp ; { { disk_capacity = (u64 )(vi->used_bytes >> 9); ldv_mutex_lock_119(& devices_mutex); dev = find_dev_nolock(vi->ubi_num, vi->vol_id); } if ((unsigned long )dev == (unsigned long )((struct ubiblock *)0)) { { ldv_mutex_unlock_120(& devices_mutex); } return (-19); } else { } { ldv_mutex_lock_122___0(& dev->dev_mutex); tmp = get_capacity(dev->gd); } if ((unsigned long long )tmp != disk_capacity) { { set_capacity(dev->gd, (sector_t )disk_capacity); _dev_info((struct device const *)(& (dev->gd)->part0.__dev), "resized to %lld bytes", vi->used_bytes); } } else { } { ldv_mutex_unlock_123___0(& dev->dev_mutex); ldv_mutex_unlock_124___0(& devices_mutex); } return (0); } } static int ubiblock_notify(struct notifier_block *nb , unsigned long notification_type , void *ns_ptr ) { struct ubi_notification *nt ; { nt = (struct ubi_notification *)ns_ptr; { if (notification_type == 0UL) { goto case_0; } else { } if (notification_type == 1UL) { goto case_1; } else { } if (notification_type == 2UL) { goto case_2; } else { } if (notification_type == 4UL) { goto case_4; } else { } goto switch_default; case_0: /* CIL Label */ ; goto ldv_35725; case_1: /* CIL Label */ { ubiblock_remove(& nt->vi); } goto ldv_35725; case_2: /* CIL Label */ { ubiblock_resize(& nt->vi); } goto ldv_35725; case_4: /* CIL Label */ ; if (nt->vi.vol_type == 4) { { ubiblock_resize(& nt->vi); } } else { } goto ldv_35725; switch_default: /* CIL Label */ ; goto ldv_35725; switch_break: /* CIL Label */ ; } ldv_35725: ; return (1); } } static struct notifier_block ubiblock_notifier = {& ubiblock_notify, 0, 0}; static struct ubi_volume_desc *open_volume_desc(char const *name , int ubi_num , int vol_id ) { struct ubi_volume_desc *tmp ; struct ubi_volume_desc *tmp___0 ; struct ubi_volume_desc *tmp___1 ; { if (ubi_num == -1) { { tmp = ubi_open_volume_path(name, 1); } return (tmp); } else if (vol_id == -1) { { tmp___0 = ubi_open_volume_nm(ubi_num, name, 1); } return (tmp___0); } else { { tmp___1 = ubi_open_volume(ubi_num, vol_id, 1); } return (tmp___1); } } } static void ubiblock_create_from_param(void) { int i ; int ret ; struct ubiblock_param *p ; struct ubi_volume_desc *desc ; struct ubi_volume_info vi ; long tmp ; bool tmp___0 ; { ret = 0; i = 0; goto ldv_35746; ldv_35745: { p = (struct ubiblock_param *)(& ubiblock_param) + (unsigned long )i; desc = open_volume_desc((char const *)(& p->name), p->ubi_num, p->vol_id); tmp___0 = IS_ERR((void const *)desc); } if ((int )tmp___0) { { tmp = PTR_ERR((void const *)desc); printk("\vUBI: block: can\'t open volume on ubi%d_%d, err=%ld", p->ubi_num, p->vol_id, tmp); } goto ldv_35744; } else { } { ubi_get_volume_info(desc, & vi); ubi_close_volume(desc); ret = ubiblock_create(& vi); } if (ret != 0) { { printk("\vUBI: block: can\'t add \'%s\' volume on ubi%d_%d, err=%d", vi.name, p->ubi_num, p->vol_id, ret); } goto ldv_35744; } else { } ldv_35744: i = i + 1; ldv_35746: ; if (i < ubiblock_devs) { goto ldv_35745; } else { } return; } } static void ubiblock_remove_all(void) { struct ubiblock *next ; struct ubiblock *dev ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int __ret_warn_on ; long tmp ; struct list_head const *__mptr___1 ; { __mptr = (struct list_head const *)ubiblock_devices.next; dev = (struct ubiblock *)__mptr + 0xffffffffffffff30UL; __mptr___0 = (struct list_head const *)dev->list.next; next = (struct ubiblock *)__mptr___0 + 0xffffffffffffff30UL; goto ldv_35762; ldv_35761: { __ret_warn_on = (unsigned long )dev->desc != (unsigned long )((struct ubi_volume_desc *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); } if (tmp != 0L) { { warn_slowpath_null("drivers/mtd/ubi/block.c", 624); } } else { } { ldv__builtin_expect(__ret_warn_on != 0, 0L); list_del(& dev->list); ubiblock_cleanup(dev); kfree((void const *)dev); dev = next; __mptr___1 = (struct list_head const *)next->list.next; next = (struct ubiblock *)__mptr___1 + 0xffffffffffffff30UL; } ldv_35762: ; if ((unsigned long )(& dev->list) != (unsigned long )(& ubiblock_devices)) { goto ldv_35761; } else { } return; } } int ubiblock_init(void) { int ret ; { { ubiblock_major = register_blkdev(0U, "ubiblock"); } if (ubiblock_major < 0) { return (ubiblock_major); } else { } { ubiblock_create_from_param(); ret = ubi_register_volume_notifier(& ubiblock_notifier, 1); } if (ret != 0) { goto err_unreg; } else { } return (0); err_unreg: { unregister_blkdev((unsigned int )ubiblock_major, "ubiblock"); ubiblock_remove_all(); } return (ret); } } void ubiblock_exit(void) { { { ubi_unregister_volume_notifier(& ubiblock_notifier); ubiblock_remove_all(); unregister_blkdev((unsigned int )ubiblock_major, "ubiblock"); } return; } } void ldv_dispatch_deregister_13_1(struct notifier_block *arg0 ) ; void ldv_dispatch_register_14_2(struct notifier_block *arg0 ) ; void ldv_dummy_resourceless_instance_callback_8_3(int (*arg0)(struct notifier_block * , unsigned long , void * ) , struct notifier_block *arg1 , unsigned long arg2 , void *arg3 ) ; void ldv_struct_optimistic_spin_queue_dummy_resourceless_instance_8(void *arg0 ) ; struct ldv_thread ldv_thread_8 ; int ldv_blocking_notifier_chain_register(int arg0 , struct blocking_notifier_head *arg1 , struct notifier_block *arg2 ) { struct notifier_block *ldv_14_struct_notifier_block_struct_notifier_block ; int tmp ; { { tmp = ldv_undef_int(); } if (tmp != 0) { { ldv_assume(arg0 == 0); ldv_14_struct_notifier_block_struct_notifier_block = arg2; ldv_dispatch_register_14_2(ldv_14_struct_notifier_block_struct_notifier_block); } return (arg0); } else { { ldv_assume(arg0 != 0); } return (arg0); } return (arg0); } } int ldv_blocking_notifier_chain_unregister(int arg0 , struct blocking_notifier_head *arg1 , struct notifier_block *arg2 ) { struct notifier_block *ldv_13_struct_notifier_block_struct_notifier_block ; { { ldv_13_struct_notifier_block_struct_notifier_block = arg2; ldv_dispatch_deregister_13_1(ldv_13_struct_notifier_block_struct_notifier_block); } return (arg0); return (arg0); } } void ldv_dispatch_deregister_13_1(struct notifier_block *arg0 ) { { return; } } void ldv_dispatch_register_14_2(struct notifier_block *arg0 ) { struct ldv_struct_dummy_resourceless_instance_8 *cf_arg_8 ; void *tmp ; { { tmp = ldv_xmalloc(16UL); cf_arg_8 = (struct ldv_struct_dummy_resourceless_instance_8 *)tmp; cf_arg_8->arg0 = arg0; ldv_struct_optimistic_spin_queue_dummy_resourceless_instance_8((void *)cf_arg_8); } return; } } void ldv_dummy_resourceless_instance_callback_7_3(int (*arg0)(char * , struct kernel_param * ) , char *arg1 , struct kernel_param *arg2 ) { { { ubiblock_set_param((char const *)arg1, (struct kernel_param const *)arg2); } return; } } void ldv_dummy_resourceless_instance_callback_8_3(int (*arg0)(struct notifier_block * , unsigned long , void * ) , struct notifier_block *arg1 , unsigned long arg2 , void *arg3 ) { { { ubiblock_notify(arg1, arg2, arg3); } return; } } void ldv_file_operations_instance_callback_0_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) { { { ubiblock_getgeo(arg1, arg2); } return; } } void ldv_file_operations_instance_callback_1_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) { { { ubiblock_getgeo(arg1, arg2); } return; } } void ldv_file_operations_instance_callback_2_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) { { { ubiblock_getgeo(arg1, arg2); } return; } } void ldv_file_operations_instance_callback_3_25(int (*arg0)(struct block_device * , struct hd_geometry * ) , struct block_device *arg1 , struct hd_geometry *arg2 ) { { { ubiblock_getgeo(arg1, arg2); } return; } } void ldv_struct_optimistic_spin_queue_dummy_resourceless_instance_8(void *arg0 ) { int (*ldv_8_callback_notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *ldv_8_container_struct_notifier_block ; unsigned long ldv_8_ldv_param_3_1_default ; void *ldv_8_ldv_param_3_2_default ; struct ldv_struct_dummy_resourceless_instance_8 *data ; int tmp ; { data = (struct ldv_struct_dummy_resourceless_instance_8 *)arg0; if ((unsigned long )data != (unsigned long )((struct ldv_struct_dummy_resourceless_instance_8 *)0)) { { ldv_8_container_struct_notifier_block = data->arg0; ldv_free((void *)data); } } else { } goto ldv_call_8; return; ldv_call_8: { tmp = ldv_undef_int(); } if (tmp != 0) { { ldv_8_ldv_param_3_2_default = ldv_xmalloc(1UL); ldv_dummy_resourceless_instance_callback_8_3(ldv_8_callback_notifier_call, ldv_8_container_struct_notifier_block, ldv_8_ldv_param_3_1_default, ldv_8_ldv_param_3_2_default); ldv_free(ldv_8_ldv_param_3_2_default); } goto ldv_call_8; } else { return; } return; } } static void ldv_mutex_lock_95___2(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_96___2(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_97(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_lock_98___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_99___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_lock_100(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_101___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_102___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } static struct gendisk *ldv_alloc_disk_103(int minors ) { ldv_func_ret_type___4 ldv_func_res ; struct gendisk *tmp ; struct gendisk *tmp___0 ; { { tmp = alloc_disk(minors); ldv_func_res = tmp; tmp___0 = ldv_linux_block_genhd_alloc_disk(); } return (tmp___0); return (ldv_func_res); } } static void ldv_mutex_lock_104(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_105(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_add_disk_106(struct gendisk *disk ) { { { ldv_linux_block_genhd_add_disk(); add_disk(disk); } return; } } static void ldv_blk_cleanup_queue_107(struct request_queue *ldv_func_arg1 ) { { { ldv_linux_block_queue_blk_cleanup_queue(); blk_cleanup_queue(ldv_func_arg1); } return; } } static void ldv_put_disk_108(struct gendisk *disk ) { { { ldv_linux_block_genhd_put_disk(disk); put_disk(disk); } return; } } static void ldv_del_gendisk_109(struct gendisk *gp ) { { { ldv_linux_block_genhd_del_gendisk(); del_gendisk(gp); } return; } } static void ldv_blk_cleanup_queue_110(struct request_queue *ldv_func_arg1 ) { { { ldv_linux_block_queue_blk_cleanup_queue(); blk_cleanup_queue(ldv_func_arg1); } return; } } static void ldv_put_disk_111(struct gendisk *disk ) { { { ldv_linux_block_genhd_put_disk(disk); put_disk(disk); } return; } } static void ldv_mutex_lock_112(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_113(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_lock_114(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_115(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_116___1(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_117(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_118___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_lock_119(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_120(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } static void ldv_mutex_lock_122___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_lock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_123___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(ldv_func_arg1); } return; } } static void ldv_mutex_unlock_124___0(struct mutex *ldv_func_arg1 ) { { { ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(ldv_func_arg1); } return; } } void ldv_assert_linux_alloc_irq__nonatomic(int expr ) ; void ldv_assert_linux_alloc_irq__wrong_flags(int expr ) ; bool ldv_in_interrupt_context(void) ; void ldv_linux_alloc_irq_check_alloc_flags(gfp_t flags ) { bool tmp ; int tmp___0 ; { { tmp = ldv_in_interrupt_context(); } if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } { ldv_assert_linux_alloc_irq__wrong_flags(tmp___0 || flags == 32U); } return; } } void ldv_linux_alloc_irq_check_alloc_nonatomic(void) { bool tmp ; { { tmp = ldv_in_interrupt_context(); } if ((int )tmp) { { ldv_assert_linux_alloc_irq__nonatomic(0); } } else { } return; } } void ldv_assert_linux_alloc_spinlock__nonatomic(int expr ) ; void ldv_assert_linux_alloc_spinlock__wrong_flags(int expr ) ; int ldv_exclusive_spin_is_locked(void) ; void ldv_linux_alloc_spinlock_check_alloc_flags(gfp_t flags ) { int tmp ; { if (flags != 32U && flags != 0U) { { tmp = ldv_exclusive_spin_is_locked(); ldv_assert_linux_alloc_spinlock__wrong_flags(tmp == 0); } } else { } return; } } void ldv_linux_alloc_spinlock_check_alloc_nonatomic(void) { int tmp ; { { tmp = ldv_exclusive_spin_is_locked(); ldv_assert_linux_alloc_spinlock__nonatomic(tmp == 0); } return; } } void ldv_assert_linux_alloc_usb_lock__nonatomic(int expr ) ; void ldv_assert_linux_alloc_usb_lock__wrong_flags(int expr ) ; int ldv_linux_alloc_usb_lock_lock = 1; void ldv_linux_alloc_usb_lock_check_alloc_flags(gfp_t flags ) { { if (ldv_linux_alloc_usb_lock_lock == 2) { { ldv_assert_linux_alloc_usb_lock__wrong_flags(flags == 16U || flags == 32U); } } else { } return; } } void ldv_linux_alloc_usb_lock_check_alloc_nonatomic(void) { { { ldv_assert_linux_alloc_usb_lock__nonatomic(ldv_linux_alloc_usb_lock_lock == 1); } return; } } void ldv_linux_alloc_usb_lock_usb_lock_device(void) { { ldv_linux_alloc_usb_lock_lock = 2; return; } } int ldv_linux_alloc_usb_lock_usb_trylock_device(void) { int tmp ; { if (ldv_linux_alloc_usb_lock_lock == 1) { { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_linux_alloc_usb_lock_lock = 2; return (1); } else { return (0); } } else { return (0); } } } int ldv_linux_alloc_usb_lock_usb_lock_device_for_reset(void) { int tmp ; { if (ldv_linux_alloc_usb_lock_lock == 1) { { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_linux_alloc_usb_lock_lock = 2; return (0); } else { return (-1); } } else { return (-1); } } } void ldv_linux_alloc_usb_lock_usb_unlock_device(void) { { ldv_linux_alloc_usb_lock_lock = 1; return; } } void ldv_linux_usb_dev_atomic_add(int i , atomic_t *v ) { { v->counter = v->counter + i; return; } } void ldv_linux_usb_dev_atomic_sub(int i , atomic_t *v ) { { v->counter = v->counter - i; return; } } int ldv_linux_usb_dev_atomic_sub_and_test(int i , atomic_t *v ) { { v->counter = v->counter - i; if (v->counter != 0) { return (0); } else { } return (1); } } void ldv_linux_usb_dev_atomic_inc(atomic_t *v ) { { v->counter = v->counter + 1; return; } } void ldv_linux_usb_dev_atomic_dec(atomic_t *v ) { { v->counter = v->counter - 1; return; } } int ldv_linux_usb_dev_atomic_dec_and_test(atomic_t *v ) { { v->counter = v->counter - 1; if (v->counter != 0) { return (0); } else { } return (1); } } int ldv_linux_usb_dev_atomic_inc_and_test(atomic_t *v ) { { v->counter = v->counter + 1; if (v->counter != 0) { return (0); } else { } return (1); } } int ldv_linux_usb_dev_atomic_add_return(int i , atomic_t *v ) { { v->counter = v->counter + i; return (v->counter); } } int ldv_linux_usb_dev_atomic_add_negative(int i , atomic_t *v ) { { v->counter = v->counter + i; return (v->counter < 0); } } int ldv_linux_usb_dev_atomic_inc_short(short *v ) { { *v = (short )((unsigned int )((unsigned short )*v) + 1U); return ((int )*v); } } void ldv_assert_linux_arch_io__less_initial_decrement(int expr ) ; void ldv_assert_linux_arch_io__more_initial_at_exit(int expr ) ; void *ldv_undef_ptr(void) ; int ldv_linux_arch_io_iomem = 0; void *ldv_linux_arch_io_io_mem_remap(void) { void *ptr ; void *tmp ; { { tmp = ldv_undef_ptr(); ptr = tmp; } if ((unsigned long )ptr != (unsigned long )((void *)0)) { ldv_linux_arch_io_iomem = ldv_linux_arch_io_iomem + 1; return (ptr); } else { } return (ptr); } } void ldv_linux_arch_io_io_mem_unmap(void) { { { ldv_assert_linux_arch_io__less_initial_decrement(ldv_linux_arch_io_iomem > 0); ldv_linux_arch_io_iomem = ldv_linux_arch_io_iomem - 1; } return; } } void ldv_linux_arch_io_check_final_state(void) { { { ldv_assert_linux_arch_io__more_initial_at_exit(ldv_linux_arch_io_iomem == 0); } return; } } void ldv_assert_linux_block_genhd__delete_before_add(int expr ) ; void ldv_assert_linux_block_genhd__double_allocation(int expr ) ; void ldv_assert_linux_block_genhd__free_before_allocation(int expr ) ; void ldv_assert_linux_block_genhd__more_initial_at_exit(int expr ) ; void ldv_assert_linux_block_genhd__use_before_allocation(int expr ) ; static int ldv_linux_block_genhd_disk_state = 0; struct gendisk *ldv_linux_block_genhd_alloc_disk(void) { struct gendisk *res ; void *tmp ; { { tmp = ldv_undef_ptr(); res = (struct gendisk *)tmp; ldv_assert_linux_block_genhd__double_allocation(ldv_linux_block_genhd_disk_state == 0); } if ((unsigned long )res != (unsigned long )((struct gendisk *)0)) { ldv_linux_block_genhd_disk_state = 1; return (res); } else { } return (res); } } void ldv_linux_block_genhd_add_disk(void) { { { ldv_assert_linux_block_genhd__use_before_allocation(ldv_linux_block_genhd_disk_state == 1); ldv_linux_block_genhd_disk_state = 2; } return; } } void ldv_linux_block_genhd_del_gendisk(void) { { { ldv_assert_linux_block_genhd__delete_before_add(ldv_linux_block_genhd_disk_state == 2); ldv_linux_block_genhd_disk_state = 1; } return; } } void ldv_linux_block_genhd_put_disk(struct gendisk *disk ) { { if ((unsigned long )disk != (unsigned long )((struct gendisk *)0)) { { ldv_assert_linux_block_genhd__free_before_allocation(ldv_linux_block_genhd_disk_state > 0); ldv_linux_block_genhd_disk_state = 0; } } else { } return; } } void ldv_linux_block_genhd_check_final_state(void) { { { ldv_assert_linux_block_genhd__more_initial_at_exit(ldv_linux_block_genhd_disk_state == 0); } return; } } void ldv_assert_linux_block_queue__double_allocation(int expr ) ; void ldv_assert_linux_block_queue__more_initial_at_exit(int expr ) ; void ldv_assert_linux_block_queue__use_before_allocation(int expr ) ; static int ldv_linux_block_queue_queue_state = 0; struct request_queue *ldv_linux_block_queue_request_queue(void) { struct request_queue *res ; void *tmp ; { { tmp = ldv_undef_ptr(); res = (struct request_queue *)tmp; ldv_assert_linux_block_queue__double_allocation(ldv_linux_block_queue_queue_state == 0); } if ((unsigned long )res != (unsigned long )((struct request_queue *)0)) { ldv_linux_block_queue_queue_state = 1; return (res); } else { } return (res); } } void ldv_linux_block_queue_blk_cleanup_queue(void) { { { ldv_assert_linux_block_queue__use_before_allocation(ldv_linux_block_queue_queue_state == 1); ldv_linux_block_queue_queue_state = 0; } return; } } void ldv_linux_block_queue_check_final_state(void) { { { ldv_assert_linux_block_queue__more_initial_at_exit(ldv_linux_block_queue_queue_state == 0); } return; } } void ldv_assert_linux_block_request__double_get(int expr ) ; void ldv_assert_linux_block_request__double_put(int expr ) ; void ldv_assert_linux_block_request__get_at_exit(int expr ) ; long ldv_is_err(void const *ptr ) ; int ldv_linux_block_request_blk_rq = 0; struct request *ldv_linux_block_request_blk_get_request(gfp_t mask ) { struct request *res ; void *tmp ; { { ldv_assert_linux_block_request__double_get(ldv_linux_block_request_blk_rq == 0); tmp = ldv_undef_ptr(); res = (struct request *)tmp; } if ((mask == 16U || mask == 208U) || mask == 16U) { { ldv_assume((unsigned long )res != (unsigned long )((struct request *)0)); } } else { } if ((unsigned long )res != (unsigned long )((struct request *)0)) { ldv_linux_block_request_blk_rq = 1; } else { } return (res); } } struct request *ldv_linux_block_request_blk_make_request(gfp_t mask ) { struct request *res ; void *tmp ; long tmp___0 ; { { ldv_assert_linux_block_request__double_get(ldv_linux_block_request_blk_rq == 0); tmp = ldv_undef_ptr(); res = (struct request *)tmp; ldv_assume((unsigned long )res != (unsigned long )((struct request *)0)); tmp___0 = ldv_is_err((void const *)res); } if (tmp___0 == 0L) { ldv_linux_block_request_blk_rq = 1; } else { } return (res); } } void ldv_linux_block_request_put_blk_rq(void) { { { ldv_assert_linux_block_request__double_put(ldv_linux_block_request_blk_rq == 1); ldv_linux_block_request_blk_rq = 0; } return; } } void ldv_linux_block_request_check_final_state(void) { { { ldv_assert_linux_block_request__get_at_exit(ldv_linux_block_request_blk_rq == 0); } return; } } void ldv_assert_linux_drivers_base_class__double_deregistration(int expr ) ; void ldv_assert_linux_drivers_base_class__double_registration(int expr ) ; void ldv_assert_linux_drivers_base_class__registered_at_exit(int expr ) ; int ldv_undef_int_nonpositive(void) ; int ldv_linux_drivers_base_class_usb_gadget_class = 0; void *ldv_linux_drivers_base_class_create_class(void) { void *is_got ; long tmp ; { { is_got = ldv_undef_ptr(); ldv_assume((int )((long )is_got)); tmp = ldv_is_err((void const *)is_got); } if (tmp == 0L) { { ldv_assert_linux_drivers_base_class__double_registration(ldv_linux_drivers_base_class_usb_gadget_class == 0); ldv_linux_drivers_base_class_usb_gadget_class = 1; } } else { } return (is_got); } } int ldv_linux_drivers_base_class_register_class(void) { int is_reg ; { { is_reg = ldv_undef_int_nonpositive(); } if (is_reg == 0) { { ldv_assert_linux_drivers_base_class__double_registration(ldv_linux_drivers_base_class_usb_gadget_class == 0); ldv_linux_drivers_base_class_usb_gadget_class = 1; } } else { } return (is_reg); } } void ldv_linux_drivers_base_class_unregister_class(void) { { { ldv_assert_linux_drivers_base_class__double_deregistration(ldv_linux_drivers_base_class_usb_gadget_class == 1); ldv_linux_drivers_base_class_usb_gadget_class = 0; } return; } } void ldv_linux_drivers_base_class_destroy_class(struct class *cls ) { long tmp ; { if ((unsigned long )cls == (unsigned long )((struct class *)0)) { return; } else { { tmp = ldv_is_err((void const *)cls); } if (tmp != 0L) { return; } else { } } { ldv_linux_drivers_base_class_unregister_class(); } return; } } void ldv_linux_drivers_base_class_check_final_state(void) { { { ldv_assert_linux_drivers_base_class__registered_at_exit(ldv_linux_drivers_base_class_usb_gadget_class == 0); } return; } } void *ldv_xzalloc(size_t size ) ; void *ldv_dev_get_drvdata(struct device const *dev ) { { if ((unsigned long )dev != (unsigned long )((struct device const *)0) && (unsigned long )dev->p != (unsigned long )((struct device_private */* const */)0)) { return ((dev->p)->driver_data); } else { } return ((void *)0); } } int ldv_dev_set_drvdata(struct device *dev , void *data ) { void *tmp ; { { tmp = ldv_xzalloc(8UL); dev->p = (struct device_private *)tmp; (dev->p)->driver_data = data; } return (0); } } void *ldv_zalloc(size_t size ) ; struct spi_master *ldv_spi_alloc_master(struct device *host , unsigned int size ) { struct spi_master *master ; void *tmp ; { { tmp = ldv_zalloc((unsigned long )size + 2176UL); master = (struct spi_master *)tmp; } if ((unsigned long )master == (unsigned long )((struct spi_master *)0)) { return ((struct spi_master *)0); } else { } { ldv_dev_set_drvdata(& master->dev, (void *)master + 1U); } return (master); } } long ldv_is_err(void const *ptr ) { { return ((unsigned long )ptr > 4294967295UL); } } void *ldv_err_ptr(long error ) { { return ((void *)(4294967295L - error)); } } long ldv_ptr_err(void const *ptr ) { { return ((long )(4294967295UL - (unsigned long )ptr)); } } long ldv_is_err_or_null(void const *ptr ) { long tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { { tmp = ldv_is_err(ptr); } if (tmp != 0L) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((long )tmp___0); } } void ldv_assert_linux_fs_char_dev__double_deregistration(int expr ) ; void ldv_assert_linux_fs_char_dev__double_registration(int expr ) ; void ldv_assert_linux_fs_char_dev__registered_at_exit(int expr ) ; int ldv_linux_fs_char_dev_usb_gadget_chrdev = 0; int ldv_linux_fs_char_dev_register_chrdev(int major ) { int is_reg ; { { is_reg = ldv_undef_int_nonpositive(); } if (is_reg == 0) { { ldv_assert_linux_fs_char_dev__double_registration(ldv_linux_fs_char_dev_usb_gadget_chrdev == 0); ldv_linux_fs_char_dev_usb_gadget_chrdev = 1; } if (major == 0) { { is_reg = ldv_undef_int(); ldv_assume(is_reg > 0); } } else { } } else { } return (is_reg); } } int ldv_linux_fs_char_dev_register_chrdev_region(void) { int is_reg ; { { is_reg = ldv_undef_int_nonpositive(); } if (is_reg == 0) { { ldv_assert_linux_fs_char_dev__double_registration(ldv_linux_fs_char_dev_usb_gadget_chrdev == 0); ldv_linux_fs_char_dev_usb_gadget_chrdev = 1; } } else { } return (is_reg); } } void ldv_linux_fs_char_dev_unregister_chrdev_region(void) { { { ldv_assert_linux_fs_char_dev__double_deregistration(ldv_linux_fs_char_dev_usb_gadget_chrdev == 1); ldv_linux_fs_char_dev_usb_gadget_chrdev = 0; } return; } } void ldv_linux_fs_char_dev_check_final_state(void) { { { ldv_assert_linux_fs_char_dev__registered_at_exit(ldv_linux_fs_char_dev_usb_gadget_chrdev == 0); } return; } } void ldv_assert_linux_fs_sysfs__less_initial_decrement(int expr ) ; void ldv_assert_linux_fs_sysfs__more_initial_at_exit(int expr ) ; int ldv_linux_fs_sysfs_sysfs = 0; int ldv_linux_fs_sysfs_sysfs_create_group(void) { int res ; int tmp ; { { tmp = ldv_undef_int_nonpositive(); res = tmp; } if (res == 0) { ldv_linux_fs_sysfs_sysfs = ldv_linux_fs_sysfs_sysfs + 1; return (0); } else { } return (res); } } void ldv_linux_fs_sysfs_sysfs_remove_group(void) { { { ldv_assert_linux_fs_sysfs__less_initial_decrement(ldv_linux_fs_sysfs_sysfs > 0); ldv_linux_fs_sysfs_sysfs = ldv_linux_fs_sysfs_sysfs - 1; } return; } } void ldv_linux_fs_sysfs_check_final_state(void) { { { ldv_assert_linux_fs_sysfs__more_initial_at_exit(ldv_linux_fs_sysfs_sysfs == 0); } return; } } void ldv_assert_linux_kernel_locking_rwlock__double_write_lock(int expr ) ; void ldv_assert_linux_kernel_locking_rwlock__double_write_unlock(int expr ) ; void ldv_assert_linux_kernel_locking_rwlock__more_read_unlocks(int expr ) ; void ldv_assert_linux_kernel_locking_rwlock__read_lock_at_exit(int expr ) ; void ldv_assert_linux_kernel_locking_rwlock__read_lock_on_write_lock(int expr ) ; void ldv_assert_linux_kernel_locking_rwlock__write_lock_at_exit(int expr ) ; int ldv_linux_kernel_locking_rwlock_rlock = 1; int ldv_linux_kernel_locking_rwlock_wlock = 1; void ldv_linux_kernel_locking_rwlock_read_lock(void) { { { ldv_assert_linux_kernel_locking_rwlock__read_lock_on_write_lock(ldv_linux_kernel_locking_rwlock_wlock == 1); ldv_linux_kernel_locking_rwlock_rlock = ldv_linux_kernel_locking_rwlock_rlock + 1; } return; } } void ldv_linux_kernel_locking_rwlock_read_unlock(void) { { { ldv_assert_linux_kernel_locking_rwlock__more_read_unlocks(ldv_linux_kernel_locking_rwlock_rlock > 1); ldv_linux_kernel_locking_rwlock_rlock = ldv_linux_kernel_locking_rwlock_rlock + -1; } return; } } void ldv_linux_kernel_locking_rwlock_write_lock(void) { { { ldv_assert_linux_kernel_locking_rwlock__double_write_lock(ldv_linux_kernel_locking_rwlock_wlock == 1); ldv_linux_kernel_locking_rwlock_wlock = 2; } return; } } void ldv_linux_kernel_locking_rwlock_write_unlock(void) { { { ldv_assert_linux_kernel_locking_rwlock__double_write_unlock(ldv_linux_kernel_locking_rwlock_wlock != 1); ldv_linux_kernel_locking_rwlock_wlock = 1; } return; } } int ldv_linux_kernel_locking_rwlock_read_trylock(void) { int tmp ; { if (ldv_linux_kernel_locking_rwlock_wlock == 1) { { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_linux_kernel_locking_rwlock_rlock = ldv_linux_kernel_locking_rwlock_rlock + 1; return (1); } else { return (0); } } else { return (0); } } } int ldv_linux_kernel_locking_rwlock_write_trylock(void) { int tmp ; { if (ldv_linux_kernel_locking_rwlock_wlock == 1) { { tmp = ldv_undef_int(); } if (tmp != 0) { ldv_linux_kernel_locking_rwlock_wlock = 2; return (1); } else { return (0); } } else { return (0); } } } void ldv_linux_kernel_locking_rwlock_check_final_state(void) { { { ldv_assert_linux_kernel_locking_rwlock__read_lock_at_exit(ldv_linux_kernel_locking_rwlock_rlock == 1); ldv_assert_linux_kernel_locking_rwlock__write_lock_at_exit(ldv_linux_kernel_locking_rwlock_wlock == 1); } return; } } void ldv_assert_linux_kernel_module__less_initial_decrement(int expr ) ; void ldv_assert_linux_kernel_module__more_initial_at_exit(int expr ) ; int ldv_linux_kernel_module_module_refcounter = 1; void ldv_linux_kernel_module_module_get(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { ldv_linux_kernel_module_module_refcounter = ldv_linux_kernel_module_module_refcounter + 1; } else { } return; } } int ldv_linux_kernel_module_try_module_get(struct module *module ) { int tmp ; { if ((unsigned long )module != (unsigned long )((struct module *)0)) { { tmp = ldv_undef_int(); } if (tmp == 1) { ldv_linux_kernel_module_module_refcounter = ldv_linux_kernel_module_module_refcounter + 1; return (1); } else { return (0); } } else { } return (0); } } void ldv_linux_kernel_module_module_put(struct module *module ) { { if ((unsigned long )module != (unsigned long )((struct module *)0)) { { ldv_assert_linux_kernel_module__less_initial_decrement(ldv_linux_kernel_module_module_refcounter > 1); ldv_linux_kernel_module_module_refcounter = ldv_linux_kernel_module_module_refcounter - 1; } } else { } return; } } void ldv_linux_kernel_module_module_put_and_exit(void) { { { ldv_linux_kernel_module_module_put((struct module *)1); } LDV_LINUX_KERNEL_MODULE_STOP: ; goto LDV_LINUX_KERNEL_MODULE_STOP; } } unsigned int ldv_linux_kernel_module_module_refcount(void) { { return ((unsigned int )(ldv_linux_kernel_module_module_refcounter + -1)); } } void ldv_linux_kernel_module_check_final_state(void) { { { ldv_assert_linux_kernel_module__more_initial_at_exit(ldv_linux_kernel_module_module_refcounter == 1); } return; } } void ldv_assert_linux_kernel_rcu_srcu__locked_at_exit(int expr ) ; void ldv_assert_linux_kernel_rcu_srcu__locked_at_read_section(int expr ) ; void ldv_assert_linux_kernel_rcu_srcu__more_unlocks(int expr ) ; int ldv_linux_kernel_rcu_srcu_srcu_nested = 0; void ldv_linux_kernel_rcu_srcu_srcu_read_lock(void) { { ldv_linux_kernel_rcu_srcu_srcu_nested = ldv_linux_kernel_rcu_srcu_srcu_nested + 1; return; } } void ldv_linux_kernel_rcu_srcu_srcu_read_unlock(void) { { { ldv_assert_linux_kernel_rcu_srcu__more_unlocks(ldv_linux_kernel_rcu_srcu_srcu_nested > 0); ldv_linux_kernel_rcu_srcu_srcu_nested = ldv_linux_kernel_rcu_srcu_srcu_nested - 1; } return; } } void ldv_linux_kernel_rcu_srcu_check_for_read_section(void) { { { ldv_assert_linux_kernel_rcu_srcu__locked_at_read_section(ldv_linux_kernel_rcu_srcu_srcu_nested == 0); } return; } } void ldv_linux_kernel_rcu_srcu_check_final_state(void) { { { ldv_assert_linux_kernel_rcu_srcu__locked_at_exit(ldv_linux_kernel_rcu_srcu_srcu_nested == 0); } return; } } void ldv_assert_linux_kernel_rcu_update_lock_bh__locked_at_exit(int expr ) ; void ldv_assert_linux_kernel_rcu_update_lock_bh__locked_at_read_section(int expr ) ; void ldv_assert_linux_kernel_rcu_update_lock_bh__more_unlocks(int expr ) ; int ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh = 0; void ldv_linux_kernel_rcu_update_lock_bh_rcu_read_lock_bh(void) { { ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh = ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh + 1; return; } } void ldv_linux_kernel_rcu_update_lock_bh_rcu_read_unlock_bh(void) { { { ldv_assert_linux_kernel_rcu_update_lock_bh__more_unlocks(ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh > 0); ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh = ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh - 1; } return; } } void ldv_linux_kernel_rcu_update_lock_bh_check_for_read_section(void) { { { ldv_assert_linux_kernel_rcu_update_lock_bh__locked_at_read_section(ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh == 0); } return; } } void ldv_linux_kernel_rcu_update_lock_bh_check_final_state(void) { { { ldv_assert_linux_kernel_rcu_update_lock_bh__locked_at_exit(ldv_linux_kernel_rcu_update_lock_bh_rcu_nested_bh == 0); } return; } } void ldv_assert_linux_kernel_rcu_update_lock_sched__locked_at_exit(int expr ) ; void ldv_assert_linux_kernel_rcu_update_lock_sched__locked_at_read_section(int expr ) ; void ldv_assert_linux_kernel_rcu_update_lock_sched__more_unlocks(int expr ) ; int ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched = 0; void ldv_linux_kernel_rcu_update_lock_sched_rcu_read_lock_sched(void) { { ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched = ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched + 1; return; } } void ldv_linux_kernel_rcu_update_lock_sched_rcu_read_unlock_sched(void) { { { ldv_assert_linux_kernel_rcu_update_lock_sched__more_unlocks(ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched > 0); ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched = ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched - 1; } return; } } void ldv_linux_kernel_rcu_update_lock_sched_check_for_read_section(void) { { { ldv_assert_linux_kernel_rcu_update_lock_sched__locked_at_read_section(ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched == 0); } return; } } void ldv_linux_kernel_rcu_update_lock_sched_check_final_state(void) { { { ldv_assert_linux_kernel_rcu_update_lock_sched__locked_at_exit(ldv_linux_kernel_rcu_update_lock_sched_rcu_nested_sched == 0); } return; } } void ldv_assert_linux_kernel_rcu_update_lock__locked_at_exit(int expr ) ; void ldv_assert_linux_kernel_rcu_update_lock__locked_at_read_section(int expr ) ; void ldv_assert_linux_kernel_rcu_update_lock__more_unlocks(int expr ) ; int ldv_linux_kernel_rcu_update_lock_rcu_nested = 0; void ldv_linux_kernel_rcu_update_lock_rcu_read_lock(void) { { ldv_linux_kernel_rcu_update_lock_rcu_nested = ldv_linux_kernel_rcu_update_lock_rcu_nested + 1; return; } } void ldv_linux_kernel_rcu_update_lock_rcu_read_unlock(void) { { { ldv_assert_linux_kernel_rcu_update_lock__more_unlocks(ldv_linux_kernel_rcu_update_lock_rcu_nested > 0); ldv_linux_kernel_rcu_update_lock_rcu_nested = ldv_linux_kernel_rcu_update_lock_rcu_nested - 1; } return; } } void ldv_linux_kernel_rcu_update_lock_check_for_read_section(void) { { { ldv_assert_linux_kernel_rcu_update_lock__locked_at_read_section(ldv_linux_kernel_rcu_update_lock_rcu_nested == 0); } return; } } void ldv_linux_kernel_rcu_update_lock_check_final_state(void) { { { ldv_assert_linux_kernel_rcu_update_lock__locked_at_exit(ldv_linux_kernel_rcu_update_lock_rcu_nested == 0); } return; } } int ldv_post_probe(int probe_ret_val ) ; static int ldv_filter_positive_int(int val ) { { { ldv_assume(val <= 0); } return (val); } } int ldv_post_init(int init_ret_val ) { int tmp ; { { tmp = ldv_filter_positive_int(init_ret_val); } return (tmp); } } int ldv_post_probe(int probe_ret_val ) { int tmp ; { { tmp = ldv_filter_positive_int(probe_ret_val); } return (tmp); } } int ldv_filter_err_code(int ret_val ) { int tmp ; { { tmp = ldv_filter_positive_int(ret_val); } return (tmp); } } void ldv_switch_to_interrupt_context(void) ; void ldv_switch_to_process_context(void) ; static bool __ldv_in_interrupt_context = 0; void ldv_switch_to_interrupt_context(void) { { __ldv_in_interrupt_context = 1; return; } } void ldv_switch_to_process_context(void) { { __ldv_in_interrupt_context = 0; return; } } bool ldv_in_interrupt_context(void) { { return (__ldv_in_interrupt_context); } } void ldv_assert_linux_lib_find_bit__offset_out_of_range(int expr ) ; extern int nr_cpu_ids ; unsigned long ldv_undef_ulong(void) ; unsigned long ldv_linux_lib_find_bit_find_next_bit(unsigned long size , unsigned long offset ) { unsigned long nondet ; unsigned long tmp ; { { tmp = ldv_undef_ulong(); nondet = tmp; ldv_assert_linux_lib_find_bit__offset_out_of_range(offset <= size); ldv_assume(nondet <= size); ldv_assume(1); } return (nondet); } } unsigned long ldv_linux_lib_find_bit_find_first_bit(unsigned long size ) { unsigned long nondet ; unsigned long tmp ; { { tmp = ldv_undef_ulong(); nondet = tmp; ldv_assume(nondet <= size); ldv_assume(1); } return (nondet); } } void ldv_linux_lib_find_bit_initialize(void) { { { ldv_assume(nr_cpu_ids > 0); } return; } } void *ldv_kzalloc(size_t size , gfp_t flags ) { void *res ; { { ldv_check_alloc_flags(flags); res = ldv_zalloc(size); ldv_after_alloc(res); } return (res); } } void ldv_assert_linux_mmc_sdio_func__double_claim(int expr ) ; void ldv_assert_linux_mmc_sdio_func__release_without_claim(int expr ) ; void ldv_assert_linux_mmc_sdio_func__unreleased_at_exit(int expr ) ; void ldv_assert_linux_mmc_sdio_func__wrong_params(int expr ) ; unsigned short ldv_linux_mmc_sdio_func_sdio_element = 0U; void ldv_linux_mmc_sdio_func_check_context(struct sdio_func *func ) { { { ldv_assert_linux_mmc_sdio_func__wrong_params((int )ldv_linux_mmc_sdio_func_sdio_element == ((func->card)->host)->index); } return; } } void ldv_linux_mmc_sdio_func_sdio_claim_host(struct sdio_func *func ) { { { ldv_assert_linux_mmc_sdio_func__double_claim((unsigned int )ldv_linux_mmc_sdio_func_sdio_element == 0U); ldv_linux_mmc_sdio_func_sdio_element = (unsigned short )((func->card)->host)->index; } return; } } void ldv_linux_mmc_sdio_func_sdio_release_host(struct sdio_func *func ) { { { ldv_assert_linux_mmc_sdio_func__release_without_claim((int )ldv_linux_mmc_sdio_func_sdio_element == ((func->card)->host)->index); ldv_linux_mmc_sdio_func_sdio_element = 0U; } return; } } void ldv_linux_mmc_sdio_func_check_final_state(void) { { { ldv_assert_linux_mmc_sdio_func__unreleased_at_exit((unsigned int )ldv_linux_mmc_sdio_func_sdio_element == 0U); } return; } } void ldv_assert_linux_net_register__wrong_return_value(int expr ) ; int ldv_pre_register_netdev(void) ; int ldv_linux_net_register_probe_state = 0; int ldv_pre_register_netdev(void) { int nondet ; int tmp ; { { tmp = ldv_undef_int(); nondet = tmp; } if (nondet < 0) { ldv_linux_net_register_probe_state = 1; return (nondet); } else { return (0); } } } void ldv_linux_net_register_reset_error_counter(void) { { ldv_linux_net_register_probe_state = 0; return; } } void ldv_linux_net_register_check_return_value_probe(int retval ) { { if (ldv_linux_net_register_probe_state == 1) { { ldv_assert_linux_net_register__wrong_return_value(retval != 0); } } else { } { ldv_linux_net_register_reset_error_counter(); } return; } } void ldv_assert_linux_net_rtnetlink__double_lock(int expr ) ; void ldv_assert_linux_net_rtnetlink__double_unlock(int expr ) ; void ldv_assert_linux_net_rtnetlink__lock_on_exit(int expr ) ; int rtnllocknumber = 0; void ldv_linux_net_rtnetlink_past_rtnl_unlock(void) { { { ldv_assert_linux_net_rtnetlink__double_unlock(rtnllocknumber == 1); rtnllocknumber = 0; } return; } } void ldv_linux_net_rtnetlink_past_rtnl_lock(void) { { { ldv_assert_linux_net_rtnetlink__double_lock(rtnllocknumber == 0); rtnllocknumber = 1; } return; } } void ldv_linux_net_rtnetlink_before_ieee80211_unregister_hw(void) { { { ldv_linux_net_rtnetlink_past_rtnl_lock(); ldv_linux_net_rtnetlink_past_rtnl_unlock(); } return; } } int ldv_linux_net_rtnetlink_rtnl_is_locked(void) { int tmp ; { if (rtnllocknumber != 0) { return (rtnllocknumber); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_net_rtnetlink_rtnl_trylock(void) { int tmp ; { { ldv_assert_linux_net_rtnetlink__double_lock(rtnllocknumber == 0); tmp = ldv_linux_net_rtnetlink_rtnl_is_locked(); } if (tmp == 0) { rtnllocknumber = 1; return (1); } else { return (0); } } } void ldv_linux_net_rtnetlink_check_final_state(void) { { { ldv_assert_linux_net_rtnetlink__lock_on_exit(rtnllocknumber == 0); } return; } } void ldv_assert_linux_net_sock__all_locked_sockets_must_be_released(int expr ) ; void ldv_assert_linux_net_sock__double_release(int expr ) ; int locksocknumber = 0; void ldv_linux_net_sock_past_lock_sock_nested(void) { { locksocknumber = locksocknumber + 1; return; } } bool ldv_linux_net_sock_lock_sock_fast(void) { int tmp ; { { tmp = ldv_undef_int(); } if (tmp != 0) { locksocknumber = locksocknumber + 1; return (1); } else { } return (0); } } void ldv_linux_net_sock_unlock_sock_fast(void) { { { ldv_assert_linux_net_sock__double_release(locksocknumber > 0); locksocknumber = locksocknumber - 1; } return; } } void ldv_linux_net_sock_before_release_sock(void) { { { ldv_assert_linux_net_sock__double_release(locksocknumber > 0); locksocknumber = locksocknumber - 1; } return; } } void ldv_linux_net_sock_check_final_state(void) { { { ldv_assert_linux_net_sock__all_locked_sockets_must_be_released(locksocknumber == 0); } return; } } void ldv_assert_linux_usb_coherent__less_initial_decrement(int expr ) ; void ldv_assert_linux_usb_coherent__more_initial_at_exit(int expr ) ; int ldv_linux_usb_coherent_coherent_state = 0; void *ldv_linux_usb_coherent_usb_alloc_coherent(void) { void *arbitrary_memory ; void *tmp ; { { tmp = ldv_undef_ptr(); arbitrary_memory = tmp; } if ((unsigned long )arbitrary_memory == (unsigned long )((void *)0)) { return (arbitrary_memory); } else { } ldv_linux_usb_coherent_coherent_state = ldv_linux_usb_coherent_coherent_state + 1; return (arbitrary_memory); } } void ldv_linux_usb_coherent_usb_free_coherent(void *addr ) { { if ((unsigned long )addr != (unsigned long )((void *)0)) { { ldv_assert_linux_usb_coherent__less_initial_decrement(ldv_linux_usb_coherent_coherent_state > 0); ldv_linux_usb_coherent_coherent_state = ldv_linux_usb_coherent_coherent_state + -1; } } else { } return; } } void ldv_linux_usb_coherent_check_final_state(void) { { { ldv_assert_linux_usb_coherent__more_initial_at_exit(ldv_linux_usb_coherent_coherent_state == 0); } return; } } void ldv_assert_linux_usb_dev__less_initial_decrement(int expr ) ; void ldv_assert_linux_usb_dev__more_initial_at_exit(int expr ) ; void ldv_assert_linux_usb_dev__probe_failed(int expr ) ; void ldv_assert_linux_usb_dev__unincremented_counter_decrement(int expr ) ; ldv_map LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS ; struct usb_device *ldv_linux_usb_dev_usb_get_dev(struct usb_device *dev ) { { if ((unsigned long )dev != (unsigned long )((struct usb_device *)0)) { LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS = LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS != 0 ? LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS + 1 : 1; } else { } return (dev); } } void ldv_linux_usb_dev_usb_put_dev(struct usb_device *dev ) { { if ((unsigned long )dev != (unsigned long )((struct usb_device *)0)) { { ldv_assert_linux_usb_dev__unincremented_counter_decrement(LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS != 0); ldv_assert_linux_usb_dev__less_initial_decrement(LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS > 0); } if (LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS > 1) { LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS = LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS + -1; } else { LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS = 0; } } else { } return; } } void ldv_linux_usb_dev_check_return_value_probe(int retval ) { { if (retval != 0) { { ldv_assert_linux_usb_dev__probe_failed(LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS == 0); } } else { } return; } } void ldv_linux_usb_dev_initialize(void) { { LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS = 0; return; } } void ldv_linux_usb_dev_check_final_state(void) { { { ldv_assert_linux_usb_dev__more_initial_at_exit(LDV_LINUX_USB_DEV_USB_DEV_REF_COUNTS == 0); } return; } } void ldv_assert_linux_usb_gadget__chrdev_deregistration_with_usb_gadget(int expr ) ; void ldv_assert_linux_usb_gadget__chrdev_registration_with_usb_gadget(int expr ) ; void ldv_assert_linux_usb_gadget__class_deregistration_with_usb_gadget(int expr ) ; void ldv_assert_linux_usb_gadget__class_registration_with_usb_gadget(int expr ) ; void ldv_assert_linux_usb_gadget__double_usb_gadget_deregistration(int expr ) ; void ldv_assert_linux_usb_gadget__double_usb_gadget_registration(int expr ) ; void ldv_assert_linux_usb_gadget__usb_gadget_registered_at_exit(int expr ) ; int ldv_linux_usb_gadget_usb_gadget = 0; void *ldv_linux_usb_gadget_create_class(void) { void *is_got ; long tmp ; { { is_got = ldv_undef_ptr(); ldv_assume((int )((long )is_got)); tmp = ldv_is_err((void const *)is_got); } if (tmp == 0L) { { ldv_assert_linux_usb_gadget__class_registration_with_usb_gadget(ldv_linux_usb_gadget_usb_gadget == 0); } } else { } return (is_got); } } int ldv_linux_usb_gadget_register_class(void) { int is_reg ; { { is_reg = ldv_undef_int_nonpositive(); } if (is_reg == 0) { { ldv_assert_linux_usb_gadget__class_registration_with_usb_gadget(ldv_linux_usb_gadget_usb_gadget == 0); } } else { } return (is_reg); } } void ldv_linux_usb_gadget_unregister_class(void) { { { ldv_assert_linux_usb_gadget__class_deregistration_with_usb_gadget(ldv_linux_usb_gadget_usb_gadget == 0); } return; } } void ldv_linux_usb_gadget_destroy_class(struct class *cls ) { long tmp ; { if ((unsigned long )cls == (unsigned long )((struct class *)0)) { return; } else { { tmp = ldv_is_err((void const *)cls); } if (tmp != 0L) { return; } else { } } { ldv_linux_usb_gadget_unregister_class(); } return; } } int ldv_linux_usb_gadget_register_chrdev(int major ) { int is_reg ; { { is_reg = ldv_undef_int_nonpositive(); } if (is_reg == 0) { { ldv_assert_linux_usb_gadget__chrdev_registration_with_usb_gadget(ldv_linux_usb_gadget_usb_gadget == 0); } if (major == 0) { { is_reg = ldv_undef_int(); ldv_assume(is_reg > 0); } } else { } } else { } return (is_reg); } } int ldv_linux_usb_gadget_register_chrdev_region(void) { int is_reg ; { { is_reg = ldv_undef_int_nonpositive(); } if (is_reg == 0) { { ldv_assert_linux_usb_gadget__chrdev_registration_with_usb_gadget(ldv_linux_usb_gadget_usb_gadget == 0); } } else { } return (is_reg); } } void ldv_linux_usb_gadget_unregister_chrdev_region(void) { { { ldv_assert_linux_usb_gadget__chrdev_deregistration_with_usb_gadget(ldv_linux_usb_gadget_usb_gadget == 0); } return; } } int ldv_linux_usb_gadget_register_usb_gadget(void) { int is_reg ; { { is_reg = ldv_undef_int_nonpositive(); } if (is_reg == 0) { { ldv_assert_linux_usb_gadget__double_usb_gadget_registration(ldv_linux_usb_gadget_usb_gadget == 0); ldv_linux_usb_gadget_usb_gadget = 1; } } else { } return (is_reg); } } void ldv_linux_usb_gadget_unregister_usb_gadget(void) { { { ldv_assert_linux_usb_gadget__double_usb_gadget_deregistration(ldv_linux_usb_gadget_usb_gadget == 1); ldv_linux_usb_gadget_usb_gadget = 0; } return; } } void ldv_linux_usb_gadget_check_final_state(void) { { { ldv_assert_linux_usb_gadget__usb_gadget_registered_at_exit(ldv_linux_usb_gadget_usb_gadget == 0); } return; } } void ldv_assert_linux_usb_register__wrong_return_value(int expr ) ; int ldv_pre_usb_register_driver(void) ; int ldv_linux_usb_register_probe_state = 0; int ldv_pre_usb_register_driver(void) { int nondet ; int tmp ; { { tmp = ldv_undef_int(); nondet = tmp; } if (nondet < 0) { ldv_linux_usb_register_probe_state = 1; return (nondet); } else { return (0); } } } void ldv_linux_usb_register_reset_error_counter(void) { { ldv_linux_usb_register_probe_state = 0; return; } } void ldv_linux_usb_register_check_return_value_probe(int retval ) { { if (ldv_linux_usb_register_probe_state == 1) { { ldv_assert_linux_usb_register__wrong_return_value(retval != 0); } } else { } { ldv_linux_usb_register_reset_error_counter(); } return; } } void ldv_assert_linux_usb_urb__less_initial_decrement(int expr ) ; void ldv_assert_linux_usb_urb__more_initial_at_exit(int expr ) ; int ldv_linux_usb_urb_urb_state = 0; struct urb *ldv_linux_usb_urb_usb_alloc_urb(void) { void *arbitrary_memory ; void *tmp ; { { tmp = ldv_undef_ptr(); arbitrary_memory = tmp; } if ((unsigned long )arbitrary_memory == (unsigned long )((void *)0)) { return ((struct urb *)arbitrary_memory); } else { } ldv_linux_usb_urb_urb_state = ldv_linux_usb_urb_urb_state + 1; return ((struct urb *)arbitrary_memory); } } void ldv_linux_usb_urb_usb_free_urb(struct urb *urb ) { { if ((unsigned long )urb != (unsigned long )((struct urb *)0)) { { ldv_assert_linux_usb_urb__less_initial_decrement(ldv_linux_usb_urb_urb_state > 0); ldv_linux_usb_urb_urb_state = ldv_linux_usb_urb_urb_state + -1; } } else { } return; } } void ldv_linux_usb_urb_check_final_state(void) { { { ldv_assert_linux_usb_urb__more_initial_at_exit(ldv_linux_usb_urb_urb_state == 0); } return; } } extern void ldv_assert(char const * , int ) ; void ldv__builtin_trap(void) ; void ldv_assume(int expression ) { { if (expression == 0) { ldv_assume_label: ; goto ldv_assume_label; } else { } return; } } void ldv_stop(void) { { ldv_stop_label: ; goto ldv_stop_label; } } long ldv__builtin_expect(long exp , long c ) { { return (exp); } } void ldv__builtin_trap(void) { { { ldv_assert("", 0); } return; } } void *ldv_malloc(size_t size ) ; void *ldv_calloc(size_t nmemb , size_t size ) ; extern void *external_allocated_data(void) ; void *ldv_calloc_unknown_size(void) ; void *ldv_zalloc_unknown_size(void) ; void *ldv_xmalloc_unknown_size(size_t size ) ; extern void *malloc(size_t ) ; extern void *calloc(size_t , size_t ) ; extern void free(void * ) ; extern void *memset(void * , int , size_t ) ; void *ldv_malloc(size_t size ) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = malloc(size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_calloc(size_t nmemb , size_t size ) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = calloc(nmemb, size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_zalloc(size_t size ) { void *tmp ; { { tmp = ldv_calloc(1UL, size); } return (tmp); } } void ldv_free(void *s ) { { { free(s); } return; } } void *ldv_xmalloc(size_t size ) { void *res ; void *tmp ; long tmp___0 ; { { tmp = malloc(size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } } void *ldv_xzalloc(size_t size ) { void *res ; void *tmp ; long tmp___0 ; { { tmp = calloc(1UL, size); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } } void *ldv_malloc_unknown_size(void) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = external_allocated_data(); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_calloc_unknown_size(void) { void *res ; void *tmp ; long tmp___0 ; int tmp___1 ; { { tmp___1 = ldv_undef_int(); } if (tmp___1 != 0) { { tmp = external_allocated_data(); res = tmp; memset(res, 0, 8UL); ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } else { return ((void *)0); } } } void *ldv_zalloc_unknown_size(void) { void *tmp ; { { tmp = ldv_calloc_unknown_size(); } return (tmp); } } void *ldv_xmalloc_unknown_size(size_t size ) { void *res ; void *tmp ; long tmp___0 ; { { tmp = external_allocated_data(); res = tmp; ldv_assume((unsigned long )res != (unsigned long )((void *)0)); tmp___0 = ldv_is_err((void const *)res); ldv_assume(tmp___0 == 0L); } return (res); } } int ldv_undef_int_negative(void) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; int ldv_undef_int(void) { int tmp ; { { tmp = __VERIFIER_nondet_int(); } return (tmp); } } void *ldv_undef_ptr(void) { void *tmp ; { { tmp = __VERIFIER_nondet_pointer(); } return (tmp); } } unsigned long ldv_undef_ulong(void) { unsigned long tmp ; { { tmp = __VERIFIER_nondet_ulong(); } return (tmp); } } int ldv_undef_int_negative(void) { int ret ; int tmp ; { { tmp = ldv_undef_int(); ret = tmp; ldv_assume(ret < 0); } return (ret); } } int ldv_undef_int_nonpositive(void) { int ret ; int tmp ; { { tmp = ldv_undef_int(); ret = tmp; ldv_assume(ret <= 0); } return (ret); } } int ldv_thread_create(struct ldv_thread *ldv_thread , void (*function)(void * ) , void *data ) ; int ldv_thread_create_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) , void *data ) ; int ldv_thread_join(struct ldv_thread *ldv_thread , void (*function)(void * ) ) ; int ldv_thread_join_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) ) ; int ldv_thread_create(struct ldv_thread *ldv_thread , void (*function)(void * ) , void *data ) { { if ((unsigned long )function != (unsigned long )((void (*)(void * ))0)) { { (*function)(data); } } else { } return (0); } } int ldv_thread_create_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) , void *data ) { int i ; { if ((unsigned long )function != (unsigned long )((void (*)(void * ))0)) { i = 0; goto ldv_1179; ldv_1178: { (*function)(data); i = i + 1; } ldv_1179: ; if (i < ldv_thread_set->number) { goto ldv_1178; } else { } } else { } return (0); } } int ldv_thread_join(struct ldv_thread *ldv_thread , void (*function)(void * ) ) { { return (0); } } int ldv_thread_join_N(struct ldv_thread_set *ldv_thread_set , void (*function)(void * ) ) { { return (0); } } void ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(int expr ) ; void ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(int expr ) ; void ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock(int expr ) ; void ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(int expr ) ; ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device ; void ldv_linux_kernel_locking_mutex_mutex_lock_alc_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_alc_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_alc_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_alc_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_alc_mutex_of_ubi_device(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_alc_mutex_of_ubi_device(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_alc_mutex_of_ubi_device(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_alc_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device ; void ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_buf_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_buf_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_buf_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_buf_mutex_of_ubi_device(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_buf_mutex_of_ubi_device(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_buf_mutex_of_ubi_device(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_buf_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device ; void ldv_linux_kernel_locking_mutex_mutex_lock_ckvol_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_ckvol_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_ckvol_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_ckvol_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_ckvol_mutex_of_ubi_device(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_ckvol_mutex_of_ubi_device(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_ckvol_mutex_of_ubi_device(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_ckvol_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock ; void ldv_linux_kernel_locking_mutex_mutex_lock_dev_mutex_of_ubiblock(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_dev_mutex_of_ubiblock(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_dev_mutex_of_ubiblock(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_dev_mutex_of_ubiblock(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_dev_mutex_of_ubiblock(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_dev_mutex_of_ubiblock(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_dev_mutex_of_ubiblock(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_dev_mutex_of_ubiblock(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device ; void ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_device_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_device_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_device_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_device_mutex_of_ubi_device(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_device_mutex_of_ubi_device(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_device_mutex_of_ubi_device(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_device_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex ; void ldv_linux_kernel_locking_mutex_mutex_lock_devices_mutex(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_devices_mutex(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_devices_mutex(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_devices_mutex(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_devices_mutex(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_devices_mutex(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_devices_mutex(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_devices_mutex(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device ; void ldv_linux_kernel_locking_mutex_mutex_lock_fm_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_fm_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_fm_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_fm_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_fm_mutex_of_ubi_device(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_fm_mutex_of_ubi_device(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_fm_mutex_of_ubi_device(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_fm_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode ; void ldv_linux_kernel_locking_mutex_mutex_lock_i_mutex_of_inode(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_i_mutex_of_inode(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_i_mutex_of_inode(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_i_mutex_of_inode(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_i_mutex_of_inode(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_i_mutex_of_inode(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_i_mutex_of_inode(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_i_mutex_of_inode(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock ; void ldv_linux_kernel_locking_mutex_mutex_lock_lock(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_lock(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_lock(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_lock(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_lock(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_lock(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_lock(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_lock(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device ; void ldv_linux_kernel_locking_mutex_mutex_lock_move_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_move_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_move_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_move_mutex_of_ubi_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_move_mutex_of_ubi_device(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_move_mutex_of_ubi_device(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_move_mutex_of_ubi_device(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_move_mutex_of_ubi_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device ; void ldv_linux_kernel_locking_mutex_mutex_lock_mutex_of_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_mutex_of_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_mutex_of_device(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_mutex_of_device(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_mutex_of_device(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_mutex_of_device(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_mutex_of_device(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_mutex_of_device(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device = 0; } return; } } ldv_set LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex ; void ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex = 1; } return; } } int ldv_linux_kernel_locking_mutex_mutex_lock_interruptible_or_killable_ubi_devices_mutex(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex); tmp = ldv_undef_int(); } if (tmp != 0) { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex = 1; return (0); } else { return (-4); } } } int ldv_linux_kernel_locking_mutex_mutex_is_locked_ubi_devices_mutex(struct mutex *lock ) { int tmp ; { if ((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex) { return (1); } else { { tmp = ldv_undef_int(); } if (tmp != 0) { return (1); } else { return (0); } } } } int ldv_linux_kernel_locking_mutex_mutex_trylock_ubi_devices_mutex(struct mutex *lock ) { int tmp ; { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex); tmp = ldv_linux_kernel_locking_mutex_mutex_is_locked_ubi_devices_mutex(lock); } if (tmp != 0) { return (0); } else { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex = 1; return (1); } } } int ldv_linux_kernel_locking_mutex_atomic_dec_and_mutex_lock_ubi_devices_mutex(atomic_t *cnt , struct mutex *lock ) { { cnt->counter = cnt->counter - 1; if (cnt->counter != 0) { return (0); } else { { ldv_linux_kernel_locking_mutex_mutex_lock_ubi_devices_mutex(lock); } return (1); } } } void ldv_linux_kernel_locking_mutex_mutex_unlock_ubi_devices_mutex(struct mutex *lock ) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock((int )LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex); LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex = 0; } return; } } void ldv_linux_kernel_locking_mutex_initialize(void) { { LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device = 0; LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex = 0; return; } } void ldv_linux_kernel_locking_mutex_check_final_state(void) { { { ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_alc_mutex_of_ubi_device); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_buf_mutex_of_ubi_device); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ckvol_mutex_of_ubi_device); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_dev_mutex_of_ubiblock); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_device_mutex_of_ubi_device); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_devices_mutex); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_fm_mutex_of_ubi_device); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_i_mutex_of_inode); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_lock); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_move_mutex_of_ubi_device); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_mutex_of_device); ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(! LDV_LINUX_KERNEL_LOCKING_MUTEX_MUTEXES_ubi_devices_mutex); } return; } } void ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(int expr ) ; void ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(int expr ) ; void ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(int expr ) ; void ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(int expr ) ; static int ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_alloc_lock_of_task_struct(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_alloc_lock_of_task_struct(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 2); ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_alloc_lock_of_task_struct(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_alloc_lock_of_task_struct(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_alloc_lock_of_task_struct(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_alloc_lock_of_task_struct(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_alloc_lock_of_task_struct(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_alloc_lock_of_task_struct(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_alloc_lock_of_task_struct(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_i_lock_of_inode(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_i_lock_of_inode(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 2); ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_i_lock_of_inode(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_i_lock_of_inode(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_i_lock_of_inode(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_i_lock_of_inode(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_i_lock_of_inode(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_i_lock_of_inode(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_i_lock_of_inode(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_lock = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_lock(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock == 1); ldv_linux_kernel_locking_spinlock_spin_lock = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_lock(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_lock == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock == 2); ldv_linux_kernel_locking_spinlock_spin_lock = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_lock(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_lock = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_lock(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_lock(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_lock == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_lock(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_lock(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_lock(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_lock(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_lock = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_lock_of_NOT_ARG_SIGN(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_lock_of_NOT_ARG_SIGN(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 2); ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_lock_of_NOT_ARG_SIGN(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_lock_of_NOT_ARG_SIGN(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_lock_of_NOT_ARG_SIGN(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_lock_of_NOT_ARG_SIGN(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_lock_of_NOT_ARG_SIGN(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_lock_of_NOT_ARG_SIGN(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_lock_of_NOT_ARG_SIGN(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_ltree_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_ltree_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 2); ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_ltree_lock_of_ubi_device(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_ltree_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_ltree_lock_of_ubi_device(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_ltree_lock_of_ubi_device(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_ltree_lock_of_ubi_device(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_ltree_lock_of_ubi_device(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_ltree_lock_of_ubi_device(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_node_size_lock_of_pglist_data(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_node_size_lock_of_pglist_data(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 2); ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_node_size_lock_of_pglist_data(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_node_size_lock_of_pglist_data(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_node_size_lock_of_pglist_data(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_node_size_lock_of_pglist_data(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_node_size_lock_of_pglist_data(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_node_size_lock_of_pglist_data(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_node_size_lock_of_pglist_data(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_ptl = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_ptl(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); ldv_linux_kernel_locking_spinlock_spin_ptl = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_ptl(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_ptl == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ptl == 2); ldv_linux_kernel_locking_spinlock_spin_ptl = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_ptl(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_ptl = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_ptl(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_ptl(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_ptl == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_ptl(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_ptl(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_ptl(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_ptl(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_ptl = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_siglock_of_sighand_struct(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_siglock_of_sighand_struct(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 2); ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_siglock_of_sighand_struct(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_siglock_of_sighand_struct(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_siglock_of_sighand_struct(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_siglock_of_sighand_struct(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_siglock_of_sighand_struct(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_siglock_of_sighand_struct(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_siglock_of_sighand_struct(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_ubi_devices_lock(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_ubi_devices_lock(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 2); ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_ubi_devices_lock(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_ubi_devices_lock(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_ubi_devices_lock(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_ubi_devices_lock(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_ubi_devices_lock(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_ubi_devices_lock(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_ubi_devices_lock(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_volumes_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_volumes_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 2); ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_volumes_lock_of_ubi_device(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_volumes_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_volumes_lock_of_ubi_device(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_volumes_lock_of_ubi_device(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_volumes_lock_of_ubi_device(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_volumes_lock_of_ubi_device(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_volumes_lock_of_ubi_device(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device = 2; return (1); } else { } return (0); } } static int ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device = 1; void ldv_linux_kernel_locking_spinlock_spin_lock_wl_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device = 2; } return; } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wl_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 2); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 2); ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device = 1; } return; } } int ldv_linux_kernel_locking_spinlock_spin_trylock_wl_lock_of_ubi_device(void) { int is_spin_held_by_another_thread ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); is_spin_held_by_another_thread = ldv_undef_int(); } if (is_spin_held_by_another_thread != 0) { return (0); } else { ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device = 2; return (1); } } } void ldv_linux_kernel_locking_spinlock_spin_unlock_wait_wl_lock_of_ubi_device(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); } return; } } int ldv_linux_kernel_locking_spinlock_spin_is_locked_wl_lock_of_ubi_device(void) { int is_spin_held_by_another_thread ; { { is_spin_held_by_another_thread = ldv_undef_int(); } if (ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1 && is_spin_held_by_another_thread == 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_spin_can_lock_wl_lock_of_ubi_device(void) { int tmp ; { { tmp = ldv_linux_kernel_locking_spinlock_spin_is_locked_wl_lock_of_ubi_device(); } return (tmp == 0); } } int ldv_linux_kernel_locking_spinlock_spin_is_contended_wl_lock_of_ubi_device(void) { int is_spin_contended ; { { is_spin_contended = ldv_undef_int(); } if (is_spin_contended != 0) { return (0); } else { return (1); } } } int ldv_linux_kernel_locking_spinlock_atomic_dec_and_lock_wl_lock_of_ubi_device(void) { int atomic_value_after_dec ; { { ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); ldv_assume(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); atomic_value_after_dec = ldv_undef_int(); } if (atomic_value_after_dec == 0) { ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device = 2; return (1); } else { } return (0); } } void ldv_linux_kernel_locking_spinlock_check_final_state(void) { { { ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_lock == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_ptl == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 1); ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 1); } return; } } int ldv_exclusive_spin_is_locked(void) { { if (ldv_linux_kernel_locking_spinlock_spin_alloc_lock_of_task_struct == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_i_lock_of_inode == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_lock == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_lock_of_NOT_ARG_SIGN == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_ltree_lock_of_ubi_device == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_node_size_lock_of_pglist_data == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_ptl == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_siglock_of_sighand_struct == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_ubi_devices_lock == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_volumes_lock_of_ubi_device == 2) { return (1); } else { } if (ldv_linux_kernel_locking_spinlock_spin_wl_lock_of_ubi_device == 2) { return (1); } else { } return (0); } } void ldv_assert_linux_kernel_sched_completion__double_init(int expr ) ; void ldv_assert_linux_kernel_sched_completion__wait_without_init(int expr ) ; static int ldv_linux_kernel_sched_completion_completion = 0; void ldv_linux_kernel_sched_completion_init_completion(void) { { ldv_linux_kernel_sched_completion_completion = 1; return; } } void ldv_linux_kernel_sched_completion_init_completion_macro(void) { { { ldv_assert_linux_kernel_sched_completion__double_init(ldv_linux_kernel_sched_completion_completion != 0); ldv_linux_kernel_sched_completion_completion = 1; } return; } } void ldv_linux_kernel_sched_completion_wait_for_completion(void) { { { ldv_assert_linux_kernel_sched_completion__wait_without_init(ldv_linux_kernel_sched_completion_completion != 0); ldv_linux_kernel_sched_completion_completion = 2; } return; } } void ldv_assert_linux_lib_idr__destroyed_before_usage(int expr ) ; void ldv_assert_linux_lib_idr__double_init(int expr ) ; void ldv_assert_linux_lib_idr__more_at_exit(int expr ) ; void ldv_assert_linux_lib_idr__not_initialized(int expr ) ; static int ldv_linux_lib_idr_idr = 0; void ldv_linux_lib_idr_idr_init(void) { { { ldv_assert_linux_lib_idr__double_init(ldv_linux_lib_idr_idr == 0); ldv_linux_lib_idr_idr = 1; } return; } } void ldv_linux_lib_idr_idr_alloc(void) { { { ldv_assert_linux_lib_idr__not_initialized(ldv_linux_lib_idr_idr != 0); ldv_assert_linux_lib_idr__destroyed_before_usage(ldv_linux_lib_idr_idr != 3); ldv_linux_lib_idr_idr = 2; } return; } } void ldv_linux_lib_idr_idr_find(void) { { { ldv_assert_linux_lib_idr__not_initialized(ldv_linux_lib_idr_idr != 0); ldv_assert_linux_lib_idr__destroyed_before_usage(ldv_linux_lib_idr_idr != 3); ldv_linux_lib_idr_idr = 2; } return; } } void ldv_linux_lib_idr_idr_remove(void) { { { ldv_assert_linux_lib_idr__not_initialized(ldv_linux_lib_idr_idr != 0); ldv_assert_linux_lib_idr__destroyed_before_usage(ldv_linux_lib_idr_idr != 3); ldv_linux_lib_idr_idr = 2; } return; } } void ldv_linux_lib_idr_idr_destroy(void) { { { ldv_assert_linux_lib_idr__not_initialized(ldv_linux_lib_idr_idr != 0); ldv_assert_linux_lib_idr__destroyed_before_usage(ldv_linux_lib_idr_idr != 3); ldv_linux_lib_idr_idr = 3; } return; } } void ldv_linux_lib_idr_check_final_state(void) { { { ldv_assert_linux_lib_idr__more_at_exit(ldv_linux_lib_idr_idr == 0 || ldv_linux_lib_idr_idr == 3); } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_net_rtnetlink__double_lock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_net_rtnetlink__lock_on_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_net_rtnetlink__double_unlock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_locking_rwlock__read_lock_on_write_lock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_rwlock__more_read_unlocks(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_rwlock__read_lock_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_rwlock__double_write_lock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_rwlock__double_write_unlock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_rwlock__write_lock_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_lib_idr__double_init(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_lib_idr__not_initialized(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_lib_idr__destroyed_before_usage(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_lib_idr__more_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_sched_completion__double_init(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_sched_completion__wait_without_init(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_net_register__wrong_return_value(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_fs_char_dev__double_registration(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_fs_char_dev__double_deregistration(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_fs_char_dev__registered_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_rcu_srcu__more_unlocks(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_srcu__locked_at_read_section(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_srcu__locked_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_module__less_initial_decrement(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_module__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_alloc_spinlock__wrong_flags(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_alloc_spinlock__nonatomic(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_lib_find_bit__offset_out_of_range(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_mmc_sdio_func__wrong_params(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_mmc_sdio_func__double_claim(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_mmc_sdio_func__release_without_claim(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_mmc_sdio_func__unreleased_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_usb_coherent__less_initial_decrement(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_coherent__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_rcu_update_lock__more_unlocks(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_update_lock__locked_at_read_section(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_update_lock__locked_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_net_sock__all_locked_sockets_must_be_released(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_net_sock__double_release(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_rcu_update_lock_bh__more_unlocks(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_update_lock_bh__locked_at_read_section(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_update_lock_bh__locked_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_usb_dev__unincremented_counter_decrement(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_dev__less_initial_decrement(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_dev__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_dev__probe_failed(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_mutex__one_thread_double_lock_try(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_mutex__one_thread_double_unlock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_mutex__one_thread_locked_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_usb_gadget__class_registration_with_usb_gadget(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_gadget__class_deregistration_with_usb_gadget(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_gadget__chrdev_registration_with_usb_gadget(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_gadget__chrdev_deregistration_with_usb_gadget(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_gadget__double_usb_gadget_registration(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_gadget__double_usb_gadget_deregistration(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_gadget__usb_gadget_registered_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_alloc_usb_lock__wrong_flags(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_alloc_usb_lock__nonatomic(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_block_request__double_get(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_request__double_put(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_request__get_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_alloc_irq__wrong_flags(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_alloc_irq__nonatomic(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_drivers_base_class__double_registration(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_drivers_base_class__double_deregistration(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_drivers_base_class__registered_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_block_queue__double_allocation(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_queue__use_before_allocation(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_queue__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_block_genhd__double_allocation(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_genhd__use_before_allocation(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_genhd__delete_before_add(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_genhd__free_before_allocation(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_block_genhd__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_arch_io__less_initial_decrement(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_arch_io__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_usb_register__wrong_return_value(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_fs_sysfs__less_initial_decrement(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_fs_sysfs__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_spinlock__one_thread_double_lock_try(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_spinlock__one_thread_double_unlock(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_locking_spinlock__one_thread_locked_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_usb_urb__less_initial_decrement(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_usb_urb__more_initial_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } extern void __VERIFIER_error(void) ; void ldv_assert_linux_kernel_rcu_update_lock_sched__more_unlocks(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_update_lock_sched__locked_at_read_section(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } } void ldv_assert_linux_kernel_rcu_update_lock_sched__locked_at_exit(int expr ) { { if (! expr) { { __VERIFIER_error(); } } else { } return; } }