Advertisement
Guest User

Ext4 data races - Misc

a guest
Apr 8th, 2014
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 21.32 KB | None | 0 0
  1.  
  2. ====================================================================================================================================================================================
  3. Variable: mapping->nrpages  Addresses: c107d9f3 c110c8d7
  4. c107d9f3 add_to_page_cache_locked /linux-3.13.5/mm/filemap.c:487
  5. c110c8d7 ext4_writepages /linux-3.13.5/fs/ext4/inode.c:2413
  6.  
  7. c110c8d7 <-> c107d9f3
  8. c110c8d7 <-> c107d9f3
  9.  
  10. /linux-3.13.5/mm/filemap.c:487
  11.        477 
  12.        478      page_cache_get(page);
  13.        479      page->mapping = mapping;
  14.        480      page->index = offset;
  15.        481 
  16.        482      spin_lock_irq(&mapping->tree_lock);
  17.        483      error = radix_tree_insert(&mapping->page_tree, offset, page);
  18.        484      radix_tree_preload_end();
  19.        485      if (unlikely(error))
  20.        486          goto err_insert;
  21. ==>    487      mapping->nrpages++;      
  22.        488      __inc_zone_page_state(page, NR_FILE_PAGES);
  23.        489      spin_unlock_irq(&mapping->tree_lock);
  24.        490      trace_mm_filemap_add_to_page_cache(page);
  25.        491      return 0;
  26.        492  err_insert:
  27.        493      page->mapping = NULL;
  28.        494      /* Leave page->index set: truncation relies upon it */
  29.        495      spin_unlock_irq(&mapping->tree_lock);
  30.        496      mem_cgroup_uncharge_cache_page(page);
  31.        497      page_cache_release(page);
  32.  
  33. /linux-3.13.5/fs/ext4/inode.c:2413
  34.       2403      struct blk_plug plug;
  35.       2404      bool give_up_on_write = false;
  36.       2405 
  37.       2406      trace_ext4_writepages(inode, wbc);
  38.       2407 
  39.       2408      /*
  40.       2409       * No pages to write? This is mainly a kludge to avoid starting
  41.       2410       * a transaction for special inodes like journal inode on last iput()
  42.       2411       * because that could violate lock ordering on umount
  43.       2412       */
  44. ==>   2413      if (!mapping->nrpages || !mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))      
  45.       2414          goto out_writepages;
  46.       2415 
  47.       2416      if (ext4_should_journal_data(inode)) {
  48.       2417          struct blk_plug plug;
  49.       2418 
  50.       2419          blk_start_plug(&plug);
  51.       2420          ret = write_cache_pages(mapping, wbc, __writepage, mapping);
  52.       2421          blk_finish_plug(&plug);
  53.       2422          goto out_writepages;
  54.       2423      }
  55.  
  56.  
  57. ====================================================================================================================================================================================
  58. Variable: raw_inode->i_size_lo  Addresses: c110abf0 c110abdb
  59. c110abf0 ext4_isize_set /linux-3.13.5/fs/ext4/ext4.h:2395
  60. c110abdb ext4_isize /linux-3.13.5/fs/ext4/ext4.h:2387
  61.  
  62. c110abf0 <-> c110abdb
  63. c110abf0 <-> c110abdb
  64.  
  65. /linux-3.13.5/fs/ext4/ext4.h:2395
  66.       2385  {
  67.       2386      if (S_ISREG(le16_to_cpu(raw_inode->i_mode)))
  68.       2387          return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |
  69.       2388              le32_to_cpu(raw_inode->i_size_lo);
  70.       2389      else
  71.       2390          return (loff_t) le32_to_cpu(raw_inode->i_size_lo);
  72.       2391  }
  73.       2392 
  74.       2393  static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
  75.       2394  {
  76. ==>   2395      raw_inode->i_size_lo = cpu_to_le32(i_size);      
  77.       2396      raw_inode->i_size_high = cpu_to_le32(i_size >> 32);
  78.       2397  }
  79.       2398 
  80.       2399  static inline
  81.       2400  struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
  82.       2401                          ext4_group_t group)
  83.       2402  {
  84.       2403       struct ext4_group_info ***grp_info;
  85.       2404       long indexv, indexh;
  86.       2405       BUG_ON(group >= EXT4_SB(sb)->s_groups_count);
  87.  
  88. /linux-3.13.5/fs/ext4/ext4.h:2387
  89.       2377  static inline void ext4_r_blocks_count_set(struct ext4_super_block *es,
  90.       2378                         ext4_fsblk_t blk)
  91.       2379  {
  92.       2380      es->s_r_blocks_count_lo = cpu_to_le32((u32)blk);
  93.       2381      es->s_r_blocks_count_hi = cpu_to_le32(blk >> 32);
  94.       2382  }
  95.       2383 
  96.       2384  static inline loff_t ext4_isize(struct ext4_inode *raw_inode)
  97.       2385  {
  98.       2386      if (S_ISREG(le16_to_cpu(raw_inode->i_mode)))
  99. ==>   2387          return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |      
  100.       2388              le32_to_cpu(raw_inode->i_size_lo);
  101.       2389      else
  102.       2390          return (loff_t) le32_to_cpu(raw_inode->i_size_lo);
  103.       2391  }
  104.       2392 
  105.       2393  static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
  106.       2394  {
  107.       2395      raw_inode->i_size_lo = cpu_to_le32(i_size);
  108.       2396      raw_inode->i_size_high = cpu_to_le32(i_size >> 32);
  109.       2397  }
  110.  
  111.  
  112. ====================================================================================================================================================================================
  113. Variable: mapping->writeback_index  Addresses: c108320f
  114. c108320f write_cache_pages /linux-3.13.5/mm/page-writeback.c:2012
  115.  
  116. c108320f <-> c108320f
  117.  
  118. /linux-3.13.5/mm/page-writeback.c:2012
  119.       2002           * range_cyclic:
  120.       2003           * We hit the last page and there is more work to be done: wrap
  121.       2004           * back to the start of the file
  122.       2005           */
  123.       2006          cycled = 1;
  124.       2007          index = 0;
  125.       2008          end = writeback_index - 1;
  126.       2009          goto retry;
  127.       2010      }
  128.       2011      if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
  129. ==>   2012          mapping->writeback_index = done_index;      
  130.       2013 
  131.       2014      return ret;
  132.       2015  }
  133.       2016  EXPORT_SYMBOL(write_cache_pages);
  134.       2017 
  135.       2018  /*
  136.       2019   * Function used by generic_writepages to call the real writepage
  137.       2020   * function and set the mapping flags on error
  138.       2021   */
  139.       2022  static int __writepage(struct page *page, struct writeback_control *wbc,
  140.  
  141.  
  142. ====================================================================================================================================================================================
  143. Variable: ei->i_datasync_tid    Addresses: c110adb3
  144. c110adb3 ext4_update_inode_fsync_trans /linux-3.13.5/fs/ext4/ext4_jbd2.h:384
  145.  
  146. c110adb3 <-> c110adb3
  147.  
  148. /linux-3.13.5/fs/ext4/ext4_jbd2.h:384
  149.        374 
  150.        375  static inline void ext4_update_inode_fsync_trans(handle_t *handle,
  151.        376                           struct inode *inode,
  152.        377                           int datasync)
  153.        378  {
  154.        379      struct ext4_inode_info *ei = EXT4_I(inode);
  155.        380 
  156.        381      if (ext4_handle_valid(handle)) {
  157.        382          ei->i_sync_tid = handle->h_transaction->t_tid;
  158.        383          if (datasync)
  159. ==>    384              ei->i_datasync_tid = handle->h_transaction->t_tid;      
  160.        385      }
  161.        386  }
  162.        387 
  163.        388  /* super.c */
  164.        389  int ext4_force_commit(struct super_block *sb);
  165.        390 
  166.        391  /*
  167.        392   * Ext4 inode journal modes
  168.        393   */
  169.        394  #define EXT4_INODE_JOURNAL_DATA_MODE    0x01 /* journal data mode */
  170.  
  171.  
  172. ====================================================================================================================================================================================
  173. Variable: ei->i_sync_tid    Addresses: c112ae80 c110ae6f
  174. c112ae80 ext4_update_inode_fsync_trans /linux-3.13.5/fs/ext4/ext4_jbd2.h:382
  175. c110ae6f ext4_update_inode_fsync_trans /linux-3.13.5/fs/ext4/ext4_jbd2.h:382
  176.  
  177. c112ae80 <-> c110ae6f
  178. c110ae6f <-> c110ae6f
  179.  
  180. /linux-3.13.5/fs/ext4/ext4_jbd2.h:382
  181.        372      return 0;
  182.        373  }
  183.        374 
  184.        375  static inline void ext4_update_inode_fsync_trans(handle_t *handle,
  185.        376                           struct inode *inode,
  186.        377                           int datasync)
  187.        378  {
  188.        379      struct ext4_inode_info *ei = EXT4_I(inode);
  189.        380 
  190.        381      if (ext4_handle_valid(handle)) {
  191. ==>    382          ei->i_sync_tid = handle->h_transaction->t_tid;      
  192.        383          if (datasync)
  193.        384              ei->i_datasync_tid = handle->h_transaction->t_tid;
  194.        385      }
  195.        386  }
  196.        387 
  197.        388  /* super.c */
  198.        389  int ext4_force_commit(struct super_block *sb);
  199.        390 
  200.        391  /*
  201.        392   * Ext4 inode journal modes
  202.  
  203. /linux-3.13.5/fs/ext4/ext4_jbd2.h:382
  204.        372      return 0;
  205.        373  }
  206.        374 
  207.        375  static inline void ext4_update_inode_fsync_trans(handle_t *handle,
  208.        376                           struct inode *inode,
  209.        377                           int datasync)
  210.        378  {
  211.        379      struct ext4_inode_info *ei = EXT4_I(inode);
  212.        380 
  213.        381      if (ext4_handle_valid(handle)) {
  214. ==>    382          ei->i_sync_tid = handle->h_transaction->t_tid;      
  215.        383          if (datasync)
  216.        384              ei->i_datasync_tid = handle->h_transaction->t_tid;
  217.        385      }
  218.        386  }
  219.        387 
  220.        388  /* super.c */
  221.        389  int ext4_force_commit(struct super_block *sb);
  222.        390 
  223.        391  /*
  224.        392   * Ext4 inode journal modes
  225.  
  226.  
  227. ====================================================================================================================================================================================
  228. Variable: kaddr/link    Addresses: c10ade1a c12d40eb
  229. c10ade1a generic_readlinkat()->page_follow_link_light()->page_getlink()->nd_terminate_link /linux-3.13.5/include/linux/namei.h:98
  230. c12d40eb generic_readlinkat()->vfs_readlink()->strlen /linux-3.13.5/arch/x86/lib/string_32.c:168
  231.  
  232. c10ade1a <-> c12d40eb
  233. c10ade1a <-> c12d40eb
  234.  
  235. /linux-3.13.5/include/linux/namei.h:98
  236.         88      nd->saved_names[nd->depth] = path;
  237.         89  }
  238.         90 
  239.         91  static inline char *nd_get_link(struct nameidata *nd)
  240.         92  {
  241.         93      return nd->saved_names[nd->depth];
  242.         94  }
  243.         95 
  244.         96  static inline void nd_terminate_link(void *name, size_t len, size_t maxlen)
  245.         97  {
  246. ==>     98      ((char *) name)[min(len, maxlen)] = '\0';      
  247.         99  }
  248.        100 
  249.        101  /**
  250.        102   * retry_estale - determine whether the caller should retry an operation
  251.        103   * @error: the error that would currently be returned
  252.        104   * @flags: flags being used for next lookup attempt
  253.        105   *
  254.        106   * Check to see if the error code was -ESTALE, and then determine whether
  255.        107   * to retry the call based on whether "flags" already has LOOKUP_REVAL set.
  256.        108   *
  257.  
  258. /linux-3.13.5/arch/x86/lib/string_32.c:168
  259.        158      return res;
  260.        159  }
  261.        160  EXPORT_SYMBOL(strchr);
  262.        161  #endif
  263.        162 
  264.        163  #ifdef __HAVE_ARCH_STRLEN
  265.        164  size_t strlen(const char *s)
  266.        165  {
  267.        166      int d0;
  268.        167      size_t res;
  269. ==>    168      asm volatile("repne\n\t"      
  270.        169          "scasb"
  271.        170          : "=c" (res), "=&D" (d0)
  272.        171          : "1" (s), "a" (0), "0" (0xffffffffu)
  273.        172          : "memory");
  274.        173      return ~res - 1;
  275.        174  }
  276.        175  EXPORT_SYMBOL(strlen);
  277.        176  #endif
  278.        177 
  279.        178  #ifdef __HAVE_ARCH_MEMCHR
  280.  
  281.  
  282. ====================================================================================================================================================================================
  283. Variable: journal->j_running_transaction    Addresses: c1138ca1 c1136b02 c1136ca9
  284. c1136ca9 jbd2_get_transaction /linux-3.13.5/fs/jbd2/transaction.c:103
  285. c1138ca1 jbd2_journal_commit_transaction /linux-3.13.5/fs/jbd2/commit.c:539
  286. c1136b02 start_this_handle /linux-3.13.5/fs/jbd2/transaction.c:280
  287.  
  288. c1136ca9 <-> c1136b02
  289. c1138ca1 <-> c1136b02
  290. c1136ca9 <-> c1136b02
  291.  
  292. /linux-3.13.5/fs/jbd2/transaction.c:103
  293.         93             atomic_read(&journal->j_reserved_credits));
  294.         94      atomic_set(&transaction->t_handle_count, 0);
  295.         95      INIT_LIST_HEAD(&transaction->t_inode_list);
  296.         96      INIT_LIST_HEAD(&transaction->t_private_list);
  297.         97 
  298.         98      /* Set up the commit timer for the new transaction. */
  299.         99      journal->j_commit_timer.expires = round_jiffies_up(transaction->t_expires);
  300.        100      add_timer(&journal->j_commit_timer);
  301.        101 
  302.        102      J_ASSERT(journal->j_running_transaction == NULL);
  303. ==>    103      journal->j_running_transaction = transaction;      
  304.        104      transaction->t_max_wait = 0;
  305.        105      transaction->t_start = jiffies;
  306.        106      transaction->t_requested = 0;
  307.        107 
  308.        108      return transaction;
  309.        109  }
  310.        110 
  311.        111  /*
  312.        112   * Handle management.
  313.        113   *
  314.  
  315. /linux-3.13.5/fs/jbd2/commit.c:539
  316.        529      atomic_sub(atomic_read(&journal->j_reserved_credits),
  317.        530             &commit_transaction->t_outstanding_credits);
  318.        531 
  319.        532      trace_jbd2_commit_flushing(journal, commit_transaction);
  320.        533      stats.run.rs_flushing = jiffies;
  321.        534      stats.run.rs_locked = jbd2_time_diff(stats.run.rs_locked,
  322.        535                           stats.run.rs_flushing);
  323.        536 
  324.        537      commit_transaction->t_state = T_FLUSH;
  325.        538      journal->j_committing_transaction = commit_transaction;
  326. ==>    539      journal->j_running_transaction = NULL;      
  327.        540      start_time = ktime_get();
  328.        541      commit_transaction->t_log_start = journal->j_head;
  329.        542      wake_up(&journal->j_wait_transaction_locked);
  330.        543      write_unlock(&journal->j_state_lock);
  331.        544 
  332.        545      jbd_debug(3, "JBD2: commit phase 2a\n");
  333.        546 
  334.        547      /*
  335.        548       * Now start flushing things to disk, in the order they appear
  336.        549       * on the transaction lists.  Data blocks go first.
  337.  
  338. /linux-3.13.5/fs/jbd2/transaction.c:280
  339.        270          printk(KERN_ERR "JBD2: %s wants too many credits (%d > %d)\n",
  340.        271                 current->comm, blocks,
  341.        272                 journal->j_max_transaction_buffers / 2);
  342.        273          return -ENOSPC;
  343.        274      }
  344.        275 
  345.        276      if (handle->h_rsv_handle)
  346.        277          rsv_blocks = handle->h_rsv_handle->h_buffer_credits;
  347.        278 
  348.        279  alloc_transaction:
  349. ==>    280      if (!journal->j_running_transaction) {      
  350.        281          new_transaction = kmem_cache_zalloc(transaction_cache,
  351.        282                              gfp_mask);
  352.        283          if (!new_transaction) {
  353.        284              /*
  354.        285               * If __GFP_FS is not present, then we may be
  355.        286               * being called from inside the fs writeback
  356.        287               * layer, so we MUST NOT fail.  Since
  357.        288               * __GFP_NOFAIL is going away, we will arrange
  358.        289               * to retry the allocation ourselves.
  359.        290               */
  360.  
  361.  
  362. ====================================================================================================================================================================================
  363. Variable: inode->i_state    Addresses: c10c035e c10c03cb c10c0352 c10c093a c10bffe2
  364. c10c0352 __writeback_single_inode /linux-3.13.5/fs/fs-writeback.c:473
  365. c10bffe2 inode_sync_complete /linux-3.13.5/fs/fs-writeback.c:217
  366. c10c035e __writeback_single_inode /linux-3.13.5/fs/fs-writeback.c:475
  367. c10c093a writeback_sb_inodes /linux-3.13.5/fs/fs-writeback.c:666
  368. c10c03cb __mark_inode_dirty /linux-3.13.5/fs/fs-writeback.c:1149
  369.  
  370. c10c0352 <-> c10c03cb
  371. c10bffe2 <-> c10c03cb
  372. c10c03cb <-> c10c035e
  373. c10c093a <-> c10c03cb
  374. c10c03cb <-> c10c035e
  375.  
  376. /linux-3.13.5/fs/fs-writeback.c:473
  377.        463      }
  378.        464 
  379.        465      /*
  380.        466       * Some filesystems may redirty the inode during the writeback
  381.        467       * due to delalloc, clear dirty metadata flags right before
  382.        468       * write_inode()
  383.        469       */
  384.        470      spin_lock(&inode->i_lock);
  385.        471      /* Clear I_DIRTY_PAGES if we've written out all dirty pages */
  386.        472      if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
  387. ==>    473          inode->i_state &= ~I_DIRTY_PAGES;      
  388.        474      dirty = inode->i_state & I_DIRTY;
  389.        475      inode->i_state &= ~(I_DIRTY_SYNC | I_DIRTY_DATASYNC);
  390.        476      spin_unlock(&inode->i_lock);
  391.        477      /* Don't write the inode if only I_DIRTY_PAGES was set */
  392.        478      if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
  393.        479          int err = write_inode(inode, wbc);
  394.        480          if (ret == 0)
  395.        481              ret = err;
  396.        482      }
  397.        483      trace_writeback_single_inode(inode, wbc, nr_to_write);
  398.  
  399. /linux-3.13.5/fs/fs-writeback.c:217
  400.        207   * requeue inode for re-scanning after bdi->b_io list is exhausted.
  401.        208   */
  402.        209  static void requeue_io(struct inode *inode, struct bdi_writeback *wb)
  403.        210  {
  404.        211      assert_spin_locked(&wb->list_lock);
  405.        212      list_move(&inode->i_wb_list, &wb->b_more_io);
  406.        213  }
  407.        214 
  408.        215  static void inode_sync_complete(struct inode *inode)
  409.        216  {
  410. ==>    217      inode->i_state &= ~I_SYNC;      
  411.        218      /* If inode is clean an unused, put it into LRU now... */
  412.        219      inode_add_lru(inode);
  413.        220      /* Waiters must see I_SYNC cleared before being woken up */
  414.        221      smp_mb();
  415.        222      wake_up_bit(&inode->i_state, __I_SYNC);
  416.        223  }
  417.        224 
  418.        225  static bool inode_dirtied_after(struct inode *inode, unsigned long t)
  419.        226  {
  420.        227      bool ret = time_after(inode->dirtied_when, t);
  421.  
  422. /linux-3.13.5/fs/fs-writeback.c:475
  423.        465      /*
  424.        466       * Some filesystems may redirty the inode during the writeback
  425.        467       * due to delalloc, clear dirty metadata flags right before
  426.        468       * write_inode()
  427.        469       */
  428.        470      spin_lock(&inode->i_lock);
  429.        471      /* Clear I_DIRTY_PAGES if we've written out all dirty pages */
  430.        472      if (!mapping_tagged(mapping, PAGECACHE_TAG_DIRTY))
  431.        473          inode->i_state &= ~I_DIRTY_PAGES;
  432.        474      dirty = inode->i_state & I_DIRTY;
  433. ==>    475      inode->i_state &= ~(I_DIRTY_SYNC | I_DIRTY_DATASYNC);      
  434.        476      spin_unlock(&inode->i_lock);
  435.        477      /* Don't write the inode if only I_DIRTY_PAGES was set */
  436.        478      if (dirty & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
  437.        479          int err = write_inode(inode, wbc);
  438.        480          if (ret == 0)
  439.        481              ret = err;
  440.        482      }
  441.        483      trace_writeback_single_inode(inode, wbc, nr_to_write);
  442.        484      return ret;
  443.        485  }
  444.  
  445. /linux-3.13.5/fs/fs-writeback.c:666
  446.        656           * are doing WB_SYNC_NONE writeback. So this catches only the
  447.        657           * WB_SYNC_ALL case.
  448.        658           */
  449.        659          if (inode->i_state & I_SYNC) {
  450.        660              /* Wait for I_SYNC. This function drops i_lock... */
  451.        661              inode_sleep_on_writeback(inode);
  452.        662              /* Inode may be gone, start again */
  453.        663              spin_lock(&wb->list_lock);
  454.        664              continue;
  455.        665          }
  456. ==>    666          inode->i_state |= I_SYNC;      
  457.        667          spin_unlock(&inode->i_lock);
  458.        668 
  459.        669          write_chunk = writeback_chunk_size(wb->bdi, work);
  460.        670          wbc.nr_to_write = write_chunk;
  461.        671          wbc.pages_skipped = 0;
  462.        672 
  463.        673          /*
  464.        674           * We use I_SYNC to pin the inode in memory. While it is set
  465.        675           * evict_inode() will wait so the inode cannot be freed.
  466.        676           */
  467.  
  468. /linux-3.13.5/fs/fs-writeback.c:1149
  469.       1139          trace_writeback_dirty_inode(inode, flags);
  470.       1140      }
  471.       1141 
  472.       1142      /*
  473.       1143       * make sure that changes are seen by all cpus before we test i_state
  474.       1144       * -- mikulas
  475.       1145       */
  476.       1146      smp_mb();
  477.       1147 
  478.       1148      /* avoid the locking if we can */
  479. ==>   1149      if ((inode->i_state & flags) == flags)      
  480.       1150          return;
  481.       1151 
  482.       1152      if (unlikely(block_dump))
  483.       1153          block_dump___mark_inode_dirty(inode);
  484.       1154 
  485.       1155      spin_lock(&inode->i_lock);
  486.       1156      if ((inode->i_state & flags) != flags) {
  487.       1157          const int was_dirty = inode->i_state & I_DIRTY;
  488.       1158 
  489.       1159          inode->i_state |= flags;
  490.  
  491.  
  492. ====================================================================================================================================================================================
  493. Variable: raw_inode->i_size_high    Addresses: c110abf3 c110abde
  494. c110abde ext4_isize /linux-3.13.5/fs/ext4/ext4.h:2387
  495. c110abf3 ext4_isize_set /linux-3.13.5/fs/ext4/ext4.h:2396
  496.  
  497. c110abde <-> c110abf3
  498. c110abde <-> c110abf3
  499.  
  500. /linux-3.13.5/fs/ext4/ext4.h:2387
  501.       2377  static inline void ext4_r_blocks_count_set(struct ext4_super_block *es,
  502.       2378                         ext4_fsblk_t blk)
  503.       2379  {
  504.       2380      es->s_r_blocks_count_lo = cpu_to_le32((u32)blk);
  505.       2381      es->s_r_blocks_count_hi = cpu_to_le32(blk >> 32);
  506.       2382  }
  507.       2383 
  508.       2384  static inline loff_t ext4_isize(struct ext4_inode *raw_inode)
  509.       2385  {
  510.       2386      if (S_ISREG(le16_to_cpu(raw_inode->i_mode)))
  511. ==>   2387          return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |      
  512.       2388              le32_to_cpu(raw_inode->i_size_lo);
  513.       2389      else
  514.       2390          return (loff_t) le32_to_cpu(raw_inode->i_size_lo);
  515.       2391  }
  516.       2392 
  517.       2393  static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
  518.       2394  {
  519.       2395      raw_inode->i_size_lo = cpu_to_le32(i_size);
  520.       2396      raw_inode->i_size_high = cpu_to_le32(i_size >> 32);
  521.       2397  }
  522.  
  523. /linux-3.13.5/fs/ext4/ext4.h:2396
  524.       2386      if (S_ISREG(le16_to_cpu(raw_inode->i_mode)))
  525.       2387          return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |
  526.       2388              le32_to_cpu(raw_inode->i_size_lo);
  527.       2389      else
  528.       2390          return (loff_t) le32_to_cpu(raw_inode->i_size_lo);
  529.       2391  }
  530.       2392 
  531.       2393  static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
  532.       2394  {
  533.       2395      raw_inode->i_size_lo = cpu_to_le32(i_size);
  534. ==>   2396      raw_inode->i_size_high = cpu_to_le32(i_size >> 32);      
  535.       2397  }
  536.       2398 
  537.       2399  static inline
  538.       2400  struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
  539.       2401                          ext4_group_t group)
  540.       2402  {
  541.       2403       struct ext4_group_info ***grp_info;
  542.       2404       long indexv, indexh;
  543.       2405       BUG_ON(group >= EXT4_SB(sb)->s_groups_count);
  544.       2406       grp_info = EXT4_SB(sb)->s_group_info;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement