Thread (5 messages) 5 messages, 3 authors, 2018-02-13

Re: [PATCH] block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into <linux/blkdev.h>

From: Sergey Senozhatsky <hidden>
Date: 2018-02-13 08:54:15

On (02/12/18 11:05), Bart Van Assche wrote:
[..]
quoted hunk ↗ jump to hunk
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ac4740cf74be..cf17626604c2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1026,14 +1026,25 @@ static inline int blk_rq_cur_bytes(const struct request *rq)
 
 extern unsigned int blk_rq_err_bytes(const struct request *rq);
 
+/*
+ * Variables of type sector_t represent an offset or size that is a multiple of
+ * 2**9 bytes. Hence these two constants.
+ */
+#ifndef SECTOR_SHIFT
+enum { SECTOR_SHIFT = 9 };
+#endif
+#ifndef SECTOR_SIZE
+enum { SECTOR_SIZE = 512 };
+#endif
Shouldn't SECTOR_SIZE depend on SECTOR_SHIFT?

1 << SECTOR_SHIFT

	-ss
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help