summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-08-10 20:28:55 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-08-11 17:34:34 -0400
commitddac1641ee1e2686c2211a8d671ea723634dfc89 (patch)
tree0596db2376fb5cbdcd83bf1642efdc7868ade480 /include/linux
parenta6128b5335a79cd68b9dbb6b083a835d94539d04 (diff)
Update bcachefs sources to 90a9c61e2b bcachefs: Switch bch2_btree_delete_range() to bch2_trans_run()
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/blkdev.h5
-rw-r--r--include/linux/errname.h11
-rw-r--r--include/linux/prandom.h27
-rw-r--r--include/linux/random.h5
-rw-r--r--include/linux/six.h7
6 files changed, 48 insertions, 9 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 7d596df6..0ad5a87d 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -242,7 +242,7 @@ int bio_add_page(struct bio *, struct page *, unsigned, unsigned);
struct bio *bio_alloc_clone(struct block_device *, struct bio *,
gfp_t, struct bio_set *);
-struct bio *bio_kmalloc(gfp_t, unsigned int);
+struct bio *bio_kmalloc(unsigned int, gfp_t);
extern void bio_endio(struct bio *);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4ce43b5c..01b3d4ad 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -69,8 +69,7 @@ static inline void submit_bio(struct bio *bio)
generic_make_request(bio);
}
-int blkdev_issue_discard(struct block_device *, sector_t,
- sector_t, gfp_t, unsigned long);
+int blkdev_issue_discard(struct block_device *, sector_t, sector_t, gfp_t);
#define bdev_get_queue(bdev) (&((bdev)->queue))
@@ -85,7 +84,7 @@ int blkdev_issue_discard(struct block_device *, sector_t,
#define PAGE_SECTORS (1 << PAGE_SECTORS_SHIFT)
#define SECTOR_MASK (PAGE_SECTORS - 1)
-#define blk_queue_discard(q) ((void) (q), 0)
+#define bdev_max_discard_sectors(bdev) ((void) (bdev), 0)
#define blk_queue_nonrot(q) ((void) (q), 0)
unsigned bdev_logical_block_size(struct block_device *bdev);
diff --git a/include/linux/errname.h b/include/linux/errname.h
new file mode 100644
index 00000000..443d5040
--- /dev/null
+++ b/include/linux/errname.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_ERRNAME_H
+#define _LINUX_ERRNAME_H
+
+#include <string.h>
+
+static inline const char *errname(int err)
+{
+ return strerror(abs(err));
+}
+
+#endif /* _LINUX_ERRNAME_H */
diff --git a/include/linux/prandom.h b/include/linux/prandom.h
new file mode 100644
index 00000000..6f177cdd
--- /dev/null
+++ b/include/linux/prandom.h
@@ -0,0 +1,27 @@
+#ifndef _LINUX_PRANDOM_H
+#define _LINUX_PRANDOM_H
+
+#include <linux/random.h>
+
+static inline void prandom_bytes(void *buf, int nbytes)
+{
+ return get_random_bytes(buf, nbytes);
+}
+
+#define prandom_type(type) \
+static inline type prandom_##type(void) \
+{ \
+ type v; \
+ \
+ prandom_bytes(&v, sizeof(v)); \
+ return v; \
+}
+
+prandom_type(int);
+prandom_type(long);
+prandom_type(u32);
+prandom_type(u64);
+#undef prandom_type
+
+#endif /* _LINUX_PRANDOM_H */
+
diff --git a/include/linux/random.h b/include/linux/random.h
index 28c595a0..ea101d53 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -29,11 +29,6 @@ static inline void get_random_bytes(void *buf, int nbytes)
BUG_ON(getrandom(buf, nbytes, 0) != nbytes);
}
-static inline void prandom_bytes(void *buf, int nbytes)
-{
- return get_random_bytes(buf, nbytes);
-}
-
#define get_random_type(type) \
static inline type get_random_##type(void) \
{ \
diff --git a/include/linux/six.h b/include/linux/six.h
index 477c33eb..41ddf63b 100644
--- a/include/linux/six.h
+++ b/include/linux/six.h
@@ -200,4 +200,11 @@ void six_lock_pcpu_free_rcu(struct six_lock *);
void six_lock_pcpu_free(struct six_lock *);
void six_lock_pcpu_alloc(struct six_lock *);
+struct six_lock_count {
+ unsigned read;
+ unsigned intent;
+};
+
+struct six_lock_count six_lock_counts(struct six_lock *);
+
#endif /* _LINUX_SIX_H */