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

Commit 967f44d6 authored by Dolev Raviv's avatar Dolev Raviv
Browse files

fs: ubifs: add ubi device index to trace



When running with multiple ubi mounted file systems, there is no way to
distinguish between messages from the different mounted fs. The device
index helps distinguishing between the mounted fs messages while
debugging.

Change-Id: I8f16af689198c643ec2c82e77a26818e583b4c29
Signed-off-by: default avatarDolev Raviv <draviv@codeaurora.org>
parent 458bbce8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -510,7 +510,7 @@ again:
			c->bi.nospace_rp = 1;
		smp_wmb();
	} else
		ubifs_err("cannot budget space, error %d", err);
		ubifs_err("cannot budget space, error %d", c->vi.ubi_num, err);
	return err;
}

+7 −6
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ out_cancel:
out_up:
	up_write(&c->commit_sem);
out:
	ubifs_err("commit failed, error %d", err);
	ubifs_err("commit failed, error %d", c->vi.ubi_num, err);
	spin_lock(&c->cs_lock);
	c->cmt_state = COMMIT_BROKEN;
	wake_up(&c->cmt_wq);
@@ -293,7 +293,7 @@ int ubifs_bg_thread(void *info)
	int err;
	struct ubifs_info *c = info;

	ubifs_msg("background thread \"%s\" started, PID %d",
	ubifs_msg("background thread \"%s\" started, PID %d", c->vi.ubi_num,
		  c->bgt_name, current->pid);
	set_freezable();

@@ -328,7 +328,8 @@ int ubifs_bg_thread(void *info)
		cond_resched();
	}

	ubifs_msg("background thread \"%s\" stops", c->bgt_name);
	ubifs_msg("background thread \"%s\" stops", c->vi.ubi_num,
			c->bgt_name);
	return 0;
}

@@ -716,13 +717,13 @@ out:
	return 0;

out_dump:
	ubifs_err("dumping index node (iip=%d)", i->iip);
	ubifs_err("dumping index node (iip=%d)", c->vi.ubi_num, i->iip);
	ubifs_dump_node(c, idx);
	list_del(&i->list);
	kfree(i);
	if (!list_empty(&list)) {
		i = list_entry(list.prev, struct idx_node, list);
		ubifs_err("dumping parent index node");
		ubifs_err("dumping parent index node", c->vi.ubi_num);
		ubifs_dump_node(c, &i->idx);
	}
out_free:
@@ -731,7 +732,7 @@ out_free:
		list_del(&i->list);
		kfree(i);
	}
	ubifs_err("failed, error %d", err);
	ubifs_err("failed, error %d", c->vi.ubi_num, err);
	if (err > 0)
		err = -EINVAL;
	return err;
+14 −9
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];

/**
 * ubifs_compress - compress data.
 * @c: UBIFS file-system description object
 * @in_buf: data to compress
 * @in_len: length of the data to compress
 * @out_buf: output buffer where compressed data should be stored
@@ -92,8 +93,8 @@ struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
 * Note, if the input buffer was not compressed, it is copied to the output
 * buffer and %UBIFS_COMPR_NONE is returned in @compr_type.
 */
void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len,
		    int *compr_type)
void ubifs_compress(struct ubifs_info *c, const void *in_buf, int in_len,
		    void *out_buf, int *out_len, int *compr_type)
{
	int err;
	struct ubifs_compressor *compr = ubifs_compressors[*compr_type];
@@ -113,7 +114,7 @@ void ubifs_compress(const void *in_buf, int in_len, void *out_buf, int *out_len,
		mutex_unlock(compr->comp_mutex);
	if (unlikely(err)) {
		ubifs_warn("cannot compress %d bytes, compressor %s, error %d, leave data uncompressed",
			   in_len, compr->name, err);
				c->vi.ubi_num, in_len, compr->name, err);
		 goto no_compr;
	}

@@ -134,6 +135,7 @@ no_compr:

/**
 * ubifs_decompress - decompress data.
 * @c: UBIFS file-system description object
 * @in_buf: data to decompress
 * @in_len: length of the data to decompress
 * @out_buf: output buffer where decompressed data should
@@ -144,21 +146,23 @@ no_compr:
 * The length of the uncompressed data is returned in @out_len. This functions
 * returns %0 on success or a negative error code on failure.
 */
int ubifs_decompress(const void *in_buf, int in_len, void *out_buf,
		     int *out_len, int compr_type)
int ubifs_decompress(struct ubifs_info *c, const void *in_buf, int in_len,
		     void *out_buf, int *out_len, int compr_type)
{
	int err;
	struct ubifs_compressor *compr;

	if (unlikely(compr_type < 0 || compr_type >= UBIFS_COMPR_TYPES_CNT)) {
		ubifs_err("invalid compression type %d", compr_type);
		ubifs_err("invalid compression type %d",
				c->vi.ubi_num, compr_type);
		return -EINVAL;
	}

	compr = ubifs_compressors[compr_type];

	if (unlikely(!compr->capi_name)) {
		ubifs_err("%s compression is not compiled in", compr->name);
		ubifs_err("%s compression is not compiled in",
				c->vi.ubi_num, compr->name);
		return -EINVAL;
	}

@@ -176,7 +180,7 @@ int ubifs_decompress(const void *in_buf, int in_len, void *out_buf,
		mutex_unlock(compr->decomp_mutex);
	if (err)
		ubifs_err("cannot decompress %d bytes, compressor %s, error %d",
			  in_len, compr->name, err);
			  c->vi.ubi_num, in_len, compr->name, err);

	return err;
}
@@ -194,7 +198,8 @@ static int __init compr_init(struct ubifs_compressor *compr)
		compr->cc = crypto_alloc_comp(compr->capi_name, 0, 0);
		if (IS_ERR(compr->cc)) {
			ubifs_err("cannot initialize compressor %s, error %ld",
				  compr->name, PTR_ERR(compr->cc));
					UBIFS_UNKNOWN_DEV_NUM, compr->name,
					PTR_ERR(compr->cc));
			return PTR_ERR(compr->cc);
		}
	}
+123 −87

File changed.

Preview size limit exceeded, changes collapsed.

+10 −6

File changed.

Preview size limit exceeded, changes collapsed.

Loading