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

Commit 651857a1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: (31 commits)
  ocfs2: implement i_op->permission
  configfs: make configfs_dirent_exists() static
  ocfs2: update file system paths to set atime
  ocfs2: core atime update functions
  ocfs2: Add splice support
  ocfs2: Remove ocfs2_write_should_remove_suid()
  [PATCH] Export should_remove_suid()
  configfs: mutex_lock_nested() fix
  ocfs2: Remove struct ocfs2_journal_handle in favor of handle_t
  ocfs2: remove handle argument to ocfs2_start_trans()
  ocfs2: remove ocfs2_journal_handle journal field
  ocfs2: pass ocfs2_super * into ocfs2_commit_trans()
  ocfs2: remove unused handle argument from ocfs2_meta_lock_full()
  ocfs2: make ocfs2_alloc_handle() static
  ocfs2: remove unused ocfs2_handle_add_lock()
  ocfs2: remove unused ocfs2_handle_add_inode()
  ocfs2: Don't allocate handle early in ocfs2_rename()
  ocfs2: don't use handle for locking in allocation functions
  ocfs2: don't pass handle to ocfs2_meta_lock in ocfs2_rename()
  ocfs2: don't pass handle to ocfs2_meta_lock in ocfs2_symlink()
  ...
parents ee28b0da d38eb8db
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ static struct configfs_dirent *configfs_new_dirent(struct configfs_dirent * pare
 *
 * called with parent inode's i_mutex held
 */
int configfs_dirent_exists(struct configfs_dirent *parent_sd,
static int configfs_dirent_exists(struct configfs_dirent *parent_sd,
				  const unsigned char *new)
{
	struct configfs_dirent * sd;
@@ -1176,8 +1176,9 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
		return;
	}

	mutex_lock(&configfs_sb->s_root->d_inode->i_mutex);
	mutex_lock(&dentry->d_inode->i_mutex);
	mutex_lock_nested(&configfs_sb->s_root->d_inode->i_mutex,
			  I_MUTEX_PARENT);
	mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD);
	if (configfs_detach_prep(dentry)) {
		printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n");
	}
+39 −51
Original line number Diff line number Diff line
@@ -52,14 +52,14 @@ static int ocfs2_extent_contig(struct inode *inode,
			       u64 blkno);

static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
				     struct ocfs2_journal_handle *handle,
				     handle_t *handle,
				     struct inode *inode,
				     int wanted,
				     struct ocfs2_alloc_context *meta_ac,
				     struct buffer_head *bhs[]);

static int ocfs2_add_branch(struct ocfs2_super *osb,
			    struct ocfs2_journal_handle *handle,
			    handle_t *handle,
			    struct inode *inode,
			    struct buffer_head *fe_bh,
			    struct buffer_head *eb_bh,
@@ -67,14 +67,14 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
			    struct ocfs2_alloc_context *meta_ac);

static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  struct ocfs2_alloc_context *meta_ac,
				  struct buffer_head **ret_new_eb_bh);

static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  u64 blkno,
@@ -152,7 +152,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
 * l_count for you
 */
static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
				     struct ocfs2_journal_handle *handle,
				     handle_t *handle,
				     struct inode *inode,
				     int wanted,
				     struct ocfs2_alloc_context *meta_ac,
@@ -253,7 +253,7 @@ static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
 * contain a single record with e_clusters == 0.
 */
