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

Commit 1ca1a111 authored by Mark Fasheh's avatar Mark Fasheh
Browse files

ocfs2: fix sparse warnings in fs/ocfs2



None of these are actually harmful, but the noise makes looking for real
problems difficult.

Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 6e4b0d56
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2869,7 +2869,7 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
	tl = &tl_copy->id2.i_dealloc;
	num_recs = le16_to_cpu(tl->tl_used);
	mlog(0, "cleanup %u records from %llu\n", num_recs,
	     (unsigned long long)tl_copy->i_blkno);
	     (unsigned long long)le64_to_cpu(tl_copy->i_blkno));

	mutex_lock(&tl_inode->i_mutex);
	for(i = 0; i < num_recs; i++) {
@@ -3801,8 +3801,8 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb,
	fe = (struct ocfs2_dinode *) fe_bh->b_data;

	mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
	     "%llu\n", fe->i_clusters, new_i_clusters,
	     (unsigned long long)fe->i_size);
	     "%llu\n", le32_to_cpu(fe->i_clusters), new_i_clusters,
	     (unsigned long long)le64_to_cpu(fe->i_size));

	*tc = kzalloc(sizeof(struct ocfs2_truncate_context), GFP_KERNEL);
	if (!(*tc)) {
+2 −1
Original line number Diff line number Diff line
@@ -78,7 +78,8 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,

	if (!OCFS2_IS_VALID_DINODE(fe)) {
		mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n",
		     (unsigned long long)fe->i_blkno, 7, fe->i_signature);
		     (unsigned long long)le64_to_cpu(fe->i_blkno), 7,
		     fe->i_signature);
		goto bail;
	}

+4 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ bail:
	return parent;
}

static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len,
static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
			   int connectable)
{
	struct inode *inode = dentry->d_inode;
@@ -148,6 +148,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, __be32 *fh, int *max_len,
	int type = 1;
	u64 blkno;
	u32 generation;
	__le32 *fh = (__force __le32 *) fh_in;

	mlog_entry("(0x%p, '%.*s', 0x%p, %d, %d)\n", dentry,
		   dentry->d_name.len, dentry->d_name.name,
@@ -199,7 +200,7 @@ bail:
	return type;
}

static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh,
static struct dentry *ocfs2_decode_fh(struct super_block *sb, u32 *fh_in,
				      int fh_len, int fileid_type,
				      int (*acceptable)(void *context,
						        struct dentry *de),
@@ -207,6 +208,7 @@ static struct dentry *ocfs2_decode_fh(struct super_block *sb, __be32 *fh,
{
	struct ocfs2_inode_handle handle, parent;
	struct dentry *ret = NULL;
	__le32 *fh = (__force __le32 *) fh_in;

	mlog_entry("(0x%p, 0x%p, %d, %d, 0x%p, 0x%p)\n",
		   sb, fh, fh_len, fileid_type, acceptable, context);
+2 −1
Original line number Diff line number Diff line
@@ -713,7 +713,8 @@ restarted_transaction:
	}

	mlog(0, "fe: i_clusters = %u, i_size=%llu\n",
	     fe->i_clusters, (unsigned long long)fe->i_size);
	     le32_to_cpu(fe->i_clusters),
	     (unsigned long long)le64_to_cpu(fe->i_size));
	mlog(0, "inode: ip_clusters=%u, i_size=%lld\n",
	     OCFS2_I(inode)->ip_clusters, i_size_read(inode));

+7 −6
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
	int status = -EINVAL;

	mlog_entry("(0x%p, size:%llu)\n", inode,
		   (unsigned long long)fe->i_size);
		   (unsigned long long)le64_to_cpu(fe->i_size));

	sb = inode->i_sb;
	osb = OCFS2_SB(sb);
@@ -267,7 +267,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
		mlog(ML_ERROR,
		     "ip_blkno %llu != i_blkno %llu!\n",
		     (unsigned long long)OCFS2_I(inode)->ip_blkno,
		     (unsigned long long)fe->i_blkno);
		     (unsigned long long)le64_to_cpu(fe->i_blkno));

	inode->i_nlink = le16_to_cpu(fe->i_links_count);

@@ -320,7 +320,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
		 * the generation argument to
		 * ocfs2_inode_lock_res_init() will have to change.
		 */
		BUG_ON(fe->i_flags & cpu_to_le32(OCFS2_SYSTEM_FL));
		BUG_ON(le32_to_cpu(fe->i_flags) & OCFS2_SYSTEM_FL);

		ocfs2_inode_lock_res_init(&OCFS2_I(inode)->ip_meta_lockres,
					  OCFS2_LOCK_TYPE_META, 0, inode);
@@ -456,7 +456,8 @@ static int ocfs2_read_locked_inode(struct inode *inode,
	fe = (struct ocfs2_dinode *) bh->b_data;
	if (!OCFS2_IS_VALID_DINODE(fe)) {
		mlog(ML_ERROR, "Invalid dinode #%llu: signature = %.*s\n",
		     (unsigned long long)fe->i_blkno, 7, fe->i_signature);
		     (unsigned long long)le64_to_cpu(fe->i_blkno), 7,
		     fe->i_signature);
		goto bail;
	}

@@ -831,8 +832,8 @@ static int ocfs2_query_inode_wipe(struct inode *inode,
		     "Inode %llu (on-disk %llu) not orphaned! "
		     "Disk flags  0x%x, inode flags 0x%x\n",
		     (unsigned long long)oi->ip_blkno,
		     (unsigned long long)di->i_blkno, di->i_flags,
		     oi->ip_flags);
		     (unsigned long long)le64_to_cpu(di->i_blkno),
		     le32_to_cpu(di->i_flags), oi->ip_flags);
		goto bail;
	}

Loading