Skip to content

Commit 8887566

Browse files
committed
Merge tag 'upstream-4.6-rc1' of git://git.infradead.org/linux-ubifs
Pull UBI/UBIFS updates from Richard Weinberger: "This contains cleanups and a maintainer update for UBI and UBIFS" * tag 'upstream-4.6-rc1' of git://git.infradead.org/linux-ubifs: ubifs: Remove unused header MAINTAINERS: Update UBIFS entry mtd: ubi: Add logging functions ubi_msg, ubi_warn and ubi_err ubifs: Add logging functions for ubifs_msg, ubifs_err and ubifs_warn
2 parents 8b306a2 + c27cb97 commit 8887566

File tree

7 files changed

+136
-32
lines changed

7 files changed

+136
-32
lines changed

Diff for: MAINTAINERS

+2-1
Original file line numberDiff line numberDiff line change
@@ -11326,12 +11326,13 @@ S: Maintained
1132611326
F: drivers/scsi/u14-34f.c
1132711327

1132811328
UBI FILE SYSTEM (UBIFS)
11329+
M: Richard Weinberger <[email protected]>
1132911330
M: Artem Bityutskiy <[email protected]>
1133011331
M: Adrian Hunter <[email protected]>
1133111332
1133211333
T: git git://git.infradead.org/ubifs-2.6.git
1133311334
W: http://www.linux-mtd.infradead.org/doc/ubifs.html
11334-
S: Maintained
11335+
S: Supported
1133511336
F: Documentation/filesystems/ubifs.txt
1133611337
F: fs/ubifs/
1133711338

Diff for: drivers/mtd/ubi/misc.c

+49
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,52 @@ int ubi_check_pattern(const void *buf, uint8_t patt, int size)
153153
return 0;
154154
return 1;
155155
}
156+
157+
/* Normal UBI messages */
158+
void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...)
159+
{
160+
struct va_format vaf;
161+
va_list args;
162+
163+
va_start(args, fmt);
164+
165+
vaf.fmt = fmt;
166+
vaf.va = &args;
167+
168+
pr_notice(UBI_NAME_STR "%d: %pV\n", ubi->ubi_num, &vaf);
169+
170+
va_end(args);
171+
}
172+
173+
/* UBI warning messages */
174+
void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...)
175+
{
176+
struct va_format vaf;
177+
va_list args;
178+
179+
va_start(args, fmt);
180+
181+
vaf.fmt = fmt;
182+
vaf.va = &args;
183+
184+
pr_warn(UBI_NAME_STR "%d warning: %ps: %pV\n",
185+
ubi->ubi_num, __builtin_return_address(0), &vaf);
186+
187+
va_end(args);
188+
}
189+
190+
/* UBI error messages */
191+
void ubi_err(const struct ubi_device *ubi, const char *fmt, ...)
192+
{
193+
struct va_format vaf;
194+
va_list args;
195+
196+
va_start(args, fmt);
197+
198+
vaf.fmt = fmt;
199+
vaf.va = &args;
200+
201+
pr_err(UBI_NAME_STR "%d error: %ps: %pV\n",
202+
ubi->ubi_num, __builtin_return_address(0), &vaf);
203+
va_end(args);
204+
}

Diff for: drivers/mtd/ubi/ubi.h

+10-6
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,19 @@
4949
/* UBI name used for character devices, sysfs, etc */
5050
#define UBI_NAME_STR "ubi"
5151

52+
struct ubi_device;
53+
5254
/* Normal UBI messages */
53-
#define ubi_msg(ubi, fmt, ...) pr_notice(UBI_NAME_STR "%d: " fmt "\n", \
54-
ubi->ubi_num, ##__VA_ARGS__)
55+
__printf(2, 3)
56+
void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...);
57+
5558
/* UBI warning messages */
56-
#define ubi_warn(ubi, fmt, ...) pr_warn(UBI_NAME_STR "%d warning: %s: " fmt "\n", \
57-
ubi->ubi_num, __func__, ##__VA_ARGS__)
59+
__printf(2, 3)
60+
void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...);
61+
5862
/* UBI error messages */
59-
#define ubi_err(ubi, fmt, ...) pr_err(UBI_NAME_STR "%d error: %s: " fmt "\n", \
60-
ubi->ubi_num, __func__, ##__VA_ARGS__)
63+
__printf(2, 3)
64+
void ubi_err(const struct ubi_device *ubi, const char *fmt, ...);
6165

6266
/* Background thread name pattern */
6367
#define UBI_BGT_NAME_PATTERN "ubi_bgt%dd"

Diff for: fs/ubifs/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ ubifs-y += shrinker.o journal.o file.o dir.o super.o sb.o io.o
44
ubifs-y += tnc.o master.o scan.o replay.o log.o commit.o gc.o orphan.o
55
ubifs-y += budget.o find.o tnc_commit.o compress.o lpt.o lprops.o
66
ubifs-y += recovery.o ioctl.o lpt_commit.o tnc_misc.o xattr.o debug.o
7+
ubifs-y += misc.o