static int ocfs2_add_branch(struct ocfs2_super *osb,
			    struct ocfs2_journal_handle *handle,
			    handle_t *handle,
			    struct inode *inode,
			    struct buffer_head *fe_bh,
			    struct buffer_head *eb_bh,
@@ -418,7 +418,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
 * after this call.
 */
static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  struct ocfs2_alloc_context *meta_ac,
@@ -520,7 +520,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
 * down.
 */
static int ocfs2_do_insert_extent(struct ocfs2_super *osb,
				  struct ocfs2_journal_handle *handle,
				  handle_t *handle,
				  struct inode *inode,
				  struct buffer_head *fe_bh,
				  u64 start_blk,
@@ -809,7 +809,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,

/* the caller needs to update fe->i_clusters */
int ocfs2_insert_extent(struct ocfs2_super *osb,
			struct ocfs2_journal_handle *handle,
			handle_t *handle,
			struct inode *inode,
			struct buffer_head *fe_bh,
			u64 start_blk,
@@ -951,7 +951,7 @@ static int ocfs2_truncate_log_can_coalesce(struct ocfs2_truncate_log *tl,
}

static int ocfs2_truncate_log_append(struct ocfs2_super *osb,
				     struct ocfs2_journal_handle *handle,
				     handle_t *handle,
				     u64 start_blk,
				     unsigned int num_clusters)
{
@@ -1034,7 +1034,7 @@ static int ocfs2_truncate_log_append(struct ocfs2_super *osb,
}

static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
					 struct ocfs2_journal_handle *handle,
					 handle_t *handle,
					 struct inode *data_alloc_inode,
					 struct buffer_head *data_alloc_bh)
{
@@ -1113,7 +1113,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
{
	int status;
	unsigned int num_to_flush;
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle;
	struct inode *tl_inode = osb->osb_tl_inode;
	struct inode *data_alloc_inode = NULL;
	struct buffer_head *tl_bh = osb->osb_tl_bh;
@@ -1130,7 +1130,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
	if (!OCFS2_IS_VALID_DINODE(di)) {
		OCFS2_RO_ON_INVALID_DINODE(osb->sb, di);
		status = -EIO;
		goto bail;
		goto out;
	}

	num_to_flush = le16_to_cpu(tl->tl_used);
@@ -1138,14 +1138,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
	     num_to_flush, (unsigned long long)OCFS2_I(tl_inode)->ip_blkno);
	if (!num_to_flush) {
		status = 0;
		goto bail;
	}

	handle = ocfs2_alloc_handle(osb);
	if (!handle) {
		status = -ENOMEM;
		mlog_errno(status);
		goto bail;
		goto out;
	}

	data_alloc_inode = ocfs2_get_system_file_inode(osb,
@@ -1154,41 +1147,40 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
	if (!data_alloc_inode) {
		status = -EINVAL;
		mlog(ML_ERROR, "Could not get bitmap inode!\n");
		goto bail;
		goto out;
	}

	ocfs2_handle_add_inode(handle, data_alloc_inode);
	status = ocfs2_meta_lock(data_alloc_inode, handle, &data_alloc_bh, 1);
	mutex_lock(&data_alloc_inode->i_mutex);

	status = ocfs2_meta_lock(data_alloc_inode, &data_alloc_bh, 1);
	if (status < 0) {
		mlog_errno(status);
		goto bail;
		goto out_mutex;
	}

	handle = ocfs2_start_trans(osb, handle, OCFS2_TRUNCATE_LOG_UPDATE);
	handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE);
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		handle = NULL;
		mlog_errno(status);
		goto bail;
		goto out_unlock;
	}

	status = ocfs2_replay_truncate_records(osb, handle, data_alloc_inode,
					       data_alloc_bh);
	if (status < 0) {
	if (status < 0)
		mlog_errno(status);
		goto bail;
	}

bail:
	if (handle)
		ocfs2_commit_trans(handle);

	if (data_alloc_inode)
		iput(data_alloc_inode);
	ocfs2_commit_trans(osb, handle);

	if (data_alloc_bh)
out_unlock:
	brelse(data_alloc_bh);
	ocfs2_meta_unlock(data_alloc_inode, 1);

out_mutex:
	mutex_unlock(&data_alloc_inode->i_mutex);
	iput(data_alloc_inode);

out:
	mlog_exit(status);
	return status;
}
@@ -1347,7 +1339,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
	int i;
	unsigned int clusters, num_recs, start_cluster;
	u64 start_blk;
	struct ocfs2_journal_handle *handle;
	handle_t *handle;
	struct inode *tl_inode = osb->osb_tl_inode;
	struct ocfs2_truncate_log *tl;

@@ -1373,8 +1365,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
			}
		}

		handle = ocfs2_start_trans(osb, NULL,
					   OCFS2_TRUNCATE_LOG_UPDATE);
		handle = ocfs2_start_trans(osb, OCFS2_TRUNCATE_LOG_UPDATE);
		if (IS_ERR(handle)) {
			status = PTR_ERR(handle);
			mlog_errno(status);
@@ -1387,7 +1378,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,

		status = ocfs2_truncate_log_append(osb, handle,
						   start_blk, clusters);
		ocfs2_commit_trans(handle);
		ocfs2_commit_trans(osb, handle);
		if (status < 0) {
			mlog_errno(status);
			goto bail_up;
@@ -1543,7 +1534,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
			     struct inode *inode,
			     struct buffer_head *fe_bh,
			     struct buffer_head *old_last_eb_bh,
			     struct ocfs2_journal_handle *handle,
			     handle_t *handle,
			     struct ocfs2_truncate_context *tc)
{
	int status, i, depth;
@@ -1782,7 +1773,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
	struct ocfs2_extent_block *eb;
	struct ocfs2_extent_list *el;
	struct buffer_head *last_eb_bh;
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle = NULL;
	struct inode *tl_inode = osb->osb_tl_inode;

	mlog_entry_void();
@@ -1868,7 +1859,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,

	credits = ocfs2_calc_tree_trunc_credits(osb->sb, clusters_to_del,
						fe, el);
	handle = ocfs2_start_trans(osb, NULL, credits);
	handle = ocfs2_start_trans(osb, credits);
	if (IS_ERR(handle)) {
		status = PTR_ERR(handle);
		handle = NULL;
@@ -1891,7 +1882,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
	mutex_unlock(&tl_inode->i_mutex);
	tl_sem = 0;

	ocfs2_commit_trans(handle);
	ocfs2_commit_trans(osb, handle);
	handle = NULL;

	BUG_ON(le32_to_cpu(fe->i_clusters) < target_i_clusters);
@@ -1906,7 +1897,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
		mutex_unlock(&tl_inode->i_mutex);

	if (handle)
		ocfs2_commit_trans(handle);
		ocfs2_commit_trans(osb, handle);

	if (last_eb_bh)
		brelse(last_eb_bh);
@@ -2011,10 +2002,7 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb,
		mutex_lock(&ext_alloc_inode->i_mutex);
		(*tc)->tc_ext_alloc_inode = ext_alloc_inode;

		status = ocfs2_meta_lock(ext_alloc_inode,
					 NULL,
					 &ext_alloc_bh,
					 1);
		status = ocfs2_meta_lock(ext_alloc_inode, &ext_alloc_bh, 1);
		if (status < 0) {
			mlog_errno(status);
			goto bail;
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@

struct ocfs2_alloc_context;
int ocfs2_insert_extent(struct ocfs2_super *osb,
			struct ocfs2_journal_handle *handle,
			handle_t *handle,
			struct inode *inode,
			struct buffer_head *fe_bh,
			u64 blkno,
+11 −11
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ static int ocfs2_readpage(struct file *file, struct page *page)

	mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));

	ret = ocfs2_meta_lock_with_page(inode, NULL, NULL, 0, page);
	ret = ocfs2_meta_lock_with_page(inode, NULL, 0, page);
	if (ret != 0) {
		if (ret == AOP_TRUNCATED_PAGE)
			unlock = 0;
@@ -305,7 +305,7 @@ static int ocfs2_prepare_write(struct file *file, struct page *page,

	mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);

	ret = ocfs2_meta_lock_with_page(inode, NULL, NULL, 0, page);
	ret = ocfs2_meta_lock_with_page(inode, NULL, 0, page);
	if (ret != 0) {
		mlog_errno(ret);
		goto out;
@@ -355,16 +355,16 @@ static int walk_page_buffers( handle_t *handle,
	return ret;
}

struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
							 struct page *page,
							 unsigned from,
							 unsigned to)
{
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle = NULL;
	int ret = 0;

	handle = ocfs2_start_trans(osb, NULL, OCFS2_INODE_UPDATE_CREDITS);
	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
	if (!handle) {
		ret = -ENOMEM;
		mlog_errno(ret);
@@ -372,7 +372,7 @@ struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
	}

	if (ocfs2_should_order_data(inode)) {
		ret = walk_page_buffers(handle->k_handle,
		ret = walk_page_buffers(handle,
					page_buffers(page),
					from, to, NULL,
					ocfs2_journal_dirty_data);
@@ -382,7 +382,7 @@ struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
out:
	if (ret) {
		if (handle)
			ocfs2_commit_trans(handle);
			ocfs2_commit_trans(osb, handle);
		handle = ERR_PTR(ret);
	}
	return handle;
@@ -394,7 +394,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
	int ret;
	struct buffer_head *di_bh = NULL;
	struct inode *inode = page->mapping->host;
	struct ocfs2_journal_handle *handle = NULL;
	handle_t *handle = NULL;
	struct ocfs2_dinode *di;

	mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
@@ -412,7 +412,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
	 *    stale inode allocation image (i_size, i_clusters, etc).
	 */

	ret = ocfs2_meta_lock_with_page(inode, NULL, &di_bh, 1, page);
	ret = ocfs2_meta_lock_with_page(inode, &di_bh, 1, page);
	if (ret != 0) {
		mlog_errno(ret);
		goto out;
@@ -464,7 +464,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
	}

out_commit:
	ocfs2_commit_trans(handle);
	ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle);
out_unlock_data:
	ocfs2_data_unlock(inode, 1);
out_unlock_meta:
@@ -490,7 +490,7 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
	 * accessed concurrently from multiple nodes.
	 */
	if (!INODE_JOURNAL(inode)) {
		err = ocfs2_meta_lock(inode, NULL, NULL, 0);
		err = ocfs2_meta_lock(inode, NULL, 0);
		if (err) {
			if (err != -ENOENT)
				mlog_errno(err);
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page,
			       unsigned from, unsigned to);

struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode,
handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
							 struct page *page,
							 unsigned from,
							 unsigned to);
Loading