04 Jan, 2012

2 commits


17 Nov, 2011

1 commit

  • There are three cases found that in error cases, journal transactions are not
    committed nor aborted. We should take care of these case by committing the
    transactions. Otherwise, there would left a journal handle which will lead to
    , in same process context, the comming ocfs2_start_trans() gets wrong credits.

    Signed-off-by: Wengang Wang
    Signed-off-by: Joel Becker

    Wengang Wang
     

01 Jun, 2011

1 commit


26 May, 2011

1 commit


25 May, 2011

4 commits

  • the basic logic of moving extents for a file is pretty like punching-hole
    sequence, walk the extents within the range as user specified, calculating
    an appropriate len to defrag/move, then let ocfs2_defrag/move_extent() to
    do the actual moving.

    This func ends up setting 'OCFS2_MOVE_EXT_FL_COMPLETE' to userpace if operation
    gets done successfully.

    Signed-off-by: Tristan Ye

    Tristan Ye
     
  • 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: Tristan Ye

    Tristan Ye
     
  • 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: Tristan Ye

    Tristan Ye
     
  • It just removes some macros for the sake of typechecking gains.

    Signed-off-by: Tristan Ye

    Tristan Ye
     

24 May, 2011

1 commit


29 Mar, 2011

2 commits

  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (39 commits)
    Treat writes as new when holes span across page boundaries
    fs,ocfs2: Move o2net_get_func_run_time under CONFIG_OCFS2_FS_STATS.
    ocfs2/dlm: Move kmalloc() outside the spinlock
    ocfs2: Make the left masklogs compat.
    ocfs2: Remove masklog ML_AIO.
    ocfs2: Remove masklog ML_UPTODATE.
    ocfs2: Remove masklog ML_BH_IO.
    ocfs2: Remove masklog ML_JOURNAL.
    ocfs2: Remove masklog ML_EXPORT.
    ocfs2: Remove masklog ML_DCACHE.
    ocfs2: Remove masklog ML_NAMEI.
    ocfs2: Remove mlog(0) from fs/ocfs2/dir.c
    ocfs2: remove NAMEI from symlink.c
    ocfs2: Remove masklog ML_QUOTA.
    ocfs2: Remove mlog(0) from quota_local.c.
    ocfs2: Remove masklog ML_RESERVATIONS.
    ocfs2: Remove masklog ML_XATTR.
    ocfs2: Remove masklog ML_SUPER.
    ocfs2: Remove mlog(0) from fs/ocfs2/heartbeat.c
    ocfs2: Remove mlog(0) from fs/ocfs2/slot_map.c
    ...

    Fix up trivial conflict in fs/ocfs2/super.c

    Linus Torvalds
     
  • Joel Becker
     

24 Mar, 2011

1 commit


07 Mar, 2011

1 commit

  • mlog_exit is used to record the exit status of a function.
    But because it is added in so many functions, if we enable it,
    the system logs get filled up quickly and cause too much I/O.
    So actually no one can open it for a production system or even
    for a test.

    This patch just try to remove it or change it. So:
    1. if all the error paths already use mlog_errno, it is just removed.
    Otherwise, it will be replaced by mlog_errno.
    2. if it is used to print some return value, it is replaced with
    mlog(0,...).
    mlog_exit_ptr is changed to mlog(0.
    All those mlog(0,...) will be replaced with trace events later.

    Signed-off-by: Tao Ma

    Tao Ma
     

21 Feb, 2011

1 commit


20 Feb, 2011

1 commit


10 Sep, 2010

1 commit

  • The reason why we need this ioctl is to offer the none-privileged
    end-user a possibility to get filesys info gathering.

    We use OCFS2_IOC_INFO to manipulate the new ioctl, userspace passes a
    structure to kernel containing an array of request pointers and request
    count, such as,

    * From userspace:

    struct ocfs2_info_blocksize oib = {
    .ib_req = {
    .ir_magic = OCFS2_INFO_MAGIC,
    .ir_code = OCFS2_INFO_BLOCKSIZE,
    ...
    }
    ...
    }

    struct ocfs2_info_clustersize oic = {
    ...
    }

    uint64_t reqs[2] = {(unsigned long)&oib,
    (unsigned long)&oic};

    struct ocfs2_info info = {
    .oi_requests = reqs,
    .oi_count = 2,
    }

    ret = ioctl(fd, OCFS2_IOC_INFO, &info);

    * In kernel:

    Get the request pointers from *info*, then handle each request one bye one.

    Idea here is to make the spearated request small enough to guarantee
    a better backward&forward compatibility since a small piece of request
    would be less likely to be broken if filesys on raw disk get changed.

    Currently, the following 7 requests are supported per the requirement from
    userspace tool o2info, and I believe it will grow over time:-)

    OCFS2_INFO_CLUSTERSIZE
    OCFS2_INFO_BLOCKSIZE
    OCFS2_INFO_MAXSLOTS
    OCFS2_INFO_LABEL
    OCFS2_INFO_UUID
    OCFS2_INFO_FS_FEATURES
    OCFS2_INFO_JOURNAL_SIZE

    This ioctl is only specific to OCFS2.

    Signed-off-by: Tristan Ye
    Signed-off-by: Joel Becker

    Tristan Ye
     

03 Feb, 2010

