diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 22:55:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-24 22:55:41 -0400 |
commit | 88875667ebbcb95da3f93a4cf657d5dad7db9673 (patch) | |
tree | 7ac0e4fd89c0dde4cb0ec22fd9f8ba9c71c2f8af | |
parent | 8b306a2e7c8b23d65682fd70d861e2ba2ae10926 (diff) | |
parent | c27cb97218b3e72417ffc5e73dce488844017b39 (diff) |
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
-rw-r--r-- | MAINTAINERS | 3 | ||||
-rw-r--r-- | drivers/mtd/ubi/misc.c | 49 | ||||
-rw-r--r-- | drivers/mtd/ubi/ubi.h | 16 | ||||
-rw-r--r-- | fs/ubifs/Makefile | 1 | ||||
-rw-r--r-- | fs/ubifs/misc.c | 57 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 41 | ||||
-rw-r--r-- | fs/ubifs/xattr.c | 1 |
7 files changed, 136 insertions, 32 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 32bafda47c2f..cdee67fa9156 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -11326,12 +11326,13 @@ S: Maintained | |||
11326 | F: drivers/scsi/u14-34f.c | 11326 | F: drivers/scsi/u14-34f.c |
11327 | 11327 | ||
11328 | UBI FILE SYSTEM (UBIFS) | 11328 | UBI FILE SYSTEM (UBIFS) |
11329 | M: Richard Weinberger <richard@nod.at> | ||
11329 | M: Artem Bityutskiy <dedekind1@gmail.com> | 11330 | M: Artem Bityutskiy <dedekind1@gmail.com> |
11330 | M: Adrian Hunter <adrian.hunter@intel.com> | 11331 | M: Adrian Hunter <adrian.hunter@intel.com> |
11331 | L: linux-mtd@lists.infradead.org | 11332 | L: linux-mtd@lists.infradead.org |
11332 | T: git git://git.infradead.org/ubifs-2.6.git | 11333 | T: git git://git.infradead.org/ubifs-2.6.git |
11333 | W: http://www.linux-mtd.infradead.org/doc/ubifs.html | 11334 | W: http://www.linux-mtd.infradead.org/doc/ubifs.html |
11334 | S: Maintained | 11335 | S: Supported |
11335 | F: Documentation/filesystems/ubifs.txt | 11336 | F: Documentation/filesystems/ubifs.txt |
11336 | F: fs/ubifs/ | 11337 | F: fs/ubifs/ |
11337 | 11338 | ||
diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c index 2a45ac210b16..989036c681b8 100644 --- a/drivers/mtd/ubi/misc.c +++ b/drivers/mtd/ubi/misc.c | |||
@@ -153,3 +153,52 @@ int ubi_check_pattern(const void *buf, uint8_t patt, int size) | |||
153 | return 0; | 153 | return 0; |
154 | return 1; | 154 | return 1; |
155 | } | 155 | } |
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 --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 2974b67f6c6c..dadc6a9d5755 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h | |||
@@ -49,15 +49,19 @@ | |||
49 | /* UBI name used for character devices, sysfs, etc */ | 49 | /* UBI name used for character devices, sysfs, etc */ |
50 | #define UBI_NAME_STR "ubi" | 50 | #define UBI_NAME_STR "ubi" |
51 | 51 | ||
52 | struct ubi_device; | ||
53 | |||
52 | /* Normal UBI messages */ | 54 | /* Normal UBI messages */ |
53 | #define ubi_msg(ubi, fmt, ...) pr_notice(UBI_NAME_STR "%d: " fmt "\n", \ | 55 | __printf(2, 3) |
54 | ubi->ubi_num, ##__VA_ARGS__) | 56 | void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...); |
57 | |||
55 | /* UBI warning messages */ | 58 | /* UBI warning messages */ |
56 | #define ubi_warn(ubi, fmt, ...) pr_warn(UBI_NAME_STR "%d warning: %s: " fmt "\n", \ | 59 | __printf(2, 3) |
57 | ubi->ubi_num, __func__, ##__VA_ARGS__) | 60 | void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...); |
61 | |||
58 | /* UBI error messages */ | 62 | /* UBI error messages */ |
59 | #define ubi_err(ubi, fmt, ...) pr_err(UBI_NAME_STR "%d error: %s: " fmt "\n", \ | 63 | __printf(2, 3) |
60 | ubi->ubi_num, __func__, ##__VA_ARGS__) | 64 | void ubi_err(const struct ubi_device *ubi, const char *fmt, ...); |
61 | 65 | ||
62 | /* Background thread name pattern */ | 66 | /* Background thread name pattern */ |
63 | #define UBI_BGT_NAME_PATTERN "ubi_bgt%dd" | 67 | #define UBI_BGT_NAME_PATTERN "ubi_bgt%dd" |
diff --git a/fs/ubifs/Makefile b/fs/ubifs/Makefile index 2c6f0cb816b4..c54a24360f85 100644 --- a/fs/ubifs/Makefile +++ b/fs/ubifs/Makefile | |||
@@ -4,3 +4,4 @@ ubifs-y += shrinker.o journal.o file.o dir.o super.o sb.o io.o | |||
4 | ubifs-y += tnc.o master.o scan.o replay.o log.o commit.o gc.o orphan.o | 4 | ubifs-y += tnc.o master.o scan.o replay.o log.o commit.o gc.o orphan.o |
5 | ubifs-y += budget.o find.o tnc_commit.o compress.o lpt.o lprops.o | 5 | ubifs-y += budget.o find.o tnc_commit.o compress.o lpt.o lprops.o |
6 | ubifs-y += recovery.o ioctl.o lpt_commit.o tnc_misc.o xattr.o debug.o | 6 | ubifs-y += recovery.o ioctl.o lpt_commit.o tnc_misc.o xattr.o debug.o |
7 | ubifs-y += misc.o | ||
diff --git a/fs/ubifs/misc.c b/fs/ubifs/misc.c new file mode 100644 index 000000000000..486a2844949f --- /dev/null +++ b/fs/ubifs/misc.c | |||
@@ -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 --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index a5697de763f5..c2a57e193a81 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -42,30 +42,6 @@ | |||
42 | /* Version of this UBIFS implementation */ | 42 | /* Version of this UBIFS implementation */ |
43 | #define UBIFS_VERSION 1 | 43 | #define UBIFS_VERSION 1 |
44 | 44 | ||
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 | |||
69 | /* UBIFS file system VFS magic number */ | 45 | /* UBIFS file system VFS magic number */ |
70 | #define UBIFS_SUPER_MAGIC 0x24051905 | 46 | #define UBIFS_SUPER_MAGIC 0x24051905 |
71 | 47 | ||
@@ -1802,4 +1778,21 @@ int ubifs_decompress(const struct ubifs_info *c, const void *buf, int len, | |||
1802 | #include "misc.h" | 1778 | #include "misc.h" |
1803 | #include "key.h" | 1779 | #include "key.h" |
1804 | 1780 | ||
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 | |||
1805 | #endif /* !__UBIFS_H__ */ | 1798 | #endif /* !__UBIFS_H__ */ |
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index c7f4d434d098..b043e044121d 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c | |||
@@ -59,7 +59,6 @@ | |||
59 | #include <linux/fs.h> | 59 | #include <linux/fs.h> |
60 | #include <linux/slab.h> | 60 | #include <linux/slab.h> |
61 | #include <linux/xattr.h> | 61 | #include <linux/xattr.h> |
62 | #include <linux/posix_acl_xattr.h> | ||
63 | 62 | ||
64 | /* | 63 | /* |
65 | * Limit the number of extended attributes per inode so that the total size | 64 | * Limit the number of extended attributes per inode so that the total size |