]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dm vdo: move indexer files into sub-directory
authorMike Snitzer <snitzer@kernel.org>
Thu, 8 Feb 2024 21:55:29 +0000 (15:55 -0600)
committerMike Snitzer <snitzer@kernel.org>
Mon, 4 Mar 2024 20:07:55 +0000 (15:07 -0500)
The goal is to assist high-level understanding of which code is
conceptually specific to VDO's indexer.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
36 files changed:
drivers/md/dm-vdo/Makefile
drivers/md/dm-vdo/data-vio.h
drivers/md/dm-vdo/dedupe.c
drivers/md/dm-vdo/indexer/chapter-index.c [moved from drivers/md/dm-vdo/chapter-index.c with 99% similarity]
drivers/md/dm-vdo/indexer/chapter-index.h [moved from drivers/md/dm-vdo/chapter-index.h with 100% similarity]
drivers/md/dm-vdo/indexer/config.c [moved from drivers/md/dm-vdo/config.c with 100% similarity]
drivers/md/dm-vdo/indexer/config.h [moved from drivers/md/dm-vdo/config.h with 100% similarity]
drivers/md/dm-vdo/indexer/delta-index.c [moved from drivers/md/dm-vdo/delta-index.c with 99% similarity]
drivers/md/dm-vdo/indexer/delta-index.h [moved from drivers/md/dm-vdo/delta-index.h with 99% similarity]
drivers/md/dm-vdo/indexer/funnel-requestqueue.c [moved from drivers/md/dm-vdo/funnel-requestqueue.c with 100% similarity]
drivers/md/dm-vdo/indexer/funnel-requestqueue.h [moved from drivers/md/dm-vdo/funnel-requestqueue.h with 100% similarity]
drivers/md/dm-vdo/indexer/geometry.c [moved from drivers/md/dm-vdo/geometry.c with 99% similarity]
drivers/md/dm-vdo/indexer/geometry.h [moved from drivers/md/dm-vdo/geometry.h with 100% similarity]
drivers/md/dm-vdo/indexer/hash-utils.h [moved from drivers/md/dm-vdo/hash-utils.h with 99% similarity]
drivers/md/dm-vdo/indexer/index-layout.c [moved from drivers/md/dm-vdo/index-layout.c with 99% similarity]
drivers/md/dm-vdo/indexer/index-layout.h [moved from drivers/md/dm-vdo/index-layout.h with 100% similarity]
drivers/md/dm-vdo/indexer/index-page-map.c [moved from drivers/md/dm-vdo/index-page-map.c with 99% similarity]
drivers/md/dm-vdo/indexer/index-page-map.h [moved from drivers/md/dm-vdo/index-page-map.h with 100% similarity]
drivers/md/dm-vdo/indexer/index-session.c [moved from drivers/md/dm-vdo/index-session.c with 99% similarity]
drivers/md/dm-vdo/indexer/index-session.h [moved from drivers/md/dm-vdo/index-session.h with 99% similarity]
drivers/md/dm-vdo/indexer/index.c [moved from drivers/md/dm-vdo/index.c with 99% similarity]
drivers/md/dm-vdo/indexer/index.h [moved from drivers/md/dm-vdo/index.h with 100% similarity]
drivers/md/dm-vdo/indexer/indexer.h [moved from drivers/md/dm-vdo/indexer.h with 100% similarity]
drivers/md/dm-vdo/indexer/io-factory.c [moved from drivers/md/dm-vdo/io-factory.c with 100% similarity]
drivers/md/dm-vdo/indexer/io-factory.h [moved from drivers/md/dm-vdo/io-factory.h with 100% similarity]
drivers/md/dm-vdo/indexer/open-chapter.c [moved from drivers/md/dm-vdo/open-chapter.c with 99% similarity]
drivers/md/dm-vdo/indexer/open-chapter.h [moved from drivers/md/dm-vdo/open-chapter.h with 100% similarity]
drivers/md/dm-vdo/indexer/radix-sort.c [moved from drivers/md/dm-vdo/radix-sort.c with 100% similarity]
drivers/md/dm-vdo/indexer/radix-sort.h [moved from drivers/md/dm-vdo/radix-sort.h with 100% similarity]
drivers/md/dm-vdo/indexer/sparse-cache.c [moved from drivers/md/dm-vdo/sparse-cache.c with 99% similarity]
drivers/md/dm-vdo/indexer/sparse-cache.h [moved from drivers/md/dm-vdo/sparse-cache.h with 100% similarity]
drivers/md/dm-vdo/indexer/volume-index.c [moved from drivers/md/dm-vdo/volume-index.c with 99% similarity]
drivers/md/dm-vdo/indexer/volume-index.h [moved from drivers/md/dm-vdo/volume-index.h with 99% similarity]
drivers/md/dm-vdo/indexer/volume.c [moved from drivers/md/dm-vdo/volume.c with 99% similarity]
drivers/md/dm-vdo/indexer/volume.h [moved from drivers/md/dm-vdo/volume.h with 99% similarity]
drivers/md/dm-vdo/uds-sysfs.c

