mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types
@ 2016-02-11 14:53 yegorslists
  2016-02-11 14:53 ` [PATCH 2/2] linux/fs.h: add types and routines needed for SquashFS yegorslists
  2016-02-12  7:39 ` [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: yegorslists @ 2016-02-11 14:53 UTC (permalink / raw)
  To: barebox

From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 include/linux/types.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/linux/types.h b/include/linux/types.h
index 9f8eb67..f64ec4a 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -157,6 +157,22 @@ typedef __u32 __bitwise __wsum;
 #define __aligned_be64 __be64 __attribute__((aligned(8)))
 #define __aligned_le64 __le64 __attribute__((aligned(8)))
 
+/**
+ * The type used for indexing onto a disc or disc partition.
+ *
+ * Linux always considers sectors to be 512 bytes long independently
+ * of the devices real block size.
+ *
+ * blkcnt_t is the type of the inode's block count.
+ */
+#ifdef CONFIG_LBDAF
+typedef u64 sector_t;
+typedef u64 blkcnt_t;
+#else
+typedef unsigned long sector_t;
+typedef unsigned long blkcnt_t;
+#endif
+
 /*
  * The type of an index into the pagecache.
  */
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] linux/fs.h: add types and routines needed for SquashFS
  2016-02-11 14:53 [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types yegorslists
@ 2016-02-11 14:53 ` yegorslists
  2016-02-12  7:39 ` [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: yegorslists @ 2016-02-11 14:53 UTC (permalink / raw)
  To: barebox

From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 include/linux/fs.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7e9886a..e11a602 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -19,6 +19,26 @@
 #endif
 
 /*
+ * File types
+ *
+ * NOTE! These match bits 12..15 of stat.st_mode
+ * (ie "(i_mode >> 12) & 15").
+ */
+#define DT_UNKNOWN	0
+#define DT_FIFO		1
+#define DT_CHR		2
+#define DT_DIR		4
+#define DT_BLK		6
+#define DT_REG		8
+#define DT_LNK		10
+#define DT_SOCK		12
+#define DT_WHT		14
+
+struct dir_context {
+	loff_t pos;
+};
+
+/*
  * These are the fs-independent mount-flags: up to 32 flags are supported
  */
 #define MS_RDONLY	 1	/* Mount read-only */
@@ -74,6 +94,7 @@ struct inode {
 	struct timespec		i_mtime;
 	struct timespec		i_ctime;
 	unsigned int		i_blkbits;
+	blkcnt_t		i_blocks;
 	unsigned short          i_bytes;
 	umode_t			i_mode;
 	spinlock_t		i_lock;	/* i_blocks, i_bytes, maybe i_size */
@@ -194,6 +215,7 @@ struct file_system_type {
 
 struct file {
 	struct path		f_path;
+	struct inode		*f_inode;	/* cached value */
 #define f_dentry	f_path.dentry
 #define f_vfsmnt	f_path.mnt
 	const struct file_operations	*f_op;
@@ -361,4 +383,9 @@ struct file {
 #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
 #define I_DIRTY_ALL (I_DIRTY | I_DIRTY_TIME)
 
+static inline loff_t i_size_read(const struct inode *inode)
+{
+        return inode->i_size;
+}
+
 #endif /* _LINUX_FS_H */
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types
  2016-02-11 14:53 [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types yegorslists
  2016-02-11 14:53 ` [PATCH 2/2] linux/fs.h: add types and routines needed for SquashFS yegorslists
@ 2016-02-12  7:39 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2016-02-12  7:39 UTC (permalink / raw)
  To: yegorslists; +Cc: barebox

Hi Yegor,

On Thu, Feb 11, 2016 at 03:53:03PM +0100, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  include/linux/types.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)

Please send these as part of the squashfs series next time. Then I know
I have to apply them when I apply the squashfs support.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-12  7:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11 14:53 [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types yegorslists
2016-02-11 14:53 ` [PATCH 2/2] linux/fs.h: add types and routines needed for SquashFS yegorslists
2016-02-12  7:39 ` [PATCH 1/2] linux/types.h: add sector_t and blkcnt_t types Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox