Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit acd15a83 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: (56 commits)
  ocfs2: Make cached block reads the common case.
  ocfs2: Kill the last naked wait_on_buffer() for cached reads.
  ocfs2: Move ocfs2_bread() into dir.c
  ocfs2: Simplify ocfs2_read_block()
  ocfs2: Require an inode for ocfs2_read_block(s)().
  ocfs2: Separate out sync reads from ocfs2_read_blocks()
  ocfs2: Refactor xattr list and remove ocfs2_xattr_handler().
  ocfs2: Calculate EA hash only by its suffix.
  ocfs2: Move trusted and user attribute support into xattr.c
  ocfs2: Uninline ocfs2_xattr_name_hash()
  ocfs2: Don't check for NULL before brelse()
  ocfs2: use smaller counters in ocfs2_remove_xattr_clusters_from_cache
  ocfs2: Documentation update for user_xattr / nouser_xattr mount options
  ocfs2: make la_debug_mutex static
  ocfs2: Remove pointless !!
  ocfs2: Add empty bucket support in xattr.
  ocfs2/xattr.c: Fix a bug when inserting xattr.
  ocfs2: Add xattr mount option in ocfs2_show_options()
  ocfs2: Switch over to JBD2.
  ocfs2: Add the 'inode64' mount option.
  ...
parents 72f22b1e d4a8c93c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -76,3 +76,9 @@ localalloc=8(*) Allows custom localalloc size in MB. If the value is too
			large, the fs will silently revert it to the default.
			Localalloc is not enabled for local mounts.
localflocks		This disables cluster aware flock.
inode64			Indicates that Ocfs2 is allowed to create inodes at
			any location in the filesystem, including those which
			will result in inode numbers occupying more than 32
			bits of significance.
user_xattr	(*)	Enables Extended User Attributes.
nouser_xattr		Disables Extended User Attributes.
+22 −12
Original line number Diff line number Diff line
@@ -220,17 +220,16 @@ config JBD
	tristate
	help
	  This is a generic journalling layer for block devices.  It is
	  currently used by the ext3 and OCFS2 file systems, but it could
	  also be used to add journal support to other file systems or block
	  currently used by the ext3 file system, but it could also be
	  used to add journal support to other file systems or block
	  devices such as RAID or LVM.

	  If you are using the ext3 or OCFS2 file systems, you need to
	  say Y here. If you are not using ext3 OCFS2 then you will probably
	  want to say N.
	  If you are using the ext3 file system, you need to say Y here.
	  If you are not using ext3 then you will probably want to say N.

	  To compile this device as a module, choose M here: the module will be
	  called jbd.  If you are compiling ext3 or OCFS2 into the kernel,
	  you cannot compile this code as a module.
	  called jbd.  If you are compiling ext3 into the kernel, you
	  cannot compile this code as a module.

config JBD_DEBUG
	bool "JBD (ext3) debugging support"
@@ -254,15 +253,16 @@ config JBD2
	help
	  This is a generic journaling layer for block devices that support
	  both 32-bit and 64-bit block numbers.  It is currently used by
	  the ext4 filesystem, but it could also be used to add
	  the ext4 and OCFS2 filesystems, but it could also be used to add
	  journal support to other file systems or block devices such
	  as RAID or LVM.

	  If you are using ext4, you need to say Y here. If you are not
	  using ext4 then you will probably want to say N.
	  If you are using ext4 or OCFS2, you need to say Y here.
	  If you are not using ext4 or OCFS2 then you will
	  probably want to say N.

	  To compile this device as a module, choose M here. The module will be
	  called jbd2.  If you are compiling ext4 into the kernel,
	  called jbd2.  If you are compiling ext4 or OCFS2 into the kernel,
	  you cannot compile this code as a module.

config JBD2_DEBUG
@@ -448,7 +448,7 @@ config OCFS2_FS
	tristate "OCFS2 file system support"
	depends on NET && SYSFS
	select CONFIGFS_FS
	select JBD
	select JBD2
	select CRC32
	help
	  OCFS2 is a general purpose extent based shared disk cluster file
@@ -519,6 +519,16 @@ config OCFS2_DEBUG_FS
	  this option for debugging only as it is likely to decrease
	  performance of the filesystem.

config OCFS2_COMPAT_JBD
	bool "Use JBD for compatibility"
	depends on OCFS2_FS
	default n
	select JBD
	help
	  The ocfs2 filesystem now uses JBD2 for its journalling.  JBD2
	  is backwards compatible with JBD.  It is safe to say N here.
	  However, if you really want to use the original JBD, say Y here.

endif # BLOCK

config DNOTIFY
+2 −1
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ ocfs2-objs := \
	symlink.o 		\
	sysfile.o 		\
	uptodate.o		\
	ver.o
	ver.o			\
	xattr.o

ocfs2_stackglue-objs := stackglue.o
ocfs2_stack_o2cb-objs := stack_o2cb.o
+662 −251

File changed.

Preview size limit exceeded, changes collapsed.

+79 −7
Original line number Diff line number Diff line
@@ -26,30 +26,102 @@
#ifndef OCFS2_ALLOC_H
#define OCFS2_ALLOC_H