index 32266ab04cc19b05f4b1e3e2c09e71856d6648cb..502a7a0acbdbb7ddf85bb7013c58c7ae1e6877b8 100644 (file)
@@ -1,50 +1,39 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
+ccflags-y := -I$(srctree)/$(src) -I$(srctree)/$(src)/indexer
+
 obj-$(CONFIG_DM_VDO) += dm-vdo.o
 
 dm-vdo-objs := \
        action-manager.o \
        admin-state.o \
        block-map.o \
-       chapter-index.o \
        completion.o \
-       config.o \
        data-vio.o \
        dedupe.o \
-       delta-index.o \
        dm-vdo-target.o \
        dump.o \
        encodings.o \
        errors.o \
        flush.o \
        funnel-queue.o \
-       funnel-requestqueue.o \
        funnel-workqueue.o \
-       geometry.o \
-       index-layout.o \
-       index.o \
-       index-page-map.o \
-       index-session.o \
        int-map.o \
-       io-factory.o \
        io-submitter.o \
        logger.o \
        logical-zone.o \
        memory-alloc.o \
        message-stats.o \
        murmurhash3.o \
-       open-chapter.o \
        packer.o \
        permassert.o \
        physical-zone.o \
        pool-sysfs.o \
        pool-sysfs-stats.o \
        priority-table.o \
-       radix-sort.o \
        recovery-journal.o \
        repair.o \
        slab-depot.o \
-       sparse-cache.o \
        status-codes.o \
        string-utils.o \
        sysfs.o \
@@ -54,6 +43,19 @@ dm-vdo-objs := \
        uds-sysfs.o \
        vdo.o \
        vio.o \
-       volume-index.o \
-       volume.o \
-       wait-queue.o
+       wait-queue.o \
+       indexer/chapter-index.o \
+       indexer/config.o \
+       indexer/delta-index.o \
+       indexer/funnel-requestqueue.o \
+       indexer/geometry.o \
+       indexer/index.o \
+       indexer/index-layout.o \
+       indexer/index-page-map.o \
+       indexer/index-session.o \
+       indexer/io-factory.o \
+       indexer/open-chapter.o \
+       indexer/radix-sort.o \
+       indexer/sparse-cache.o \
+       indexer/volume.o \
+       indexer/volume-index.o
index e7729623a6bb53a5107f34d8b3798f85e064aa3c..44fd0d8ccb769d9d5c21fddb30579016ec07b09b 100644 (file)
 #include <linux/bio.h>
 #include <linux/list.h>
 
-#include "indexer.h"
 #include "permassert.h"
 
+#include "indexer.h"
+
 #include "block-map.h"
 #include "completion.h"
 #include "constants.h"
index 942a50ef8b0d82cfbefecf3b2807377c81ecefe9..9468d7fad443564113329b53046f17afa6e3bc45 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/timer.h>
 
-#include "indexer.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "numeric.h"
 #include "permassert.h"
 #include "string-utils.h"
 
+#include "indexer.h"
+
 #include "action-manager.h"
 #include "admin-state.h"
 #include "completion.h"