1 commit

  • Although we use u64 to pass userspace pointers to the kernel
    to avoid compat_ioctl, it doesn't work in some ppc platform.
    So wrap them with compat_ptr and add compat_ioctl.

    The detailed discussion about compat_ptr can be found in thread
    http://lkml.org/lkml/2009/10/27/423.

    We indeed met with a bug when testing on ppc(-EFAULT is returned
    when using old_path). This patch try to fix this.
    I have tested in ppc64(with 32 bit reflink) and x86_64(with i686
    reflink), both works.

    Signed-off-by: Tao Ma
    Signed-off-by: Joel Becker

    Tao Ma
     

24 Sep, 2009

1 commit

  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (85 commits)
    ocfs2: Use buffer IO if we are appending a file.
    ocfs2: add spinlock protection when dealing with lockres->purge.
    dlmglue.c: add missed mlog lines
    ocfs2: __ocfs2_abort() should not enable panic for local mounts
    ocfs2: Add ioctl for reflink.
    ocfs2: Enable refcount tree support.
    ocfs2: Implement ocfs2_reflink.
    ocfs2: Add preserve to reflink.
    ocfs2: Create reflinked file in orphan dir.
    ocfs2: Use proper parameter for some inode operation.
    ocfs2: Make transaction extend more efficient.
    ocfs2: Don't merge in 1st refcount ops of reflink.
    ocfs2: Modify removing xattr process for refcount.
    ocfs2: Add reflink support for xattr.
    ocfs2: Create an xattr indexed block if needed.
    ocfs2: Call refcount tree remove process properly.
    ocfs2: Attach xattr clusters to refcount tree.
    ocfs2: Abstract ocfs2 xattr tree extend rec iteration process.
    ocfs2: Abstract the creation of xattr block.
    ocfs2: Remove inode from ocfs2_xattr_bucket_get_name_value.
    ...

    Linus Torvalds
     

23 Sep, 2009

1 commit


13 Jul, 2009

1 commit

  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

14 Oct, 2008

1 commit


19 Apr, 2008

1 commit


18 Apr, 2008

2 commits

  • As far as I can see there is nothing in ocfs2_ioctl that requires the BKL,
    so use unlocked_ioctl

    Signed-off-by: Andi Kleen
    Signed-off-by: Mark Fasheh

    Andi Kleen
     
  • The last bit of classic stack used directly in ocfs2 code is o2hb.
    Specifically, the check for heartbeat during mount and the call to
    ocfs2_hb_ctl during unmount.

    We create an extra API, ocfs2_cluster_hangup(), to encapsulate the call
    to ocfs2_hb_ctl. Other stacks will just leave hangup() empty.

    The check for heartbeat is moved into ocfs2_cluster_connect(). It will
    be matched by a similar check for other stacks.

    With this change, only stackglue.c includes cluster/ headers.

    Signed-off-by: Joel Becker
    Signed-off-by: Mark Fasheh

    Joel Becker
     

26 Jan, 2008

4 commits

  • Check that an online resize is being driven by a user with permission to
    change system resource limits.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • This patch adds the ability for a userspace program to request that a
    properly formatted cluster group be added to the main allocation bitmap for
    an Ocfs2 file system. The request is made via an ioctl, OCFS2_IOC_GROUP_ADD.
    On a high level, this is similar to ext3, but we use a different ioctl as
    the structure which has to be passed through is different.

    During an online resize, tunefs.ocfs2 will format any new cluster groups
    which must be added to complete the resize, and call OCFS2_IOC_GROUP_ADD on
    each one. Kernel verifies that the core cluster group information is valid
    and then does the work of linking it into the global allocation bitmap.

    Signed-off-by: Tao Ma
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • This patch adds the ability for a userspace program to request an extend of
    last cluster group on an Ocfs2 file system. The request is made via ioctl,
    OCFS2_IOC_GROUP_EXTEND. This is derived from EXT3_IOC_GROUP_EXTEND, but is
    obviously Ocfs2 specific.

    tunefs.ocfs2 would call this for an online-resize operation if the last
    cluster group isn't full.

    Signed-off-by: Tao Ma
    Signed-off-by: Mark Fasheh

    Tao Ma
     
  • Call this the "inode_lock" now, since it covers both data and meta data.
    This patch makes no functional changes.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     

18 Jul, 2007

1 commit

  • Introduce is_owner_or_cap() macro in fs.h, and convert over relevant
    users to it. This is done because we want to avoid bugs in the future
    where we check for only effective fsuid of the current task against a
    file's owning uid, without simultaneously checking for CAP_FOWNER as
    well, thus violating its semantics.
    [ XFS uses special macros and structures, and in general looked ...
    untouchable, so we leave it alone -- but it has been looked over. ]

    The (current->fsuid != inode->i_uid) check in generic_permission() and
    exec_permission_lite() is left alone, because those operations are
    covered by CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH. Similarly operations
    falling under the purview of CAP_CHOWN and CAP_LEASE are also left alone.

    Signed-off-by: Satyam Sharma
    Cc: Al Viro
    Acked-by: Serge E. Hallyn
    Signed-off-by: Linus Torvalds

    Satyam Sharma
     

11 Jul, 2007

1 commit

  • We re-use the RESVSP/UNRESVSP ioctls from xfs which allow the user to
    allocate and deallocate regions to a file without zeroing data or changing
    i_size.

    Though renamed, the structure passed in from user is identical to struct
    xfs_flock64. The three fields that are actually used right now are l_whence,
    l_start and l_len.

    This should get ocfs2 immediate compatibility with userspace software using
    the pre-existing xfs ioctls.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     

03 May, 2007

2 commits


02 Dec, 2006

4 commits


21 Sep, 2006

2 commits