Skip to content

Commit

Permalink
6.4: Update bcachefs
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Gorski <[email protected]>
  • Loading branch information
sirlucjan committed Aug 24, 2023
1 parent 7c0ff4f commit a5393f1
Showing 1 changed file with 31 additions and 43 deletions.
74 changes: 31 additions & 43 deletions 6.4/misc/0001-bcachefs.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 820e31825fe7ac5b18f92499b6983f616c4c828f Mon Sep 17 00:00:00 2001
From a99389f898b9d7dc1397b442f426f8d513a8e135 Mon Sep 17 00:00:00 2001
From: Piotr Gorski <[email protected]>
Date: Wed, 23 Aug 2023 20:03:00 +0200
Date: Thu, 24 Aug 2023 18:34:15 +0200
Subject: [PATCH] bcachefs

Signed-off-by: Piotr Gorski <[email protected]>
Expand Down Expand Up @@ -160,8 +160,8 @@ Signed-off-by: Piotr Gorski <[email protected]>
fs/bcachefs/lru.h | 69 +
fs/bcachefs/migrate.c | 182 +
fs/bcachefs/migrate.h | 7 +
fs/bcachefs/move.c | 1168 ++++++
fs/bcachefs/move.h | 96 +
fs/bcachefs/move.c | 1162 ++++++
fs/bcachefs/move.h | 95 +
fs/bcachefs/move_types.h | 36 +
fs/bcachefs/movinggc.c | 423 +++
fs/bcachefs/movinggc.h | 12 +
Expand Down Expand Up @@ -206,7 +206,7 @@ Signed-off-by: Piotr Gorski <[email protected]>
fs/bcachefs/super.c | 2017 +++++++++++
fs/bcachefs/super.h | 52 +
fs/bcachefs/super_types.h | 51 +
fs/bcachefs/sysfs.c | 1064 ++++++
fs/bcachefs/sysfs.c | 1059 ++++++
fs/bcachefs/sysfs.h | 48 +
fs/bcachefs/tests.c | 970 +++++
fs/bcachefs/tests.h | 15 +
Expand Down Expand Up @@ -328,7 +328,7 @@ Signed-off-by: Piotr Gorski <[email protected]>
scripts/Makefile.lib | 2 +-
scripts/kallsyms.c | 13 +
scripts/module.lds.S | 7 +
323 files changed, 97819 insertions(+), 927 deletions(-)
323 files changed, 97807 insertions(+), 927 deletions(-)
create mode 100644 fs/bcachefs/Kconfig
create mode 100644 fs/bcachefs/Makefile
create mode 100644 fs/bcachefs/acl.c
Expand Down Expand Up @@ -72460,10 +72460,10 @@ index 000000000..027efaa0d
+#endif /* _BCACHEFS_MIGRATE_H */
diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
new file mode 100644
index 000000000..052726739
index 000000000..fb76a1dac
--- /dev/null
+++ b/fs/bcachefs/move.c
@@ -0,0 +1,1168 @@
@@ -0,0 +1,1162 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include "bcachefs.h"
Expand Down Expand Up @@ -73569,46 +73569,40 @@ index 000000000..052726739
+ return ret;
+}
+
+void bch2_data_jobs_to_text(struct printbuf *out, struct bch_fs *c)
+{
+ struct bch_move_stats *stats;
+
+ mutex_lock(&c->data_progress_lock);
+ list_for_each_entry(stats, &c->data_progress_list, list) {
+ prt_printf(out, "%s: data type %s btree_id %s position: ",
+ stats->name,
+ bch2_data_types[stats->data_type],
+ bch2_btree_ids[stats->btree_id]);
+ bch2_bpos_to_text(out, stats->pos);
+ prt_printf(out, "%s", "\n");
+ }
+ mutex_unlock(&c->data_progress_lock);
+}
+
+static void bch2_moving_ctxt_to_text(struct printbuf *out, struct moving_context *ctxt)
+static void bch2_moving_ctxt_to_text(struct printbuf *out, struct bch_fs *c, struct moving_context *ctxt)
+{
+ struct bch_move_stats *stats = ctxt->stats;
+ struct moving_io *io;
+
+ prt_printf(out, "%ps:", ctxt->fn);
+ prt_printf(out, "%s (%ps):", stats->name, ctxt->fn);
+ prt_newline(out);
+
+ prt_printf(out, " data type %s btree_id %s position: ",
+ bch2_data_types[stats->data_type],
+ bch2_btree_ids[stats->btree_id]);
+ bch2_bpos_to_text(out, stats->pos);
+ prt_newline(out);
+ printbuf_indent_add(out, 2);
+
+ prt_printf(out, "reads: %u sectors %u",
+ prt_printf(out, "reads: ios %u/%u sectors %u/%u",
+ atomic_read(&ctxt->read_ios),
+ atomic_read(&ctxt->read_sectors));
+ c->opts.move_ios_in_flight,
+ atomic_read(&ctxt->read_sectors),
+ c->opts.move_bytes_in_flight >> 9);
+ prt_newline(out);
+
+ prt_printf(out, "writes: %u sectors %u",
+ prt_printf(out, "writes: ios %u/%u sectors %u/%u",
+ atomic_read(&ctxt->write_ios),
+ atomic_read(&ctxt->write_sectors));
+ c->opts.move_ios_in_flight,
+ atomic_read(&ctxt->write_sectors),
+ c->opts.move_bytes_in_flight >> 9);
+ prt_newline(out);
+
+ printbuf_indent_add(out, 2);
+
+ mutex_lock(&ctxt->lock);
+ list_for_each_entry(io, &ctxt->ios, io_list) {
+ list_for_each_entry(io, &ctxt->ios, io_list)
+ bch2_write_op_to_text(out, &io->write.op);
+ }
+ mutex_unlock(&ctxt->lock);
+
+ printbuf_indent_sub(out, 4);
Expand All @@ -73620,7 +73614,7 @@ index 000000000..052726739
+
+ mutex_lock(&c->moving_context_lock);
+ list_for_each_entry(ctxt, &c->moving_context_list, list)
+ bch2_moving_ctxt_to_text(out, ctxt);
+ bch2_moving_ctxt_to_text(out, c, ctxt);
+ mutex_unlock(&c->moving_context_lock);
+}
+
Expand All @@ -73634,10 +73628,10 @@ index 000000000..052726739
+}
diff --git a/fs/bcachefs/move.h b/fs/bcachefs/move.h
new file mode 100644
index 000000000..547ee7b72
index 000000000..c3136abe8
--- /dev/null
+++ b/fs/bcachefs/move.h
@@ -0,0 +1,96 @@
@@ -0,0 +1,95 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _BCACHEFS_MOVE_H
+#define _BCACHEFS_MOVE_H
Expand Down Expand Up @@ -73728,7 +73722,6 @@ index 000000000..547ee7b72
+ struct bch_ioctl_data);
+
+void bch2_move_stats_init(struct bch_move_stats *stats, char *name);
+void bch2_data_jobs_to_text(struct printbuf *, struct bch_fs *);
+void bch2_fs_moving_ctxts_to_text(struct printbuf *, struct bch_fs *);
+
+void bch2_fs_move_init(struct bch_fs *);
Expand Down Expand Up @@ -89561,10 +89554,10 @@ index 000000000..89419fc79
+#endif /* _BCACHEFS_SUPER_TYPES_H */
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c
new file mode 100644
index 000000000..740305e67
index 000000000..941f4bcb9
--- /dev/null
+++ b/fs/bcachefs/sysfs.c
@@ -0,0 +1,1064 @@
@@ -0,0 +1,1059 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * bcache sysfs interfaces
Expand Down Expand Up @@ -89815,7 +89808,6 @@ index 000000000..740305e67
+read_attribute(io_timers_read);
+read_attribute(io_timers_write);
+
+read_attribute(data_jobs);
+read_attribute(moving_ctxts);
+
+#ifdef CONFIG_BCACHEFS_TESTS
Expand Down Expand Up @@ -90025,9 +90017,6 @@ index 000000000..740305e67
+ if (attr == &sysfs_io_timers_write)
+ bch2_io_timers_to_text(out, &c->io_clock[WRITE]);
+
+ if (attr == &sysfs_data_jobs)
+ bch2_data_jobs_to_text(out, c);
+
+ if (attr == &sysfs_moving_ctxts)
+ bch2_fs_moving_ctxts_to_text(out, c);
+
Expand Down Expand Up @@ -90248,7 +90237,6 @@ index 000000000..740305e67
+ &sysfs_rebalance_work,
+ sysfs_pd_controller_files(rebalance),
+
+ &sysfs_data_jobs,
+ &sysfs_moving_ctxts,
+
+ &sysfs_internal_uuid,
Expand Down

0 comments on commit a5393f1

Please sign in to comment.