1. 18 3月, 2010 4 次提交
  2. 13 3月, 2010 1 次提交
  3. 08 3月, 2010 1 次提交
  4. 07 3月, 2010 1 次提交
  5. 05 3月, 2010 7 次提交
    • C
      dquot: cleanup dquot initialize routine · 871a2931
      Christoph Hellwig 提交于
      Get rid of the initialize dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_initialize helper to __dquot_initialize
      and vfs_dq_init to dquot_initialize to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      871a2931
    • C
      dquot: move dquot initialization responsibility into the filesystem · 907f4554
      Christoph Hellwig 提交于
      Currently various places in the VFS call vfs_dq_init directly.  This means
      we tie the quota code into the VFS.  Get rid of that and make the
      filesystem responsible for the initialization.   For most metadata operations
      this is a straight forward move into the methods, but for truncate and
      open it's a bit more complicated.
      
      For truncate we currently only call vfs_dq_init for the sys_truncate case
      because open already takes care of it for ftruncate and open(O_TRUNC) - the
      new code causes an additional vfs_dq_init for those which is harmless.
      
      For open the initialization is moved from do_filp_open into the open method,
      which means it happens slightly earlier now, and only for regular files.
      The latter is fine because we don't need to initialize it for operations
      on special files, and we already do it as part of the namespace operations
      for directories.
      
      Add a dquot_file_open helper that filesystems that support generic quotas
      can use to fill in ->open.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      907f4554
    • C
      dquot: cleanup dquot drop routine · 9f754758
      Christoph Hellwig 提交于
      Get rid of the drop dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_drop helper to __dquot_drop
      and vfs_dq_drop to dquot_drop to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      9f754758
    • C
      dquot: move dquot drop responsibility into the filesystem · 257ba15c
      Christoph Hellwig 提交于
      Currently clear_inode calls vfs_dq_drop directly.  This means
      we tie the quota code into the VFS.  Get rid of that and make the
      filesystem responsible for the drop inside the ->clear_inode
      superblock operation.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      257ba15c
    • C
      dquot: cleanup dquot transfer routine · b43fa828
      Christoph Hellwig 提交于
      Get rid of the transfer dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_transfer helper to __dquot_transfer
      and vfs_dq_transfer to dquot_transfer to have a consistent namespace,
      and make the new dquot_transfer return a normal negative errno value
      which all callers expect.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      b43fa828
    • C
      dquot: cleanup inode allocation / freeing routines · 63936dda
      Christoph Hellwig 提交于
      Get rid of the alloc_inode and free_inode dquot operations - they are
      always called from the filesystem and if a filesystem really needs
      their own (which none currently does) it can just call into it's
      own routine directly.
      
      Also get rid of the vfs_dq_alloc/vfs_dq_free wrappers and always
      call the lowlevel dquot_alloc_inode / dqout_free_inode routines
      directly, which now lose the number argument which is always 1.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      63936dda
    • C
      dquot: cleanup space allocation / freeing routines · 5dd4056d
      Christoph Hellwig 提交于
      Get rid of the alloc_space, free_space, reserve_space, claim_space and
      release_rsv dquot operations - they are always called from the filesystem
      and if a filesystem really needs their own (which none currently does)
      it can just call into it's own routine directly.
      
      Move shared logic into the common __dquot_alloc_space,
      dquot_claim_space_nodirty and __dquot_free_space low-level methods,
      and rationalize the wrappers around it to move as much as possible
      code into the common block for CONFIG_QUOTA vs not.  Also rename
      all these helpers to be named dquot_* instead of vfs_dq_*.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5dd4056d
  6. 03 3月, 2010 1 次提交
  7. 28 2月, 2010 3 次提交
  8. 27 2月, 2010 22 次提交
    • S
      dlm: allow dlm do recovery during shutdown · bc9838c4
      Srinivas Eeda 提交于
      If a node down event happens while dlm shutdown in progress, dlm recovery
      should be done before dlm is shutdown.  We can't migrate unrecovered locks,
      obviously.  But dlm_reco_thread only does recovery if the dlm_state is
      in DLM_CTXT_JOINED.
      
      dlm_reco_thread should do recovery if dlm_state is in DLM_CTXT_JOINED or
      DLM_CTXT_IN_SHUTDOWN.
      Signed-off-by: NSrinivas Eeda <srinivas.eeda@oracle.com>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      bc9838c4
    • T
      ocfs2: Only bug out in direct io write for reflinked extent. · cbaee472
      Tao Ma 提交于
      In ocfs2_direct_IO_get_blocks, we only need to bug out
      in case of we are going to write a recounted extent rec.
      
      What a silly bug introduced by me!
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Cc: stable@kernel.org
      cbaee472
    • C
      ocfs2: fix warning in ocfs2_file_aio_write() · 66b116c9
      Coly Li 提交于
      This patch fixes a compiling warning in ocfs2_file_aio_write().
      Signed-off-by: NColy Li <coly.li@suse.de>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      66b116c9
    • J
      ocfs2_dlmfs: Enable the use of user cluster stacks. · cbe0e331
      Joel Becker 提交于
      Unlike ocfs2, dlmfs has no permanent storage.  It can't store off a
      cluster stack it is supposed to be using.  So it can't specify the stack
      name in ocfs2_cluster_connect().
      
      Instead, we create ocfs2_cluster_connect_agnostic(), which simply uses
      the stack that is currently enabled.  This is find for dlmfs, which will
      rely on the stack initialization.
      
      We add the "stackglue" capability to dlmfs's capability list.  This lets
      userspace know dlmfs can be used with all cluster stacks.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      cbe0e331
    • J
      ocfs2_dlmfs: Use the stackglue. · 0016eedc
      Joel Becker 提交于
      Rather than directly using o2dlm, dlmfs can now use the stackglue.  This
      allows it to use userspace cluster stacks and fs/dlm.  This commit
      forces o2cb for now.  A latter commit will bump the protocol version and
      allow non-o2cb stacks.
      
      This is one big sed, really.  LKM_xxMODE becomes DLM_LOCK_xx.  LKM_flag
      becomes DLM_LKF_flag.
      
      We also learn to check that the LVB is valid before reading it.  Any DLM
      can lose the contents of the LVB during a complicated recovery.  userdlm
      should be checking this.  Now it does.  dlmfs will return 0 from read(2)
      if the LVB was invalid.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      0016eedc
    • J
      ocfs2_dlmfs: Don't honor truncate. The size of a dlmfs file is LVB_LEN · e8fce482
      Joel Becker 提交于
      We want folks using dlmfs to be able to use the LVB in places other than
      just write(2)/read(2).  By ignoring truncate requests, we allow 'echo
      "contents" > /dlm/space/lockname' to work.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      e8fce482
    • J
      ocfs2: Pass the locking protocol into ocfs2_cluster_connect(). · 553b5eb9
      Joel Becker 提交于
      Inside the stackglue, the locking protocol structure is hanging off of
      the ocfs2_cluster_connection.  This takes it one further; the locking
      protocol is passed into ocfs2_cluster_connect().  Now different cluster
      connections can have different locking protocols with distinct asts.
      Note that all locking protocols have to keep their maximum protocol
      version in lock-step.
      
      With the protocol structure set in ocfs2_cluster_connect(), there is no
      need for the stackglue to have a static pointer to a specific protocol
      structure.  We can change initialization to only pass in the maximum
      protocol version.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      553b5eb9
    • J
      ocfs2: Remove the ast pointers from ocfs2_stack_plugins · e603cfb0
      Joel Becker 提交于
      With the full ocfs2_locking_protocol hanging off of the
      ocfs2_cluster_connection, ast wrappers can get the ast/bast pointers
      there.  They don't need to get them from their plugin structure.
      
      The user plugin still needs the maximum locking protocol version,
      though.  This changes the plugin structure so that it only holds the max
      version, not the entire ocfs2_locking_protocol pointer.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      e603cfb0
    • J
      ocfs2: Hang the locking proto on the cluster conn and use it in asts. · 110946c8
      Joel Becker 提交于
      With the ocfs2_cluster_connection hanging off of the ocfs2_dlm_lksb, we
      have access to it in the ast and bast wrapper functions.  Attach the
      ocfs2_locking_protocol to the conn.
      
      Now, instead of refering to a static variable for ast/bast pointers, the
      wrappers can look at the connection.  This means different connections
      can have different ast/bast pointers, and it reduces the need for the
      static pointer.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      110946c8
    • J
      ocfs2: Attach the connection to the lksb · c0e41338
      Joel Becker 提交于
      We're going to want it in the ast functions, so we convert union
      ocfs2_dlm_lksb to struct ocfs2_dlm_lksb and let it carry the connection.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      c0e41338
    • J
      ocfs2: Pass lksbs back from stackglue ast/bast functions. · a796d286
      Joel Becker 提交于
      The stackglue ast and bast functions tried to maintain the fiction that
      their arguments were void pointers.  In reality, stack_user.c had to
      know that the argument was an ocfs2_lock_res in order to get the status
      off of the lksb.  That's ugly.
      
      This changes stackglue to always pass the lksb as the argument to ast
      and bast functions.  The caller can always use container_of() to get the
      ocfs2_lock_res or user_dlm_lock_res.  The net effect to the caller is
      zero.  They still get back the lockres in their ast.  stackglue gets
      cleaner, and now can use the lksb itself.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      a796d286
    • J
      ocfs2_dlmfs: Move to its own directory · 34a9dd7e
      Joel Becker 提交于
      We're going to remove the tie between ocfs2_dlmfs and o2dlm.
      ocfs2_dlmfs doesn't belong in the fs/ocfs2/dlm directory anymore.  Here
      we move it to fs/ocfs2/dlmfs.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      34a9dd7e
    • J
      ocfs2_dlmfs: Use poll() to signify BASTs. · 65b6f340
      Joel Becker 提交于
      o2dlm's userspace filesystem is an easy way to use the DLM from
      userspace.  It is intentionally simple. For example, it does not allow
      for asynchronous behavior or lock conversion.  This is intentional to
      keep the interface simple.
      
      Because there is no asynchronous notification, there is no way for a
      process holding a lock to know another node needs the lock.  This is the
      number one complaint of ocfs2_dlmfs users.  Turns out, we can solve this
      very easily.  We add poll() support to ocfs2_dlmfs.  When a BAST is
      received, the lock's file descriptor will receive POLLIN.
      
      This is trivial to implement.  Userdlm already has an appropriate
      waitqueue, and the lock knows when it is blocked.
      
      We add the "bast" capability to tell userspace this is available.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Acked-by: NMark Fasheh <mfasheh@suse.com>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      65b6f340
    • J
      ocfs2_dlmfs: Add capabilities parameter. · 14a437c2
      Joel Becker 提交于
      Over time, dlmfs has added some features that were not part of the
      initial ABI.  Unfortunately, some of these features are not detectable
      via standard usage.  For example, Linux's default poll always returns
      POLLIN, so there is no way for a caller of poll(2) to know when dlmfs
      added poll support.  Instead, we provide this list of new capabilities.
      
      Capabilities is a read-only attribute.  We do it as a module parameter
      so we can discover it whether dlmfs is built in, loaded, or even not
      loaded (via modinfo).
      
      The ABI features are local to this machine's dlmfs mount.  This is
      distinct from the locking protocol, which is concerned with inter-node
      interaction.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      14a437c2
    • J
      ocfs2: Handle errors while setting external xattr values. · 399ff3a7
      Joel Becker 提交于
      ocfs2 can store extended attribute values as large as a single file.  It
      does this using a standard ocfs2 btree for the large value.  However,
      the previous code did not handle all error cases cleanly.
      
      There are multiple problems to have.
      
      1) We have trouble allocating space for a new xattr.  This leaves us
         with an empty xattr.
      2) We overwrote an existing local xattr with a value root, and now we
         have an error allocating the storage.  This leaves us an empty xattr.
         where there used to be a value.  The value is lost.
      3) We have trouble truncating a reused value.  This leaves us with the
         original entry pointing to the truncated original value.  The value
         is lost.
      4) We have trouble extending the storage on a reused value.  This leaves
         us with the original value safely in place, but with more storage
         allocated when needed.
      
      This doesn't consider storing local xattrs (values that don't require a
      btree).  Those only fail when the journal fails.
      
      Case (1) is easy.  We just remove the xattr we added.  We leak the
      storage because we can't safely remove it, but otherwise everything is
      happy.  We'll print a warning about the leak.
      
      Case (4) is easy.  We still have the original value in place.  We can
      just leave the extra storage attached to this xattr.  We return the
      error, but the old value is untouched.  We print a warning about the
      storage.
      
      Case (2) and (3) are hard because we've lost the original values.  In
      the old code, we ended up with values that could be partially read.
      That's not good.  Instead, we just wipe the xattr entry and leak the
      storage.  It stinks that the original value is lost, but now there isn't
      a partial value to be read.  We'll print a big fat warning.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      399ff3a7
    • J
      ocfs2: Set inline xattr entries with ocfs2_xa_set() · 139fface
      Joel Becker 提交于
      ocfs2_xattr_ibody_set() is the only remaining user of
      ocfs2_xattr_set_entry().  ocfs2_xattr_set_entry() actually does two
      things: it calls ocfs2_xa_set(), and it initializes the inline xattrs.
      Initializing the inline space really belongs in its own call.
      
      We lift the initialization to ocfs2_xattr_ibody_init(), called from
      ocfs2_xattr_ibody_set() only when necessary.  Now
      ocfs2_xattr_ibody_set() can call ocfs2_xa_set() directly.
      ocfs2_xattr_set_entry() goes away.
      
      Another nice fact is that ocfs2_init_dinode_xa_loc() can trust
      i_xattr_inline_size.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      139fface
    • J
      ocfs2: Set xattr block entries with ocfs2_xa_set() · d3981544
      Joel Becker 提交于
      ocfs2_xattr_block_set() calls into ocfs2_xattr_set_entry() with just the
      HAS_XATTR flag.  Most of the machinery of ocfs2_xattr_set_entry() is
      skipped.  All that really happens other than the call to ocfs2_xa_set()
      is making sure the HAS_XATTR flag is set on the inode.
      
      But HAS_XATTR should be set when we also set di->i_xattr_loc.  And
      that's done in ocfs2_create_xattr_block().  So let's move it there, and
      then ocfs2_xattr_block_set() can just call ocfs2_xa_set().
      
      While we're there, ocfs2_create_xattr_block() can take the set_ctxt for
      a smaller argument list.  It also learns to set HAS_XATTR_FL, because it
      knows for sure.  ocfs2_create_empty_xatttr_block() in the reflink path
      fakes a set_ctxt to call ocfs2_create_xattr_block().
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      d3981544
    • J
      ocfs2: Let ocfs2_xa_prepare_entry() do space checks. · c5d95df5
      Joel Becker 提交于
      ocfs2_xattr_set_in_bucket() doesn't need to do its own hacky space
      checking.  Let's let ocfs2_xa_prepare_entry() (via ocfs2_xa_set()) do
      the more accurate work.  Whenever it doesn't have space,
      ocfs2_xattr_set_in_bucket() can try to get more space.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      c5d95df5
    • J
      ocfs2: Gell into ocfs2_xa_set() · bca5e9bd
      Joel Becker 提交于
      ocfs2_xa_set() wraps the ocfs2_xa_prepare_entry()/ocfs2_xa_store_value()
      logic.  Both callers can now use the same routine.  ocfs2_xa_remove()
      moves directly into ocfs2_xa_set().
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      bca5e9bd
    • J
      ocfs2: Allocation in ocfs2_xa_prepare_entry(), values in ocfs2_xa_store_value() · 73857ee0
      Joel Becker 提交于
      ocfs2_xa_prepare_entry() gets all the logic to add, remove, or modify
      external value trees.  Now, when it exits, the entry is ready to receive
      a value of any size.
      
      ocfs2_xa_remove() is added to handle the complete removal of an entry.
      It truncates the external value tree before calling
      ocfs2_xa_remove_entry().
      
      ocfs2_xa_store_inline_value() becomes ocfs2_xa_store_value().  It can
      store any value.
      
      ocfs2_xattr_set_entry() loses all the allocation logic and just uses
      these functions.  ocfs2_xattr_set_value_outside() disappears.
      
      ocfs2_xattr_set_in_bucket() uses these functions and makes
      ocfs2_xattr_set_entry_in_bucket() obsolete.  That goes away, as does
      ocfs2_xattr_bucket_set_value_outside() and
      ocfs2_xattr_bucket_value_truncate().
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      73857ee0
    • J
      ocfs2: Teach ocfs2_xa_loc how to do its own journal work · cf2bc809
      Joel Becker 提交于
      We're going to want to make sure our buffers get accessed and dirtied
      correctly.  So have the xa_loc do the work.  This includes storing the
      inode on ocfs2_xa_loc.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      cf2bc809
    • J
      ocfs2: Provide ocfs2_xa_fill_value_buf() for external value processing · 3fc12afa
      Joel Becker 提交于
      We use the ocfs2_xattr_value_buf structure to manage external values.
      It lets the value tree code do its work regardless of the containing
      storage.  ocfs2_xa_fill_value_buf() initializes a value buf from an
      ocfs2_xa_loc entry.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      3fc12afa