similarity index 99%
rename from drivers/md/dm-vdo/chapter-index.c
rename to drivers/md/dm-vdo/indexer/chapter-index.c
index 9b9185c2c2374ac2629ffc0481fe8bce2b60ba84..6487825ada9060ce9c8a1cd60f66a5899ccff4ff 100644 (file)
@@ -6,12 +6,13 @@
 #include "chapter-index.h"
 
 #include "errors.h"
-#include "hash-utils.h"
-#include "indexer.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "permassert.h"
 
+#include "hash-utils.h"
+#include "indexer.h"
+
 int uds_make_open_chapter_index(struct open_chapter_index **chapter_index,
                                const struct index_geometry *geometry, u64 volume_nonce)
 {
similarity index 99%
rename from drivers/md/dm-vdo/delta-index.c
rename to drivers/md/dm-vdo/indexer/delta-index.c
index 66f51b5f8fd21d9ddf58b7344d3871654d56736c..4aace707545a255705b2497b451fc3b3a2fd956a 100644 (file)
 #include <linux/limits.h>
 #include <linux/log2.h>
 
-#include "config.h"
 #include "cpu.h"
 #include "errors.h"
-#include "indexer.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "numeric.h"
@@ -21,6 +19,9 @@
 #include "string-utils.h"
 #include "time-utils.h"
 
+#include "config.h"
+#include "indexer.h"
+
 /*
  * The entries in a delta index could be stored in a single delta list, but to reduce search times
  * and update costs it uses multiple delta lists. These lists are stored in a single chunk of
similarity index 99%
rename from drivers/md/dm-vdo/delta-index.h
rename to drivers/md/dm-vdo/indexer/delta-index.h
index b3b38fb440bfd2377ac2028ac6298e84ad13f64f..3d2ea19aef616d5763832c21a42f0e97983ef2ea 100644 (file)
@@ -8,11 +8,12 @@
 
 #include <linux/cache.h>
 
-#include "config.h"
-#include "io-factory.h"
 #include "numeric.h"
 #include "time-utils.h"
 
+#include "config.h"
+#include "io-factory.h"
+
 /*
  * A delta index is a key-value store, where each entry maps an address (the key) to a payload (the
  * value). The entries are sorted by address, and only the delta between successive addresses is
similarity index 99%
rename from drivers/md/dm-vdo/geometry.c
rename to drivers/md/dm-vdo/indexer/geometry.c
index 04c07195a01c68d51b275d5e4512a18d16469210..38c18283cdde8af9c0d1680c4255b78656677ee4 100644 (file)
@@ -8,13 +8,14 @@
 #include <linux/compiler.h>
 #include <linux/log2.h>
 
-#include "delta-index.h"
 #include "errors.h"
-#include "indexer.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "permassert.h"
 
+#include "delta-index.h"
+#include "indexer.h"
+
 /*
  * An index volume is divided into a fixed number of fixed-size chapters, each consisting of a
  * fixed number of fixed-size pages. The volume layout is defined by two constants and four
similarity index 99%
rename from drivers/md/dm-vdo/hash-utils.h
rename to drivers/md/dm-vdo/indexer/hash-utils.h
index e3b865bbe9b2cf98412476bca1f1488e476bb5af..6a8dd8ffea6ce5dd5a891e58da132d7abd59ad11 100644 (file)
@@ -6,9 +6,10 @@
 #ifndef UDS_HASH_UTILS_H
 #define UDS_HASH_UTILS_H
 
+#include "numeric.h"
+
 #include "geometry.h"
 #include "indexer.h"
-#include "numeric.h"
 
 /* Utilities for extracting portions of a request name for various uses. */
 
similarity index 99%
rename from drivers/md/dm-vdo/index-layout.c
rename to drivers/md/dm-vdo/indexer/index-layout.c
index 2da507b26fd5bd0e698e277687cca4075416b08d..af533aa270a86fb5918661bec3f979c0f6d1f2a8 100644 (file)
@@ -7,13 +7,14 @@
 
 #include <linux/random.h>
 
-#include "config.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "murmurhash3.h"
 #include "numeric.h"
-#include "open-chapter.h"
 #include "time-utils.h"
+
+#include "config.h"
+#include "open-chapter.h"
 #include "volume-index.h"
 
 /*
similarity index 99%
rename from drivers/md/dm-vdo/index-page-map.c
rename to drivers/md/dm-vdo/indexer/index-page-map.c
index 1bb12066ad1a2321c443a8d426d81d39839974cb..90d97c33a9c3278314ea5987852fef2f1cf2b5f3 100644 (file)
@@ -6,8 +6,6 @@
 #include "index-page-map.h"
 
 #include "errors.h"
-#include "hash-utils.h"
-#include "indexer.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "numeric.h"
@@ -15,6 +13,9 @@
 #include "string-utils.h"
 #include "thread-utils.h"
 
+#include "hash-utils.h"
+#include "indexer.h"
+
 /*
  * The index page map is conceptually a two-dimensional array indexed by chapter number and index
  * page number within the chapter. Each entry contains the number of the last delta list on that
similarity index 99%
rename from drivers/md/dm-vdo/index-session.c
rename to drivers/md/dm-vdo/indexer/index-session.c
index a482ccd3981ef159099d5846aa8ac8dab3296f5c..07b478f57c6812008ecf5e320248216fd87c276a 100644 (file)
@@ -7,13 +7,14 @@
 
 #include <linux/atomic.h>
 
-#include "funnel-requestqueue.h"
-#include "index.h"
-#include "index-layout.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "time-utils.h"
 
+#include "funnel-requestqueue.h"
+#include "index.h"
+#include "index-layout.h"
+
 /*
  * The index session contains a lock (the request_mutex) which ensures that only one thread can
  * change the state of its index at a time. The state field indicates the current state of the
similarity index 99%
rename from drivers/md/dm-vdo/index-session.h
rename to drivers/md/dm-vdo/indexer/index-session.h
index 733d10f8a56cd2e6ba6b81cbfc6c453da4bf790b..066648f6e062684211d7649d68e220b3dc1f94b0 100644 (file)
@@ -9,9 +9,10 @@
 #include <linux/atomic.h>
 #include <linux/cache.h>
 
+#include "thread-utils.h"
+
 #include "config.h"
 #include "indexer.h"
-#include "thread-utils.h"
 
 /*
  * The index session mediates all interactions with a UDS index. Once the index session is created,
similarity index 99%
rename from drivers/md/dm-vdo/index.c
rename to drivers/md/dm-vdo/indexer/index.c
index 9d4a8e5cbaadbd36dac09f9a1ef0bbb90b99e250..35e3b45cdb713c9cb452e4f14ba7c95ceaa37a8e 100644 (file)
@@ -6,10 +6,11 @@
 
 #include "index.h"
 
-#include "funnel-requestqueue.h"
-#include "hash-utils.h"
 #include "logger.h"
 #include "memory-alloc.h"
+
+#include "funnel-requestqueue.h"
+#include "hash-utils.h"
 #include "sparse-cache.h"
 
 static const u64 NO_LAST_SAVE = U64_MAX;
similarity index 99%
rename from drivers/md/dm-vdo/open-chapter.c
rename to drivers/md/dm-vdo/indexer/open-chapter.c
index d9d6e5d45bfbde25b1180f5645d7e8451b1bd029..da16afaec07f215addd15e02f736014f57dea53e 100644 (file)
@@ -7,13 +7,14 @@
 
 #include <linux/log2.h>
 
-#include "config.h"
-#include "hash-utils.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "numeric.h"
 #include "permassert.h"
 
+#include "config.h"
+#include "hash-utils.h"
+
 /*
  * Each index zone has a dedicated open chapter zone structure which gets an equal share of the
  * open chapter space. Records are assigned to zones based on their record name. Within each zone,
similarity index 99%
rename from drivers/md/dm-vdo/sparse-cache.c
rename to drivers/md/dm-vdo/indexer/sparse-cache.c
index b43a626a42decb4a03ac07f3ac05df7b9bee4a38..f2141de6ed00e6e3c4d463d76b97660ca40e0c29 100644 (file)
@@ -9,13 +9,14 @@
 #include <linux/delay.h>
 #include <linux/dm-bufio.h>
 
-#include "chapter-index.h"
-#include "config.h"
-#include "index.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "permassert.h"
 
+#include "chapter-index.h"
+#include "config.h"
+#include "index.h"
+
 /*
  * Since the cache is small, it is implemented as a simple array of cache entries. Searching for a
  * specific virtual chapter is implemented as a linear search. The cache replacement policy is
similarity index 99%
rename from drivers/md/dm-vdo/volume-index.c
rename to drivers/md/dm-vdo/indexer/volume-index.c
index 36e3c2e3d799a4d8496876998ca4d5aaac7c24b4..8cbd9280c4bd0a1be4d617a4f3cf3c2504721c55 100644 (file)
 #include <linux/compiler.h>
 #include <linux/log2.h>
 
-#include "config.h"
 #include "errors.h"
-#include "geometry.h"
-#include "hash-utils.h"
-#include "indexer.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "numeric.h"
 #include "permassert.h"
 #include "thread-utils.h"
 
+#include "config.h"
+#include "geometry.h"
+#include "hash-utils.h"
+#include "indexer.h"
+
 /*
  * The volume index is a combination of two separate subindexes, one containing sparse hook entries
  * (retained for all chapters), and one containing the remaining entries (retained only for the
similarity index 99%
rename from drivers/md/dm-vdo/volume-index.h
rename to drivers/md/dm-vdo/indexer/volume-index.h
index 66bf14fddc90642a3731e63f2604305e6d17243b..583998c547b7b5fdc8d0c2fc00ea708abf3a07b4 100644 (file)
@@ -8,10 +8,11 @@
 
 #include <linux/limits.h>
 
+#include "thread-utils.h"
+
 #include "config.h"
 #include "delta-index.h"
 #include "indexer.h"
-#include "thread-utils.h"
 
 /*
  * The volume index is the primary top-level index for UDS. It contains records which map a record
similarity index 99%
rename from drivers/md/dm-vdo/volume.c
rename to drivers/md/dm-vdo/indexer/volume.c
index 60416dc8a9d70f34de695873c13ebcc1d89763b0..eca83b6cab35617404071b46ba9e164b5952e28c 100644 (file)
@@ -9,19 +9,20 @@
 #include <linux/dm-bufio.h>
 #include <linux/err.h>
 
-#include "chapter-index.h"
-#include "config.h"
 #include "errors.h"
-#include "geometry.h"
-#include "hash-utils.h"
-#include "index.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "permassert.h"
-#include "sparse-cache.h"
 #include "string-utils.h"
 #include "thread-utils.h"
 
+#include "chapter-index.h"
+#include "config.h"
+#include "geometry.h"
+#include "hash-utils.h"
+#include "index.h"
+#include "sparse-cache.h"
+
 /*
  * The first block of the volume layout is reserved for the volume header, which is no longer used.
  * The remainder of the volume is divided into chapters consisting of several pages of records, and
similarity index 99%
rename from drivers/md/dm-vdo/volume.h
rename to drivers/md/dm-vdo/indexer/volume.h
index 290de5cbf9ec86a0d7af6ce9dfbe576ccf834026..8679a5e55347a9748dd206500afe69c4632b1595 100644 (file)
 #include <linux/dm-bufio.h>
 #include <linux/limits.h>
 
+#include "permassert.h"
+#include "thread-utils.h"
+
 #include "chapter-index.h"
 #include "config.h"
 #include "geometry.h"
 #include "indexer.h"
 #include "index-layout.h"
 #include "index-page-map.h"
-#include "permassert.h"
 #include "radix-sort.h"
 #include "sparse-cache.h"
-#include "thread-utils.h"
 
 /*
  * The volume manages deduplication records on permanent storage. The term "volume" can also refer
index 1548092e7de1db60c9493050987db49bf25600a3..2c4fb277ba388b4a121ab232813dc39207fb6f3c 100644 (file)
@@ -9,11 +9,12 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 
-#include "indexer.h"
 #include "logger.h"
 #include "memory-alloc.h"
 #include "string-utils.h"
 
+#include "indexer.h"
+
 #define UDS_SYSFS_NAME "uds"
 
 static struct {