/*
 * For xattr tree leaf, we limit the leaf byte size to be 64K.
 */
#define OCFS2_MAX_XATTR_TREE_LEAF_SIZE 65536

/*
 * ocfs2_extent_tree and ocfs2_extent_tree_operations are used to abstract
 * the b-tree operations in ocfs2. Now all the b-tree operations are not
 * limited to ocfs2_dinode only. Any data which need to allocate clusters
 * to store can use b-tree. And it only needs to implement its ocfs2_extent_tree
 * and operation.
 *
 * ocfs2_extent_tree becomes the first-class object for extent tree
 * manipulation.  Callers of the alloc.c code need to fill it via one of
 * the ocfs2_init_*_extent_tree() operations below.
 *
 * ocfs2_extent_tree contains info for the root of the b-tree, it must have a
 * root ocfs2_extent_list and a root_bh so that they can be used in the b-tree
 * functions.
 * ocfs2_extent_tree_operations abstract the normal operations we do for
 * the root of extent b-tree.
 */
struct ocfs2_extent_tree_operations;
struct ocfs2_extent_tree {
	struct ocfs2_extent_tree_operations	*et_ops;
	struct buffer_head			*et_root_bh;
	struct ocfs2_extent_list		*et_root_el;
	void					*et_object;
	unsigned int				et_max_leaf_clusters;
};

/*
 * ocfs2_init_*_extent_tree() will fill an ocfs2_extent_tree from the
 * specified object buffer.
 */
void ocfs2_init_dinode_extent_tree(struct ocfs2_extent_tree *et,
				   struct inode *inode,
				   struct buffer_head *bh);
void ocfs2_init_xattr_tree_extent_tree(struct ocfs2_extent_tree *et,
				       struct inode *inode,
				       struct buffer_head *bh);
void ocfs2_init_xattr_value_extent_tree(struct ocfs2_extent_tree *et,
					struct inode *inode,
					struct buffer_head *bh,
					struct ocfs2_xattr_value_root *xv);

struct ocfs2_alloc_context;
int ocfs2_insert_extent(struct ocfs2_super *osb,
			handle_t *handle,
			struct inode *inode,
			struct buffer_head *fe_bh,
			struct ocfs2_extent_tree *et,
			u32 cpos,
			u64 start_blk,
			u32 new_clusters,
			u8 flags,
			struct ocfs2_alloc_context *meta_ac);

enum ocfs2_alloc_restarted {
	RESTART_NONE = 0,
	RESTART_TRANS,
	RESTART_META
};
int ocfs2_add_clusters_in_btree(struct ocfs2_super *osb,
				struct inode *inode,
				u32 *logical_offset,
				u32 clusters_to_add,
				int mark_unwritten,
				struct ocfs2_extent_tree *et,
				handle_t *handle,
				struct ocfs2_alloc_context *data_ac,
				struct ocfs2_alloc_context *meta_ac,
				enum ocfs2_alloc_restarted *reason_ret);
struct ocfs2_cached_dealloc_ctxt;
int ocfs2_mark_extent_written(struct inode *inode, struct buffer_head *di_bh,
int ocfs2_mark_extent_written(struct inode *inode,
			      struct ocfs2_extent_tree *et,
			      handle_t *handle, u32 cpos, u32 len, u32 phys,
			      struct ocfs2_alloc_context *meta_ac,
			      struct ocfs2_cached_dealloc_ctxt *dealloc);
int ocfs2_remove_extent(struct inode *inode, struct buffer_head *di_bh,
int ocfs2_remove_extent(struct inode *inode,
			struct ocfs2_extent_tree *et,
			u32 cpos, u32 len, handle_t *handle,
			struct ocfs2_alloc_context *meta_ac,
			struct ocfs2_cached_dealloc_ctxt *dealloc);
int ocfs2_num_free_extents(struct ocfs2_super *osb,
			   struct inode *inode,
			   struct ocfs2_dinode *fe);
/* how many new metadata chunks would an allocation need at maximum? */
static inline int ocfs2_extend_meta_needed(struct ocfs2_dinode *fe)
			   struct ocfs2_extent_tree *et);

/*
 * how many new metadata chunks would an allocation need at maximum?
 *
 * Please note that the caller must make sure that root_el is the root
 * of extent tree. So for an inode, it should be &fe->id2.i_list. Otherwise
 * the result may be wrong.
 */
static inline int ocfs2_extend_meta_needed(struct ocfs2_extent_list *root_el)
{
	/*
	 * Rather than do all the work of determining how much we need
@@ -59,7 +131,7 @@ static inline int ocfs2_extend_meta_needed(struct ocfs2_dinode *fe)
	 * new tree_depth==0 extent_block, and one block at the new
	 * top-of-the tree.
	 */
	return le16_to_cpu(fe->id2.i_list.l_tree_depth) + 2;
	return le16_to_cpu(root_el->l_tree_depth) + 2;
}

void ocfs2_dinode_new_extent_list(struct inode *inode, struct ocfs2_dinode *di);
Loading