+
+/* --- misc stuff --- */
+
+#define check_itype(to_check, itype) \
+ (((to_check) & (itype)) == (itype))
+
+/**
+ * @brief Check if node represent a regular file (nothing but a file)
+ *
+ * @param inode
+ * @return true
+ * @return false
+ */
+static inline bool
+check_regfile_node(struct v_inode* inode)
+{
+ return inode->itype == VFS_IFFILE;
+}
+
+/**
+ * @brief Check if node represent a file.
+ * This is basically everything within file system (dir, dev, etc.)
+ *
+ * @param inode
+ * @return true
+ * @return false
+ */
+static inline bool
+check_file_node(struct v_inode* inode)
+{
+ return check_itype(inode->itype, VFS_IFFILE);
+}
+
+static inline bool
+check_directory_node(struct v_inode* inode)
+{
+ return check_itype(inode->itype, VFS_IFDIR);
+}
+
+static inline bool
+check_device_node(struct v_inode* inode)
+{
+ return check_itype(inode->itype, VFS_IFDEV);
+}
+
+static inline bool
+check_seqdev_node(struct v_inode* inode)
+{
+ return check_device_node(inode);
+}
+
+static inline bool
+check_voldev_node(struct v_inode* inode)
+{
+ return check_itype(inode->itype, VFS_IFVOLDEV);
+}
+
+static inline bool
+check_symlink_node(struct v_inode* inode)
+{
+ return check_itype(inode->itype, VFS_IFSYMLINK);
+}
+