fs.h (abc7220b2233df9b13d8e0e312fb6f31e5402d7d) fs.h (da9aa5d96bfe49e903ce2bc01cfb8a776c2619e9)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_FS_H
3#define _LINUX_FS_H
4
5#include <linux/linkage.h>
6#include <linux/wait_bit.h>
7#include <linux/kdev_t.h>
8#include <linux/dcache.h>

--- 2118 unchanged lines hidden (view full) ---

2127 *
2128 * I_OVL_INUSE Used by overlayfs to get exclusive ownership on upper
2129 * and work dirs among overlayfs mounts.
2130 *
2131 * I_CREATING New object's inode in the middle of setting up.
2132 *
2133 * I_DONTCACHE Evict inode as soon as it is not used anymore.
2134 *
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_FS_H
3#define _LINUX_FS_H
4
5#include <linux/linkage.h>
6#include <linux/wait_bit.h>
7#include <linux/kdev_t.h>
8#include <linux/dcache.h>

--- 2118 unchanged lines hidden (view full) ---

2127 *
2128 * I_OVL_INUSE Used by overlayfs to get exclusive ownership on upper
2129 * and work dirs among overlayfs mounts.
2130 *
2131 * I_CREATING New object's inode in the middle of setting up.
2132 *
2133 * I_DONTCACHE Evict inode as soon as it is not used anymore.
2134 *
2135 * I_SYNC_QUEUED Inode is queued in b_io or b_more_io writeback lists.
2136 * Used to detect that mark_inode_dirty() should not move
2137 * inode between dirty lists.
2138 *
2139 * Q: What is the difference between I_WILL_FREE and I_FREEING?
2140 */
2141#define I_DIRTY_SYNC (1 << 0)
2142#define I_DIRTY_DATASYNC (1 << 1)
2143#define I_DIRTY_PAGES (1 << 2)
2144#define __I_NEW 3
2145#define I_NEW (1 << __I_NEW)
2146#define I_WILL_FREE (1 << 4)
2147#define I_FREEING (1 << 5)
2148#define I_CLEAR (1 << 6)
2149#define __I_SYNC 7
2150#define I_SYNC (1 << __I_SYNC)
2151#define I_REFERENCED (1 << 8)
2152#define __I_DIO_WAKEUP 9
2153#define I_DIO_WAKEUP (1 << __I_DIO_WAKEUP)
2154#define I_LINKABLE (1 << 10)
2155#define I_DIRTY_TIME (1 << 11)
2135 * Q: What is the difference between I_WILL_FREE and I_FREEING?
2136 */
2137#define I_DIRTY_SYNC (1 << 0)
2138#define I_DIRTY_DATASYNC (1 << 1)
2139#define I_DIRTY_PAGES (1 << 2)
2140#define __I_NEW 3
2141#define I_NEW (1 << __I_NEW)
2142#define I_WILL_FREE (1 << 4)
2143#define I_FREEING (1 << 5)
2144#define I_CLEAR (1 << 6)
2145#define __I_SYNC 7
2146#define I_SYNC (1 << __I_SYNC)
2147#define I_REFERENCED (1 << 8)
2148#define __I_DIO_WAKEUP 9
2149#define I_DIO_WAKEUP (1 << __I_DIO_WAKEUP)
2150#define I_LINKABLE (1 << 10)
2151#define I_DIRTY_TIME (1 << 11)
2152#define __I_DIRTY_TIME_EXPIRED 12
2153#define I_DIRTY_TIME_EXPIRED (1 << __I_DIRTY_TIME_EXPIRED)
2156#define I_WB_SWITCH (1 << 13)
2157#define I_OVL_INUSE (1 << 14)
2158#define I_CREATING (1 << 15)
2159#define I_DONTCACHE (1 << 16)
2154#define I_WB_SWITCH (1 << 13)
2155#define I_OVL_INUSE (1 << 14)
2156#define I_CREATING (1 << 15)
2157#define I_DONTCACHE (1 << 16)
2160#define I_SYNC_QUEUED (1 << 17)
2161
2162#define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)
2163#define I_DIRTY (I_DIRTY_INODE | I_DIRTY_PAGES)
2164#define I_DIRTY_ALL (I_DIRTY | I_DIRTY_TIME)
2165
2166extern void __mark_inode_dirty(struct inode *, int);
2167static inline void mark_inode_dirty(struct inode *inode)
2168{

--- 992 unchanged lines hidden (view full) ---

3161void inode_set_bytes(struct inode *inode, loff_t bytes);
3162const char *simple_get_link(struct dentry *, struct inode *,
3163 struct delayed_call *);
3164extern const struct inode_operations simple_symlink_inode_operations;
3165
3166extern int iterate_dir(struct file *, struct dir_context *);
3167
3168extern int vfs_statx(int, const char __user *, int, struct kstat *, u32);
2158
2159#define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)
2160#define I_DIRTY (I_DIRTY_INODE | I_DIRTY_PAGES)
2161#define I_DIRTY_ALL (I_DIRTY | I_DIRTY_TIME)
2162
2163extern void __mark_inode_dirty(struct inode *, int);
2164static inline void mark_inode_dirty(struct inode *inode)
2165{

--- 992 unchanged lines hidden (view full) ---

3158void inode_set_bytes(struct inode *inode, loff_t bytes);
3159const char *simple_get_link(struct dentry *, struct inode *,
3160 struct delayed_call *);
3161extern const struct inode_operations simple_symlink_inode_operations;
3162
3163extern int iterate_dir(struct file *, struct dir_context *);
3164
3165extern int vfs_statx(int, const char __user *, int, struct kstat *, u32);
3169extern int vfs_statx_fd(unsigned int, struct kstat *, u32, unsigned int);
3166int vfs_fstat(int fd, struct kstat *stat);
3170
3171static inline int vfs_stat(const char __user *filename, struct kstat *stat)
3172{
3173 return vfs_statx(AT_FDCWD, filename, AT_NO_AUTOMOUNT,
3174 stat, STATX_BASIC_STATS);
3175}
3176static inline int vfs_lstat(const char __user *name, struct kstat *stat)
3177{
3178 return vfs_statx(AT_FDCWD, name, AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT,
3179 stat, STATX_BASIC_STATS);
3180}
3181static inline int vfs_fstatat(int dfd, const char __user *filename,
3182 struct kstat *stat, int flags)
3183{
3184 return vfs_statx(dfd, filename, flags | AT_NO_AUTOMOUNT,
3185 stat, STATX_BASIC_STATS);
3186}
3167
3168static inline int vfs_stat(const char __user *filename, struct kstat *stat)
3169{
3170 return vfs_statx(AT_FDCWD, filename, AT_NO_AUTOMOUNT,
3171 stat, STATX_BASIC_STATS);
3172}
3173static inline int vfs_lstat(const char __user *name, struct kstat *stat)
3174{
3175 return vfs_statx(AT_FDCWD, name, AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT,
3176 stat, STATX_BASIC_STATS);
3177}
3178static inline int vfs_fstatat(int dfd, const char __user *filename,
3179 struct kstat *stat, int flags)
3180{
3181 return vfs_statx(dfd, filename, flags | AT_NO_AUTOMOUNT,
3182 stat, STATX_BASIC_STATS);
3183}
3187static inline int vfs_fstat(int fd, struct kstat *stat)
3188{
3189 return vfs_statx_fd(fd, stat, STATX_BASIC_STATS, 0);
3190}
3191
3184
3192
3193extern const char *vfs_get_link(struct dentry *, struct delayed_call *);
3194extern int vfs_readlink(struct dentry *, char __user *, int);
3195
3196extern struct file_system_type *get_filesystem(struct file_system_type *fs);
3197extern void put_filesystem(struct file_system_type *fs);
3198extern struct file_system_type *get_fs_type(const char *name);
3199extern struct super_block *get_super(struct block_device *);
3200extern struct super_block *get_super_thawed(struct block_device *);

--- 349 unchanged lines hidden ---
3185extern const char *vfs_get_link(struct dentry *, struct delayed_call *);
3186extern int vfs_readlink(struct dentry *, char __user *, int);
3187
3188extern struct file_system_type *get_filesystem(struct file_system_type *fs);
3189extern void put_filesystem(struct file_system_type *fs);
3190extern struct file_system_type *get_fs_type(const char *name);
3191extern struct super_block *get_super(struct block_device *);
3192extern struct super_block *get_super_thawed(struct block_device *);

--- 349 unchanged lines hidden ---