LCOV - code coverage report
Current view: top level - avtg/fs/ext2/ext2.ko/linux:drivers:clk2/weaver - file.c.aux (source / functions) Hit Total Coverage
Test: coverage.info Lines: 199 201 99.0 %
Date: 2017-01-25 Functions: 26 26 100.0 %

          Line data    Source code
       1             : 
       2             : struct device;
       3             : 
       4             : void *ldv_dev_get_drvdata(const struct device *dev);
       5             : int ldv_dev_set_drvdata(struct device *dev, void *data);
       6             : 
       7             : struct spi_master;
       8             : struct device;
       9             : struct spi_master *ldv_spi_alloc_master(struct device *host, unsigned size);
      10             : 
      11             : #include <linux/ldv/err.h>
      12             : 
      13             : #include <linux/types.h>
      14             : void *ldv_kzalloc(size_t size, gfp_t flags);
      15             : 
      16             : struct clk;
      17             : 
      18             : extern void ldv_clk_disable(struct clk *clk);
      19             : extern int ldv_clk_enable(void);
      20             : 
      21             : #include <linux/ldv/common.h>
      22             : #include <linux/ldv/irq.h>
      23             : #include <verifier/common.h>
      24             : #include <verifier/nondet.h>
      25             : #include <verifier/memory.h>
      26             : #include <verifier/thread.h>
      27             : 
      28             : #include <linux/cdev.h>
      29             : #include <linux/miscdevice.h>
      30             : #include <linux/seq_file.h>
      31             : #include <linux/fs.h>
      32             : #include <linux/pagemap.h>
      33             : 
      34             : 
      35             : struct ldv_struct_insmod_10 {
      36             :  int signal_pending;
      37             : };
      38             : 
      39             : struct ldv_struct_random_containerless_scenario_5 {
      40             :  struct file_system_type *arg0;
      41             :  int signal_pending;
      42             : };
      43             : 
      44             : /* EMG Function declarations */
      45             : void ldv_character_driver_scenario_2(void *);
      46             : void ldv_character_driver_scenario_callback_1_25(long int (*)(struct file *, unsigned int, long unsigned int), struct file *, unsigned int, long unsigned int);
      47             : void ldv_character_driver_scenario_callback_1_28(int (*)(struct file *, struct dentry *, int), struct file *, struct dentry *, int);
      48             : void ldv_character_driver_scenario_callback_1_31(loff_t (*)(struct file *, loff_t , int), struct file *, long long int, int);
      49             : void ldv_character_driver_scenario_callback_1_45(long int (*)(struct file *, unsigned int, long unsigned int), struct file *, unsigned int, long unsigned int);
      50             : void ldv_character_driver_scenario_callback_2_22(ssize_t (*)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *, struct iovec *, long unsigned int, long long int);
      51             : void ldv_character_driver_scenario_callback_2_25(long int (*)(struct file *, unsigned int, long unsigned int), struct file *, unsigned int, long unsigned int);
      52             : void ldv_character_driver_scenario_callback_2_28(int (*)(struct file *, struct dentry *, int), struct file *, struct dentry *, int);
      53             : void ldv_character_driver_scenario_callback_2_31(loff_t (*)(struct file *, loff_t , int), struct file *, long long int, int);
      54             : void ldv_character_driver_scenario_callback_2_34(int (*)(struct file *, struct vm_area_struct *), struct file *, struct vm_area_struct *);
      55             : void ldv_character_driver_scenario_callback_2_35(ssize_t (*)(struct file *, char *, long unsigned int, loff_t *), struct file *, char *, long unsigned int, loff_t *);
      56             : extern void ldv_character_driver_scenario_callback_2_38(int (*)(struct file *, void *, filldir_t ), struct file *, void *, int (*)(void *, char *, int, loff_t , u64 , unsigned int));
      57             : void ldv_character_driver_scenario_callback_2_39(ssize_t (*)(struct file *, loff_t *, struct pipe_inode_info *, long unsigned int, unsigned int), struct file *, loff_t *, struct pipe_inode_info *, long unsigned int, unsigned int);
      58             : void ldv_character_driver_scenario_callback_2_42(ssize_t (*)(struct pipe_inode_info *, struct file *, loff_t *, long unsigned int, unsigned int), struct pipe_inode_info *, struct file *, loff_t *, long unsigned int, unsigned int);
      59             : void ldv_character_driver_scenario_callback_2_45(long int (*)(struct file *, unsigned int, long unsigned int), struct file *, unsigned int, long unsigned int);
      60             : void ldv_character_driver_scenario_callback_2_5(ssize_t (*)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *, struct iovec *, long unsigned int, long long int);
      61             : int ldv_character_driver_scenario_probe_2_13(int (*)(struct inode *, struct file *), struct inode *, struct file *);
      62             : void ldv_character_driver_scenario_release_2_2(int (*)(struct inode *, struct file *), struct inode *, struct file *);
      63             : void ldv_character_driver_scenario_write_2_4(ssize_t (*)(struct file *, char *, long unsigned int, loff_t *), struct file *, char *, long unsigned int, loff_t *);
      64             : void ldv_random_containerless_scenario_callback_6_10(int (*)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *, struct fiemap_extent_info *, long long unsigned int, long long unsigned int);
      65             : void ldv_random_containerless_scenario_callback_6_57(void (*)(struct inode *), struct inode *);
      66             : void ldv_random_containerless_scenario_callback_7_10(int (*)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *, struct fiemap_extent_info *, long long unsigned int, long long unsigned int);
      67             : void ldv_random_containerless_scenario_callback_7_57(void (*)(struct inode *), struct inode *);
      68             : void ldv_random_containerless_scenario_callback_8_10(int (*)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *, struct fiemap_extent_info *, long long unsigned int, long long unsigned int);
      69             : void ldv_random_containerless_scenario_callback_8_57(void (*)(struct inode *), struct inode *);
      70             : void ldv_random_containerless_scenario_callback_9_10(int (*)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *, struct fiemap_extent_info *, long long unsigned int, long long unsigned int);
      71             : void ldv_random_containerless_scenario_callback_9_57(void (*)(struct inode *), struct inode *);
      72             : 
      73             : /* EMG variable declarations */
      74           1 : struct ldv_thread ldv_thread_2;
      75             : 
      76             : /* EMG variable initialization */
      77             : 
      78             : /* EMG function definitions */
      79             : /* AUX_FUNC ldv_character_driver_scenario_2 */
      80             : void ldv_character_driver_scenario_2(void *arg0) {
      81             :  /* LDV {"thread": 2, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'character_driver_scenario(file_operations)'", "function": "ldv_character_driver_scenario_2"} */
      82           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
      83             :  ssize_t (*ldv_2_callback_aio_read)(struct kiocb *, struct iovec *, long unsigned int, loff_t );
      84           1 :  ssize_t (*ldv_2_callback_aio_write)(struct kiocb *, struct iovec *, long unsigned int, loff_t );
      85             :  long int (*ldv_2_callback_compat_ioctl)(struct file *, unsigned int, long unsigned int);
      86           1 :  int (*ldv_2_callback_fsync)(struct file *, struct dentry *, int);
      87           1 :  loff_t (*ldv_2_callback_llseek)(struct file *, loff_t , int);
      88           1 :  int (*ldv_2_callback_mmap)(struct file *, struct vm_area_struct *);
      89           1 :  ssize_t (*ldv_2_callback_read)(struct file *, char *, size_t , loff_t *);
      90           1 :  int (*ldv_2_callback_readdir)(struct file *, void *, filldir_t );
      91           1 :  ssize_t (*ldv_2_callback_splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t , unsigned int);
      92             :  ssize_t (*ldv_2_callback_splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t , unsigned int);
      93             :  long int (*ldv_2_callback_unlocked_ioctl)(struct file *, unsigned int, long unsigned int);
      94           1 :  struct file_operations *ldv_2_container_file_operations;
      95             :  long long int ldv_2_ldv_param_22_3_default;
      96           1 :  unsigned int ldv_2_ldv_param_25_1_default;
      97             :  int ldv_2_ldv_param_28_2_default;
      98           1 :  long long int ldv_2_ldv_param_31_1_default;
      99           1 :  int ldv_2_ldv_param_31_2_default;
     100           1 :  char *ldv_2_ldv_param_35_1_default;
     101           1 :  long long int *ldv_2_ldv_param_35_3_default;
     102           1 :  long long int *ldv_2_ldv_param_39_1_default;
     103           1 :  unsigned int ldv_2_ldv_param_39_4_default;
     104           1 :  struct pipe_inode_info *ldv_2_ldv_param_42_0_default;
     105           1 :  long long int *ldv_2_ldv_param_42_2_default;
     106           1 :  unsigned int ldv_2_ldv_param_42_4_default;
     107           1 :  unsigned int ldv_2_ldv_param_45_1_default;
     108           1 :  char *ldv_2_ldv_param_4_1_default;
     109           1 :  long long int *ldv_2_ldv_param_4_3_default;
     110           1 :  long long int ldv_2_ldv_param_5_3_default;
     111           1 :  struct file *ldv_2_resource_file;
     112           1 :  struct inode *ldv_2_resource_inode;
     113           1 :  struct kiocb *ldv_2_resource_struct_kiocb_ptr;
     114           1 :  int ldv_2_ret_default;
     115           1 :  int (*ldv_2_size_cnt_func_1_ptr)(void *, char *, int, loff_t , u64 , unsigned int);
     116           1 :  struct dentry *ldv_2_size_cnt_struct_dentry_ptr;
     117           1 :  struct iovec *ldv_2_size_cnt_struct_iovec_ptr;
     118           1 :  struct pipe_inode_info *ldv_2_size_cnt_struct_pipe_inode_info_ptr;
     119           1 :  struct vm_area_struct *ldv_2_size_cnt_struct_vm_area_struct_ptr;
     120           1 :  long unsigned int ldv_2_size_cnt_write_size;
     121           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
     122           1 :  /* Initialize automaton variables */
     123           2 :  ldv_2_ret_default = 1;
     124           1 :  /* LDV {"action": "DEFAULT_REGISTER_1", "type": "RECEIVE_BEGIN", "comment": "Begin FILE_OPERATIONS callbacks invocations scenario."} */
     125           3 :  ldv_free(arg0);
     126           1 :  /* LDV {"action": "DEFAULT_REGISTER_1", "type": "RECEIVE_END"} */
     127           1 : 
     128           1 :  /* LDV {"action": "DEFAULT_ALLOC_1", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
     129           4 :  ldv_2_container_file_operations = ldv_xmalloc_unknown_size(0);
     130           1 :  /* LDV {"action": "DEFAULT_ALLOC_1", "type": "CONDITION_END"} */
     131           1 : 
     132           1 :  /* LDV {"action": "INIT", "type": "CONDITION_BEGIN", "comment": "Allocate memory for file and inode structures."} */
     133           4 :  ldv_2_resource_file = ldv_xmalloc(sizeof(struct file));
     134           4 :  ldv_2_resource_inode = ldv_xmalloc(sizeof(struct inode));
     135           4 :  ldv_2_resource_struct_kiocb_ptr = ldv_xmalloc_unknown_size(0);
     136           4 :  ldv_2_size_cnt_func_1_ptr = ldv_undef_int();
     137           1 :  /* LDV {"action": "INIT", "type": "CONDITION_END"} */
     138           1 : 
     139           1 :  /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Device appeared in the system."} */
     140           1 :  /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
     141           1 : 
     142             :  /* Jump to a subprocess 'main' initial state */
     143           1 :  goto ldv_main_2;
     144             :  /* End of the process */
     145             :  return;
     146           1 : 
     147             :  /* Sbprocess main */
     148             :  ldv_main_2:
     149             :  /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
     150             : 
     151           4 :  if (ldv_undef_int()) {
     152             :   /* LDV {"action": "PROBE", "type": "CALL_BEGIN", "callback": true, "comment": "Open the device file. Invoke callback open from file_operations."} */
     153             :   /* LDV {"type": "CALLBACK", "call": "ldv_2_ret_default = ((& generic_file_open))(ldv_2_resource_inode, ldv_2_resource_file);", "comment": "probe"} */
     154           2 :   ldv_2_ret_default = ldv_character_driver_scenario_probe_2_13(ldv_2_container_file_operations->open, ldv_2_resource_inode, ldv_2_resource_file);
     155             :   /* Callback post-call */
     156           2 :   ldv_2_ret_default = ldv_filter_err_code(ldv_2_ret_default);
     157             :   /* LDV {"action": "PROBE", "type": "CALL_END"} */
     158             : 
     159           4 :   if (ldv_undef_int()) {
     160             :    /* LDV {"action": "PROBE_SUCCESS", "type": "CONDITION_BEGIN", "comment": "Device file is opened successfully."} */
     161           2 :    ldv_assume(ldv_2_ret_default == 0);
     162             :    /* LDV {"action": "PROBE_SUCCESS", "type": "CONDITION_END"} */
     163             : 
     164             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Device file is opened, ready to read and write."} */
     165             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     166             : 
     167             :    /* Jump to a subprocess 'call' initial state */
     168           1 :    goto ldv_call_2;
     169             :   }
     170             :   else {
     171             :    /* LDV {"action": "PROBE_FAIL", "type": "CONDITION_BEGIN", "comment": "Failed to open devices file."} */
     172           2 :    ldv_assume(ldv_2_ret_default != 0);
     173             :    /* LDV {"action": "PROBE_FAIL", "type": "CONDITION_END"} */
     174             : 
     175             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Device appeared in the system."} */
     176             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
     177             : 
     178             :    /* Jump to a subprocess 'main' initial state */
     179           1 :    goto ldv_main_2;
     180             :   }
     181             :  }
     182             :  else {
     183             :   /* LDV {"action": "FREE", "type": "CONDITION_BEGIN", "comment": "Free memory of file and inode structures."} */
     184           2 :   ldv_free(ldv_2_resource_file);
     185           2 :   ldv_free(ldv_2_resource_inode);
     186           2 :   ldv_free(ldv_2_resource_struct_kiocb_ptr);
     187             :   /* LDV {"action": "FREE", "type": "CONDITION_END"} */
     188             : 
     189             :   /* LDV {"action": "DEFAULT_FREE_1", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
     190           2 :   ldv_free(ldv_2_container_file_operations);
     191             :   /* LDV {"action": "DEFAULT_FREE_1", "type": "CONDITION_END"} */
     192             : 
     193             :   /* LDV {"action": "DEFAULT_DEREGISTER_1", "type": "RECEIVE_BEGIN", "comment": "Finish FILE_OPERATIONS callbacks invocations scenario."} */
     194             :   /* Skip a non-replicative signal receiving */
     195             :   /* LDV {"action": "DEFAULT_DEREGISTER_1", "type": "RECEIVE_END"} */
     196             : 
     197             :   /* Exit function at a terminal state */
     198           1 :   return;
     199             :  }
     200             :  /* End of the subprocess 'main' */
     201             :  return;
     202           1 : 
     203             :  /* Sbprocess call */
     204             :  ldv_call_2:
     205             :  /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
     206             : 
     207           2 :  switch (ldv_undef_int()) {
     208           3 :   case 1: {
     209             :    /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     210           3 :    ldv_2_ldv_param_4_1_default = ldv_xmalloc_unknown_size(0);
     211           3 :    ldv_2_ldv_param_4_3_default = ldv_xmalloc_unknown_size(0);
     212             :    /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
     213             : 
     214             :    /* LDV {"action": "WRITE", "type": "CALL_BEGIN", "callback": true, "comment": "Write data to the device. Invoke callback write from file_operations."} */
     215             :    /* Callback pre-call */
     216           2 :    ldv_assume(ldv_2_size_cnt_func_1_ptr <= (INT_MAX & PAGE_CACHE_MASK));
     217             :    /* LDV {"type": "CALLBACK", "call": "((& do_sync_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);", "comment": "write"} */
     218           3 :    ldv_character_driver_scenario_write_2_4(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);
     219             :    /* LDV {"action": "WRITE", "type": "CALL_END"} */
     220             : 
     221             :    /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     222           2 :    ldv_free(ldv_2_ldv_param_4_1_default);
     223           2 :    ldv_free(ldv_2_ldv_param_4_3_default);
     224             :    /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
     225             : 
     226             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Device file is opened, ready to read and write."} */
     227             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     228             : 
     229             :    /* Jump to a subprocess 'call' initial state */
     230           1 :    goto ldv_call_2;
     231           1 :    break;
     232             :   }
     233           3 :   case 2: {
     234             :    /* LDV {"action": "RELEASE", "type": "CALL_BEGIN", "callback": true, "comment": "File structure is released. Invoke callback release from file_operations."} */
     235             :    /* LDV {"type": "CALLBACK", "call": "((& ext2_release_file))(ldv_2_resource_inode, ldv_2_resource_file);", "comment": "release"} */
     236           2 :    ldv_character_driver_scenario_release_2_2(ldv_2_container_file_operations->release, ldv_2_resource_inode, ldv_2_resource_file);
     237             :    /* LDV {"action": "RELEASE", "type": "CALL_END"} */
     238             : 
     239             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Device appeared in the system."} */
     240             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
     241             : 
     242             :    /* Jump to a subprocess 'main' initial state */
     243           1 :    goto ldv_main_2;
     244           1 :    break;
     245             :   }
     246           3 :   case 3: {
     247             :    /* LDV {"action": "PRE_CALL_5", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     248             :    /* LDV {"action": "PRE_CALL_5", "type": "CONDITION_END"} */
     249             : 
     250           2 :    switch (ldv_undef_int()) {
     251           3 :     case 1: {
     252             :      /* LDV {"action": "PRE_CALL_45", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     253             :      /* LDV {"action": "PRE_CALL_45", "type": "CONDITION_END"} */
     254             : 
     255             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback unlocked_ioctl from file_operations."} */
     256             :      /* LDV {"type": "CALLBACK", "call": "((& ext2_ioctl))(ldv_2_resource_file, ldv_2_ldv_param_45_1_default, ldv_2_size_cnt_write_size);", "comment": "callback"} */
     257           2 :      ldv_character_driver_scenario_callback_2_45(ldv_2_callback_unlocked_ioctl, ldv_2_resource_file, ldv_2_ldv_param_45_1_default, ldv_2_size_cnt_write_size);
     258             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     259             : 
     260             :      /* LDV {"action": "POST_CALL_45", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     261             :      /* LDV {"action": "POST_CALL_45", "type": "CONDITION_END"} */
     262             : 
     263           1 :      break;
     264           1 :     }
     265           3 :     case 2: {
     266             :      /* LDV {"action": "PRE_CALL_42", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     267           3 :      ldv_2_ldv_param_42_0_default = ldv_xmalloc_unknown_size(0);
     268           3 :      ldv_2_ldv_param_42_2_default = ldv_xmalloc_unknown_size(0);
     269             :      /* LDV {"action": "PRE_CALL_42", "type": "CONDITION_END"} */
     270             : 
     271             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback splice_write from file_operations."} */
     272             :      /* LDV {"type": "CALLBACK", "call": "((& generic_file_splice_write))(ldv_2_ldv_param_42_0_default, ldv_2_resource_file, ldv_2_ldv_param_42_2_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_42_4_default);", "comment": "callback"} */
     273           2 :      ldv_character_driver_scenario_callback_2_42(ldv_2_callback_splice_write, ldv_2_ldv_param_42_0_default, ldv_2_resource_file, ldv_2_ldv_param_42_2_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_42_4_default);
     274             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     275             : 
     276             :      /* LDV {"action": "POST_CALL_42", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     277           2 :      ldv_free(ldv_2_ldv_param_42_0_default);
     278           2 :      ldv_free(ldv_2_ldv_param_42_2_default);
     279             :      /* LDV {"action": "POST_CALL_42", "type": "CONDITION_END"} */
     280             : 
     281           1 :      break;
     282           1 :     }
     283           3 :     case 3: {
     284             :      /* LDV {"action": "PRE_CALL_39", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     285           3 :      ldv_2_ldv_param_39_1_default = ldv_xmalloc_unknown_size(0);
     286             :      /* LDV {"action": "PRE_CALL_39", "type": "CONDITION_END"} */
     287             : 
     288             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback splice_read from file_operations."} */
     289             :      /* LDV {"type": "CALLBACK", "call": "((& generic_file_splice_read))(ldv_2_resource_file, ldv_2_ldv_param_39_1_default, ldv_2_size_cnt_struct_pipe_inode_info_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_39_4_default);", "comment": "callback"} */
     290           2 :      ldv_character_driver_scenario_callback_2_39(ldv_2_callback_splice_read, ldv_2_resource_file, ldv_2_ldv_param_39_1_default, ldv_2_size_cnt_struct_pipe_inode_info_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_39_4_default);
     291             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     292             : 
     293             :      /* LDV {"action": "POST_CALL_39", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     294           2 :      ldv_free(ldv_2_ldv_param_39_1_default);
     295             :      /* LDV {"action": "POST_CALL_39", "type": "CONDITION_END"} */
     296             : 
     297           1 :      break;
     298           1 :     }
     299           3 :     case 4: {
     300             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback callback from FILE_OPERATIONS."} */
     301           2 :      if (ldv_2_callback_readdir) {
     302             :      /* LDV {"type": "CALLBACK", "call": "(ldv_2_callback_readdir)(ldv_2_resource_file, ldv_2_resource_inode, ldv_2_size_cnt_func_1_ptr);", "comment": "callback"} */
     303           2 :       ldv_character_driver_scenario_callback_2_38(ldv_2_callback_readdir, ldv_2_resource_file, ldv_2_resource_inode, ldv_2_size_cnt_func_1_ptr);
     304             :      }
     305             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     306             : 
     307           2 :      break;
     308           1 :     }
     309           3 :     case 5: {
     310             :      /* LDV {"action": "PRE_CALL_35", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     311           3 :      ldv_2_ldv_param_35_1_default = ldv_xmalloc_unknown_size(0);
     312           3 :      ldv_2_ldv_param_35_3_default = ldv_xmalloc_unknown_size(0);
     313             :      /* LDV {"action": "PRE_CALL_35", "type": "CONDITION_END"} */
     314             : 
     315             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback read from file_operations."} */
     316             :      /* LDV {"type": "CALLBACK", "call": "((& do_sync_read))(ldv_2_resource_file, ldv_2_ldv_param_35_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_35_3_default);", "comment": "callback"} */
     317           2 :      ldv_character_driver_scenario_callback_2_35(ldv_2_callback_read, ldv_2_resource_file, ldv_2_ldv_param_35_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_35_3_default);
     318             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     319             : 
     320             :      /* LDV {"action": "POST_CALL_35", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     321           2 :      ldv_free(ldv_2_ldv_param_35_1_default);
     322           2 :      ldv_free(ldv_2_ldv_param_35_3_default);
     323             :      /* LDV {"action": "POST_CALL_35", "type": "CONDITION_END"} */
     324             : 
     325           1 :      break;
     326           1 :     }
     327           3 :     case 6: {
     328             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback mmap from file_operations."} */
     329             :      /* LDV {"type": "CALLBACK", "call": "((& generic_file_mmap))(ldv_2_resource_file, ldv_2_size_cnt_struct_vm_area_struct_ptr);", "comment": "callback"} */
     330           2 :      ldv_character_driver_scenario_callback_2_34(ldv_2_callback_mmap, ldv_2_resource_file, ldv_2_size_cnt_struct_vm_area_struct_ptr);
     331             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     332             : 
     333           1 :      break;
     334           1 :     }
     335           3 :     case 7: {
     336             :      /* LDV {"action": "PRE_CALL_31", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     337             :      /* LDV {"action": "PRE_CALL_31", "type": "CONDITION_END"} */
     338             : 
     339             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback llseek from file_operations."} */
     340             :      /* LDV {"type": "CALLBACK", "call": "((& generic_file_llseek))(ldv_2_resource_file, ldv_2_ldv_param_31_1_default, ldv_2_ldv_param_31_2_default);", "comment": "callback"} */
     341           2 :      ldv_character_driver_scenario_callback_2_31(ldv_2_callback_llseek, ldv_2_resource_file, ldv_2_ldv_param_31_1_default, ldv_2_ldv_param_31_2_default);
     342             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     343             : 
     344             :      /* LDV {"action": "POST_CALL_31", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     345             :      /* LDV {"action": "POST_CALL_31", "type": "CONDITION_END"} */
     346             : 
     347           1 :      break;
     348           1 :     }
     349           3 :     case 8: {
     350             :      /* LDV {"action": "PRE_CALL_28", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     351             :      /* LDV {"action": "PRE_CALL_28", "type": "CONDITION_END"} */
     352             : 
     353             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback fsync from file_operations."} */
     354             :      /* LDV {"type": "CALLBACK", "call": "((& ext2_fsync))(ldv_2_resource_file, ldv_2_size_cnt_struct_dentry_ptr, ldv_2_ldv_param_28_2_default);", "comment": "callback"} */
     355           2 :      ldv_character_driver_scenario_callback_2_28(ldv_2_callback_fsync, ldv_2_resource_file, ldv_2_size_cnt_struct_dentry_ptr, ldv_2_ldv_param_28_2_default);
     356             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     357             : 
     358             :      /* LDV {"action": "POST_CALL_28", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     359             :      /* LDV {"action": "POST_CALL_28", "type": "CONDITION_END"} */
     360             : 
     361           1 :      break;
     362           1 :     }
     363           3 :     case 9: {
     364             :      /* LDV {"action": "PRE_CALL_25", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     365             :      /* LDV {"action": "PRE_CALL_25", "type": "CONDITION_END"} */
     366             : 
     367             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback compat_ioctl from file_operations."} */
     368             :      /* LDV {"type": "CALLBACK", "call": "((& ext2_compat_ioctl))(ldv_2_resource_file, ldv_2_ldv_param_25_1_default, ldv_2_size_cnt_write_size);", "comment": "callback"} */
     369           2 :      ldv_character_driver_scenario_callback_2_25(ldv_2_callback_compat_ioctl, ldv_2_resource_file, ldv_2_ldv_param_25_1_default, ldv_2_size_cnt_write_size);
     370             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     371             : 
     372             :      /* LDV {"action": "POST_CALL_25", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     373             :      /* LDV {"action": "POST_CALL_25", "type": "CONDITION_END"} */
     374             : 
     375           1 :      break;
     376           1 :     }
     377           3 :     case 10: {
     378             :      /* LDV {"action": "PRE_CALL_22", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     379             :      /* LDV {"action": "PRE_CALL_22", "type": "CONDITION_END"} */
     380             : 
     381             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback aio_write from file_operations."} */
     382             :      /* LDV {"type": "CALLBACK", "call": "((& generic_file_aio_write))(ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_22_3_default);", "comment": "callback"} */
     383           2 :      ldv_character_driver_scenario_callback_2_22(ldv_2_callback_aio_write, ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_22_3_default);
     384             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     385             : 
     386             :      /* LDV {"action": "POST_CALL_22", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     387             :      /* LDV {"action": "POST_CALL_22", "type": "CONDITION_END"} */
     388             : 
     389           1 :      break;
     390           1 :     }
     391           3 :     case 11: {
     392             :      /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback aio_read from file_operations."} */
     393             :      /* LDV {"type": "CALLBACK", "call": "((& generic_file_aio_read))(ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_5_3_default);", "comment": "callback"} */
     394           2 :      ldv_character_driver_scenario_callback_2_5(ldv_2_callback_aio_read, ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_5_3_default);
     395             :      /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     396             : 
     397           1 :      break;
     398           1 :     }
     399           2 :     default: ldv_stop();
     400           1 :    }
     401          12 :    break;
     402           1 :   }
     403           2 :   default: ldv_stop();
     404           1 :  }
     405           0 :  /* LDV {"action": "POST_CALL_5", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     406             :  /* LDV {"action": "POST_CALL_5", "type": "CONDITION_END"} */
     407           0 : 
     408             :  /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Device file is opened, ready to read and write."} */
     409             :  /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     410             : 
     411             :  /* Jump to a subprocess 'call' initial state */
     412          12 :  goto ldv_call_2;
     413             :  /* Jump to a subprocess 'call' initial state */
     414             :  goto ldv_call_2;
     415             :  /* End of the subprocess 'call' */
     416             :  return;
     417             :  /* LDV {"comment": "End of control function based on process 'character_driver_scenario(file_operations)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_character_driver_scenario_2"} */
     418             : }
     419             : 
     420             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_1_25 */
     421             : void ldv_character_driver_scenario_callback_1_25(long int (*arg0)(struct file *, unsigned int, long unsigned int), struct file *arg1, unsigned int arg2, long unsigned int arg3) {
     422           3 :  ((& ext2_compat_ioctl))(arg1, arg2, arg3);
     423           1 : }
     424             : 
     425             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_1_28 */
     426             : void ldv_character_driver_scenario_callback_1_28(int (*arg0)(struct file *, struct dentry *, int), struct file *arg1, struct dentry *arg2, int arg3) {
     427           4 :  ((& ext2_fsync))(arg1, arg2, arg3);
     428           1 : }
     429             : 
     430             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_1_31 */
     431             : void ldv_character_driver_scenario_callback_1_31(loff_t (*arg0)(struct file *, loff_t , int), struct file *arg1, long long int arg2, int arg3) {
     432           1 :  ((& generic_file_llseek))(arg1, arg2, arg3);
     433           1 : }
     434             : 
     435             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_1_45 */
     436             : void ldv_character_driver_scenario_callback_1_45(long int (*arg0)(struct file *, unsigned int, long unsigned int), struct file *arg1, unsigned int arg2, long unsigned int arg3) {
     437          17 :  ((& ext2_ioctl))(arg1, arg2, arg3);
     438           1 : }
     439             : 
     440             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_22 */
     441             : void ldv_character_driver_scenario_callback_2_22(ssize_t (*arg0)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *arg1, struct iovec *arg2, long unsigned int arg3, long long int arg4) {
     442           1 :  ((& generic_file_aio_write))(arg1, arg2, arg3, arg4);
     443           1 : }
     444             : 
     445             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_25 */
     446             : void ldv_character_driver_scenario_callback_2_25(long int (*arg0)(struct file *, unsigned int, long unsigned int), struct file *arg1, unsigned int arg2, long unsigned int arg3) {
     447           3 :  ((& ext2_compat_ioctl))(arg1, arg2, arg3);
     448           1 : }
     449             : 
     450             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_28 */
     451             : void ldv_character_driver_scenario_callback_2_28(int (*arg0)(struct file *, struct dentry *, int), struct file *arg1, struct dentry *arg2, int arg3) {
     452           4 :  ((& ext2_fsync))(arg1, arg2, arg3);
     453           1 : }
     454             : 
     455             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_31 */
     456             : void ldv_character_driver_scenario_callback_2_31(loff_t (*arg0)(struct file *, loff_t , int), struct file *arg1, long long int arg2, int arg3) {
     457           1 :  ((& generic_file_llseek))(arg1, arg2, arg3);
     458           1 : }
     459             : 
     460             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_34 */
     461             : void ldv_character_driver_scenario_callback_2_34(int (*arg0)(struct file *, struct vm_area_struct *), struct file *arg1, struct vm_area_struct *arg2) {
     462           1 :  ((& generic_file_mmap))(arg1, arg2);
     463           1 : }
     464             : 
     465             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_35 */
     466             : void ldv_character_driver_scenario_callback_2_35(ssize_t (*arg0)(struct file *, char *, long unsigned int, loff_t *), struct file *arg1, char *arg2, long unsigned int arg3, long long int *arg4) {
     467           1 :  ((& do_sync_read))(arg1, arg2, arg3, arg4);
     468           1 : }
     469             : 
     470             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_39 */
     471             : void ldv_character_driver_scenario_callback_2_39(ssize_t (*arg0)(struct file *, loff_t *, struct pipe_inode_info *, long unsigned int, unsigned int), struct file *arg1, long long int *arg2, struct pipe_inode_info *arg3, long unsigned int arg4, unsigned int arg5) {
     472           1 :  ((& generic_file_splice_read))(arg1, arg2, arg3, arg4, arg5);
     473           1 : }
     474             : 
     475             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_42 */
     476             : void ldv_character_driver_scenario_callback_2_42(ssize_t (*arg0)(struct pipe_inode_info *, struct file *, loff_t *, long unsigned int, unsigned int), struct pipe_inode_info *arg1, struct file *arg2, long long int *arg3, long unsigned int arg4, unsigned int arg5) {
     477           1 :  ((& generic_file_splice_write))(arg1, arg2, arg3, arg4, arg5);
     478           1 : }
     479             : 
     480             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_45 */
     481             : void ldv_character_driver_scenario_callback_2_45(long int (*arg0)(struct file *, unsigned int, long unsigned int), struct file *arg1, unsigned int arg2, long unsigned int arg3) {
     482          17 :  ((& ext2_ioctl))(arg1, arg2, arg3);
     483           1 : }
     484             : 
     485             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_5 */
     486             : void ldv_character_driver_scenario_callback_2_5(ssize_t (*arg0)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *arg1, struct iovec *arg2, long unsigned int arg3, long long int arg4) {
     487           1 :  ((& generic_file_aio_read))(arg1, arg2, arg3, arg4);
     488           1 : }
     489             : 
     490             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_probe_2_13 */
     491             : int ldv_character_driver_scenario_probe_2_13(int (*arg0)(struct inode *, struct file *), struct inode *arg1, struct file *arg2) {
     492           2 :  return ((& generic_file_open))(arg1, arg2);
     493             : }
     494           1 : 
     495             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_release_2_2 */
     496             : void ldv_character_driver_scenario_release_2_2(int (*arg0)(struct inode *, struct file *), struct inode *arg1, struct file *arg2) {
     497           3 :  ((& ext2_release_file))(arg1, arg2);
     498           1 : }
     499             : 
     500             : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_write_2_4 */
     501             : void ldv_character_driver_scenario_write_2_4(ssize_t (*arg0)(struct file *, char *, long unsigned int, loff_t *), struct file *arg1, char *arg2, long unsigned int arg3, long long int *arg4) {
     502           1 :  ((& do_sync_write))(arg1, arg2, arg3, arg4);
     503           1 : }
     504             : 
     505             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_6_10 */
     506             : void ldv_random_containerless_scenario_callback_6_10(int (*arg0)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *arg1, struct fiemap_extent_info *arg2, long long unsigned int arg3, long long unsigned int arg4) {
     507           2 :  ((& ext2_fiemap))(arg1, arg2, arg3, arg4);
     508           1 : }
     509             : 
     510             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_6_57 */
     511             : void ldv_random_containerless_scenario_callback_6_57(void (*arg0)(struct inode *), struct inode *arg1) {
     512           6 :  ((& ext2_truncate))(arg1);
     513           1 : }
     514             : 
     515             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_7_10 */
     516             : void ldv_random_containerless_scenario_callback_7_10(int (*arg0)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *arg1, struct fiemap_extent_info *arg2, long long unsigned int arg3, long long unsigned int arg4) {
     517           2 :  ((& ext2_fiemap))(arg1, arg2, arg3, arg4);
     518           1 : }
     519             : 
     520             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_7_57 */
     521             : void ldv_random_containerless_scenario_callback_7_57(void (*arg0)(struct inode *), struct inode *arg1) {
     522           6 :  ((& ext2_truncate))(arg1);
     523           1 : }
     524             : 
     525             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_8_10 */
     526             : void ldv_random_containerless_scenario_callback_8_10(int (*arg0)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *arg1, struct fiemap_extent_info *arg2, long long unsigned int arg3, long long unsigned int arg4) {
     527           2 :  ((& ext2_fiemap))(arg1, arg2, arg3, arg4);
     528           1 : }
     529             : 
     530             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_8_57 */
     531             : void ldv_random_containerless_scenario_callback_8_57(void (*arg0)(struct inode *), struct inode *arg1) {
     532           6 :  ((& ext2_truncate))(arg1);
     533           1 : }
     534             : 
     535             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_9_10 */
     536             : void ldv_random_containerless_scenario_callback_9_10(int (*arg0)(struct inode *, struct fiemap_extent_info *, u64 , u64 ), struct inode *arg1, struct fiemap_extent_info *arg2, long long unsigned int arg3, long long unsigned int arg4) {
     537           2 :  ((& ext2_fiemap))(arg1, arg2, arg3, arg4);
     538           1 : }
     539             : 
     540             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_9_57 */
     541             : void ldv_random_containerless_scenario_callback_9_57(void (*arg0)(struct inode *), struct inode *arg1) {
     542           6 :  ((& ext2_truncate))(arg1);
     543           1 : }
     544             : 
     545             : 
     546             : /* AUX_FUNC  ERR_PTR */
     547             : static inline void *ERR_PTR (long int error)
     548             : {
     549             : 
     550             :  return ldv_err_ptr(error);
     551             : }
     552             : 
     553             : /* AUX_FUNC  PTR_ERR */
     554             : static inline long int PTR_ERR (void const *ptr)
     555             : {
     556             : 
     557             :  return ldv_ptr_err(ptr);
     558             : }
     559             : 
     560             : /* AUX_FUNC  IS_ERR */
     561             : static inline long int IS_ERR (void const *ptr)
     562             : {
     563             : 
     564             :  return ldv_is_err(ptr);
     565             : }
     566             : 
     567             : /* AUX_FUNC  IS_ERR_OR_NULL */
     568             : static inline long int IS_ERR_OR_NULL (void const *ptr)
     569             : {
     570             : 
     571             :  return ldv_is_err_or_null(ptr);
     572             : }
     573             : 
     574             : /* AUX_FUNC  kzalloc */
     575             : static inline void *kzalloc (size_t size, gfp_t flags)
     576             : {
     577             : 
     578             :  return ldv_kzalloc(size, flags);
     579             : }

Generated by: LCOV version 1.10