Diff for: fs/ubifs/misc.c

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#include <linux/kernel.h>
2+
#include "ubifs.h"
3+
4+
/* Normal UBIFS messages */
5+
void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...)
6+
{
7+
struct va_format vaf;
8+
va_list args;
9+
10+
va_start(args, fmt);
11+
12+
vaf.fmt = fmt;
13+
vaf.va = &args;
14+
15+
pr_notice("UBIFS (ubi%d:%d): %pV\n",
16+
c->vi.ubi_num, c->vi.vol_id, &vaf);
17+
18+
va_end(args);
19+
} \
20+
21+
/* UBIFS error messages */
22+
void ubifs_err(const struct ubifs_info *c, const char *fmt, ...)
23+
{
24+
struct va_format vaf;
25+
va_list args;
26+
27+
va_start(args, fmt);
28+
29+
vaf.fmt = fmt;
30+
vaf.va = &args;
31+
32+
pr_err("UBIFS error (ubi%d:%d pid %d): %ps: %pV\n",
33+
c->vi.ubi_num, c->vi.vol_id, current->pid,
34+
__builtin_return_address(0),
35+
&vaf);
36+
37+
va_end(args);
38+
} \
39+
40+
/* UBIFS warning messages */
41+
void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...)
42+
{
43+
struct va_format vaf;
44+
va_list args;
45+
46+
va_start(args, fmt);
47+
48+
vaf.fmt = fmt;
49+
vaf.va = &args;
50+
51+
pr_warn("UBIFS warning (ubi%d:%d pid %d): %ps: %pV\n",
52+
c->vi.ubi_num, c->vi.vol_id, current->pid,
53+
__builtin_return_address(0),
54+
&vaf);
55+
56+
va_end(args);
57+
}

Diff for: fs/ubifs/ubifs.h

+17-24
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,6 @@
4242
/* Version of this UBIFS implementation */
4343
#define UBIFS_VERSION 1
4444

45-
/* Normal UBIFS messages */
46-
#define ubifs_msg(c, fmt, ...) \
47-
pr_notice("UBIFS (ubi%d:%d): " fmt "\n", \
48-
(c)->vi.ubi_num, (c)->vi.vol_id, ##__VA_ARGS__)
49-
/* UBIFS error messages */
50-
#define ubifs_err(c, fmt, ...) \
51-
pr_err("UBIFS error (ubi%d:%d pid %d): %s: " fmt "\n", \
52-
(c)->vi.ubi_num, (c)->vi.vol_id, current->pid, \
53-
__func__, ##__VA_ARGS__)
54-
/* UBIFS warning messages */
55-
#define ubifs_warn(c, fmt, ...) \
56-
pr_warn("UBIFS warning (ubi%d:%d pid %d): %s: " fmt "\n", \
57-
(c)->vi.ubi_num, (c)->vi.vol_id, current->pid, \
58-
__func__, ##__VA_ARGS__)
59-
/*
60-
* A variant of 'ubifs_err()' which takes the UBIFS file-sytem description
61-
* object as an argument.
62-
*/
63-
#define ubifs_errc(c, fmt, ...) \
64-
do { \
65-
if (!(c)->probing) \
66-
ubifs_err(c, fmt, ##__VA_ARGS__); \
67-
} while (0)
68-
6945
/* UBIFS file system VFS magic number */
7046
#define UBIFS_SUPER_MAGIC 0x24051905
7147

@@ -1802,4 +1778,21 @@ int ubifs_decompress(const struct ubifs_info *c, const void *buf, int len,
18021778
#include "misc.h"
18031779
#include "key.h"
18041780

1781+
/* Normal UBIFS messages */
1782+
__printf(2, 3)
1783+
void ubifs_msg(const struct ubifs_info *c, const char *fmt, ...);
1784+
__printf(2, 3)
1785+
void ubifs_err(const struct ubifs_info *c, const char *fmt, ...);
1786+
__printf(2, 3)
1787+
void ubifs_warn(const struct ubifs_info *c, const char *fmt, ...);
1788+
/*
1789+
* A variant of 'ubifs_err()' which takes the UBIFS file-sytem description
1790+
* object as an argument.
1791+
*/
1792+
#define ubifs_errc(c, fmt, ...) \
1793+
do { \
1794+
if (!(c)->probing) \
1795+
ubifs_err(c, fmt, ##__VA_ARGS__); \
1796+
} while (0)
1797+
18051798
#endif /* !__UBIFS_H__ */

Diff for: fs/ubifs/xattr.c

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#include <linux/fs.h>
6060
#include <linux/slab.h>
6161
#include <linux/xattr.h>
62-
#include <linux/posix_acl_xattr.h>
6362

6463
/*
6564
* Limit the number of extended attributes per inode so that the total size

0 commit comments

Comments
 (0)