From: yegorslists@googlemail.com
To: barebox@lists.infradead.org
Subject: [PATCH v5 2/3] linux/fs.h: add types and routines needed for SquashFS
Date: Tue, 1 Mar 2016 12:10:03 +0100 [thread overview]
Message-ID: <1456830604-8469-2-git-send-email-yegorslists@googlemail.com> (raw)
In-Reply-To: <1456830604-8469-1-git-send-email-yegorslists@googlemail.com>
From: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
Changes:
v2: fix checkpatch issues
include/linux/fs.h | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7e9886a..d5b232b 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
next prev parent reply other threads:[~2016-03-01 11:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 11:10 [PATCH v5 1/3] linux/types.h: add sector_t and blkcnt_t types yegorslists
2016-03-01 11:10 ` yegorslists [this message]
2016-03-01 11:10 ` [PATCH v5 3/3] fs: add support for SquashFS 4.0 yegorslists
2016-03-01 21:11 ` Antony Pavlov
2016-03-02 18:53 ` [PATCH v5 1/3] linux/types.h: add sector_t and blkcnt_t types Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456830604-8469-2-git-send-email-yegorslists@googlemail.com \
--to=yegorslists@googlemail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox