1. 25 May, 2011 4 commits
    • Tristan Ye's avatar
      Ocfs2/refcounttree: Publicize couple of funcs from refcounttree.c · 3e19a25e
      Tristan Ye authored
      The original goal of commonizing these funcs is to benefit defraging/extent_moving
      codes in the future,  based on the fact that reflink and defragmentation having
      the same Copy-On-Wrtie mechanism.
      Signed-off-by: default avatarTristan Ye <tristan.ye@oracle.com>
      3e19a25e
    • Tristan Ye's avatar
      Ocfs2: Add a new code 'OCFS2_INFO_FREEFRAG' for o2info ioctl. · d24a10b9
      Tristan Ye authored
      This new code is a bit more complicated than former ones, the goal is to
      show user all statistics required to take a deep insight into filesystem
      on how the disk is being fragmentaed.
      
      The goal is achieved by scaning global bitmap from (cluster)group to group
      to figure out following factors in the filesystem:
      
              - How many free chunks in a fixed size as user requested.
              - How many real free chunks in all size.
              - Min/Max/Avg size(in) clusters of free chunks.
              - How do free chunks distribute(in size) in terms of a histogram,
                just like following:
                ---------------------------------------------------------
                Extent Size Range :  Free extents  Free Clusters  Percent
                   32K...   64K-  :             1             1    0.00%
                    1M...    2M-  :             9           288    0.03%
                    8M...   16M-  :             2           831    0.09%
                   32M...   64M-  :             1          2047    0.23%
                  128M...  256M-  :             1          8191    0.92%
                  256M...  512M-  :             2         21706    2.43%
                  512M... 1024M-  :            27        858623   96.29%
                ---------------------------------------------------------
      
      Userspace ioctl() call eventually gets the above info returned by passing
      a 'struct ocfs2_info_freefrag' with the chunk_size being specified first.
      Signed-off-by: default avatarTristan Ye <tristan.ye@oracle.com>
      d24a10b9
    • Tristan Ye's avatar
      Ocfs2: Add a new code 'OCFS2_INFO_FREEINODE' for o2info ioctl. · 3e5db17d
      Tristan Ye authored
      The new code is dedicated to calculate free inodes number of all inode_allocs,
      then return the info to userpace in terms of an array.
      
      Specially, flag 'OCFS2_INFO_FL_NON_COHERENT', manipulated by '--cluster-coherent'
      from userspace, is now going to be involved. setting the flag on means no cluster
      coherency considered, usually, userspace tools choose none-coherency strategy by
      default for the sake of performace.
      Signed-off-by: default avatarTristan Ye <tristan.ye@oracle.com>
      3e5db17d
    • Tristan Ye's avatar
      Ocfs2: Using inline funcs to set/clear *FILLED* flags in info handler. · 8aa1fa36
      Tristan Ye authored
      It just removes some macros for the sake of typechecking gains.
      Signed-off-by: default avatarTristan Ye <tristan.ye@oracle.com>
      8aa1fa36
  2. 24 May, 2011 36 commits