History

Merge tag 'ubifs-for-linus-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs

Pull UBI and UBIFS updates from Richard Weinberger: "UBI: - New interface to dump detailed erase counters - Fixes around wear-leveling UBIFS: - Minor cleanups - Fix for TNC dumping code" * tag 'ubifs-for-linus-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubi: ubi_get_ec_info: Fix compiling error 'cast specifies array type' ubi: Implement ioctl for detailed erase counters ubi: Expose interface for detailed erase counters ubifs: skip dumping tnc tree when zroot is null ubi: Revert "ubi: wl: Close down wear-leveling before nand is suspended" ubifs: ubifs_dump_leb: remove return from end of void function ubifs: dump_lpt_leb: remove return at end of void function ubi: Add a check for ubi_num

Linus Torvalds committed 1 year ago

Commit 350130a2 parents 2a9f04b 69146a87 files · +117 −35Browse files

Showing the changes to include/uapi (1 of 7 files). Show all

Unified · Split

include/uapi/mtd/ubi-user.h+33−0
@@ -175,6 +175,8 @@ · 174 unmodified lines
175175 #define UBI_IOCRPEB _IOW(UBI_IOC_MAGIC, 4, __s32)
176176 /* Force scrubbing on the specified PEB */
177177 #define UBI_IOCSPEB _IOW(UBI_IOC_MAGIC, 5, __s32)
178+/* Read detailed device erase counter information */
179+#define UBI_IOCECNFO _IOWR(UBI_IOC_MAGIC, 6, struct ubi_ecinfo_req)
178180
179181 /* ioctl commands of the UBI control character device */
180182
@@ -412,6 +414,37 @@ struct ubi_rnvol_req { · 231 unmodified lines
412414 } ents[UBI_MAX_RNVOL];
413415 } __packed;
414416
417+/**
418+ * struct ubi_ecinfo_req - a data structure used for requesting and receiving
419+ * erase block counter information from a UBI device.
420+ *
421+ * @start: index of first physical erase block to read (in)
422+ * @length: number of erase counters to read (in)
423+ * @read_length: number of erase counters that was actually read (out)
424+ * @padding: reserved for future, not used, has to be zeroed
425+ * @erase_counters: array of erase counter values (out)
426+ *
427+ * This structure is used to retrieve erase counter information for a specified
428+ * range of PEBs on a UBI device.
429+ * Erase counters are read from @start and attempts to read @length number of
430+ * erase counters.
431+ * The retrieved values are stored in the @erase_counters array. It is the
432+ * responsibility of the caller to allocate enough memory for storing @length
433+ * elements in the @erase_counters array.
434+ * If a block is bad or if the erase counter is unknown the corresponding value
435+ * in the array will be set to -1.
436+ * The @read_length field will indicate the number of erase counters actually
437+ * read. Typically @read_length will be limited due to memory or the number of
438+ * PEBs on the UBI device.
439+ */
440+struct ubi_ecinfo_req {
441+ __s32 start;
442+ __s32 length;
443+ __s32 read_length;
444+ __s8 padding[16];
445+ __s32 erase_counters[];
446+} __packed;
447+
415448 /**
416449 * struct ubi_leb_change_req - a data structure used in atomic LEB change
417450 * requests.