/linux/fs/ |
H A D | inode.c | 212 static int no_open(struct inode *inode, struct file *file) in no_open() argument 227 int inode_init_always_gfp(struct super_block *sb, struct inode *inode, gfp_t gfp) in inode_init_always_gfp() argument 231 struct address_space *const mapping = &inode->i_data; in inode_init_always_gfp() 233 inode->i_sb = sb; in inode_init_always_gfp() 234 inode->i_blkbits = sb->s_blocksize_bits; in inode_init_always_gfp() 235 inode->i_flags = 0; in inode_init_always_gfp() 236 inode->i_state = 0; in inode_init_always_gfp() 237 atomic64_set(&inode->i_sequence, 0); in inode_init_always_gfp() 238 atomic_set(&inode->i_count, 1); in inode_init_always_gfp() 239 inode->i_op = &empty_iops; in inode_init_always_gfp() [all …]
|
H A D | fs-writeback.c | 70 static inline struct inode *wb_inode(struct list_head *head) in wb_inode() 72 return list_entry(head, struct inode, i_io_list); in wb_inode() 118 static bool inode_io_list_move_locked(struct inode *inode, in inode_io_list_move_locked() argument 123 assert_spin_locked(&inode->i_lock); in inode_io_list_move_locked() 124 WARN_ON_ONCE(inode->i_state & I_FREEING); in inode_io_list_move_locked() 126 list_move(&inode->i_io_list, head); in inode_io_list_move_locked() 259 / sizeof(struct inode *)) 264 void __inode_attach_wb(struct inode *inode, struct folio *folio) in __inode_attach_wb() argument 266 struct backing_dev_info *bdi = inode_to_bdi(inode); in __inode_attach_wb() 269 if (inode_cgwb_enabled(inode)) { in __inode_attach_wb() [all …]
|
/linux/fs/affs/ |
H A D | inode.c | 18 struct inode *affs_iget(struct super_block *sb, unsigned long ino) in affs_iget() 23 struct inode *inode; in affs_iget() local 29 inode = iget_locked(sb, ino); in affs_iget() 30 if (!inode) in affs_iget() 32 if (!(inode->i_state & I_NEW)) in affs_iget() 33 return inode; in affs_iget() 35 pr_debug("affs_iget(%lu)\n", inode->i_ino); in affs_iget() 37 block = inode->i_ino; in affs_iget() 53 inode->i_size = 0; in affs_iget() 54 set_nlink(inode, 1); in affs_iget() [all …]
|
/linux/include/linux/ |
H A D | quotaops.h | 24 struct inode *inode, struct iattr *ia) in is_quota_modification() argument 27 i_uid_needs_update(idmap, ia, inode) || in is_quota_modification() 28 i_gid_needs_update(idmap, ia, inode)); in is_quota_modification() 43 int dquot_initialize(struct inode *inode); 44 bool dquot_initialize_needed(struct inode *inode); 45 void dquot_drop(struct inode *inode); 72 int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags); 73 void __dquot_free_space(struct inode *inode, qsize_t number, int flags); 75 int dquot_alloc_inode(struct inode *inode); 77 void dquot_claim_space_nodirty(struct inode *inode, qsize_t number); [all …]
|
H A D | fs.h | 96 typedef int (get_block_t)(struct inode *inode, sector_t iblock, 468 struct inode *host; 597 #define i_size_ordered_init(inode) seqcount_init(&inode->i_size_seqcount) argument 599 #define i_size_ordered_init(inode) do { } while (0) argument 635 struct inode { struct 722 void (*free_inode)(struct inode *); argument 756 #define inode_state_wait_address(inode, bit) ((char *)&(inode)->i_state + (bit)) argument 759 struct inode *inode, u32 bit); 761 static inline void inode_wake_up_bit(struct inode *inode, u32 bit) in inode_wake_up_bit() argument 764 wake_up_var(inode_state_wait_address(inode, bit)); in inode_wake_up_bit() [all …]
|
H A D | fscrypt.h | 124 int (*get_context)(struct inode *inode, void *ctx, size_t len); 142 int (*set_context)(struct inode *inode, const void *ctx, size_t len, 159 bool (*empty_dir)(struct inode *inode); 198 fscrypt_get_inode_info(const struct inode *inode) in fscrypt_get_inode_info() argument 206 return smp_load_acquire(&inode->i_crypt_info); in fscrypt_get_inode_info() 220 static inline bool fscrypt_needs_contents_encryption(const struct inode *inode) in fscrypt_needs_contents_encryption() argument 222 return IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode); in fscrypt_needs_contents_encryption() 316 int fscrypt_encrypt_block_inplace(const struct inode *inode, struct page *page, 322 int fscrypt_decrypt_block_inplace(const struct inode *inode, struct page *page, 353 int fscrypt_has_permitted_context(struct inode *parent, struct inode *child); [all …]
|
/linux/fs/nfs/ |
H A D | inode.c | 65 static int nfs_update_inode(struct inode *, struct nfs_fattr *); 107 int nfs_drop_inode(struct inode *inode) in nfs_drop_inode() argument 109 return NFS_STALE(inode) || generic_drop_inode(inode); in nfs_drop_inode() 113 void nfs_clear_inode(struct inode *inode) in nfs_clear_inode() argument 118 WARN_ON_ONCE(nfs_have_writebacks(inode)); in nfs_clear_inode() 119 WARN_ON_ONCE(!list_empty(&NFS_I(inode)->open_files)); in nfs_clear_inode() 120 nfs_zap_acl_cache(inode); in nfs_clear_inode() 121 nfs_access_zap_cache(inode); in nfs_clear_inode() 122 nfs_fscache_clear_inode(inode); in nfs_clear_inode() 126 void nfs_evict_inode(struct inode *inode) in nfs_evict_inode() argument [all …]
|
H A D | delegation.h | 19 struct inode *inode; member 44 int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred, 47 void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred, 50 int nfs4_inode_return_delegation(struct inode *inode); 51 void nfs4_inode_return_delegation_on_close(struct inode *inode); 52 int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid); 53 void nfs_inode_evict_delegation(struct inode *inode); 55 struct inode *nfs_delegation_find_inode(struct nfs_client *clp, const struct nfs_fh *fhandle); 62 void nfs_remove_bad_delegation(struct inode *inode, const nfs4_stateid *stateid); 63 void nfs_delegation_mark_returned(struct inode *inode, const nfs4_stateid *stateid); [all …]
|
/linux/fs/nilfs2/ |
H A D | inode.c | 41 static int nilfs_iget_test(struct inode *inode, void *opaque); 43 void nilfs_inode_add_blocks(struct inode *inode, int n) in nilfs_inode_add_blocks() argument 45 struct nilfs_root *root = NILFS_I(inode)->i_root; in nilfs_inode_add_blocks() 47 inode_add_bytes(inode, i_blocksize(inode) * n); in nilfs_inode_add_blocks() 52 void nilfs_inode_sub_blocks(struct inode *inode, int n) in nilfs_inode_sub_blocks() argument 54 struct nilfs_root *root = NILFS_I(inode)->i_root; in nilfs_inode_sub_blocks() 56 inode_sub_bytes(inode, i_blocksize(inode) * n); in nilfs_inode_sub_blocks() 72 int nilfs_get_block(struct inode *inode, sector_t blkoff, in nilfs_get_block() argument 75 struct nilfs_inode_info *ii = NILFS_I(inode); in nilfs_get_block() 76 struct the_nilfs *nilfs = inode->i_sb->s_fs_info; in nilfs_get_block() [all …]
|
H A D | mdt.h | 26 struct inode *inode; member 54 static inline struct nilfs_mdt_info *NILFS_MDT(const struct inode *inode) in NILFS_MDT() argument 56 return inode->i_private; in NILFS_MDT() 59 static inline int nilfs_is_metadata_file_inode(const struct inode *inode) in nilfs_is_metadata_file_inode() argument 61 return inode->i_private != NULL; in nilfs_is_metadata_file_inode() 67 int nilfs_mdt_get_block(struct inode *, unsigned long, int, 68 void (*init_block)(struct inode *, 71 int nilfs_mdt_find_block(struct inode *inode, unsigned long start, 74 int nilfs_mdt_delete_block(struct inode *, unsigned long); 75 int nilfs_mdt_forget_block(struct inode *, unsigned long); [all …]
|
H A D | alloc.c | 26 nilfs_palloc_groups_per_desc_block(const struct inode *inode) in nilfs_palloc_groups_per_desc_block() argument 28 return i_blocksize(inode) / in nilfs_palloc_groups_per_desc_block() 37 nilfs_palloc_groups_count(const struct inode *inode) in nilfs_palloc_groups_count() argument 39 return 1UL << (BITS_PER_LONG - (inode->i_blkbits + 3 /* log2(8) */)); in nilfs_palloc_groups_count() 47 int nilfs_palloc_init_blockgroup(struct inode *inode, unsigned int entry_size) in nilfs_palloc_init_blockgroup() argument 49 struct nilfs_mdt_info *mi = NILFS_MDT(inode); in nilfs_palloc_init_blockgroup() 57 nilfs_mdt_set_entry_size(inode, entry_size, 0); in nilfs_palloc_init_blockgroup() 60 DIV_ROUND_UP(nilfs_palloc_entries_per_group(inode), in nilfs_palloc_init_blockgroup() 67 nilfs_palloc_groups_per_desc_block(inode) * in nilfs_palloc_init_blockgroup() 82 static unsigned long nilfs_palloc_group(const struct inode *inode, __u64 nr, in nilfs_palloc_group() argument [all …]
|
/linux/fs/hfs/ |
H A D | inode.c | 39 struct inode *inode = mapping->host; in hfs_write_failed() local 41 if (to > inode->i_size) { in hfs_write_failed() 42 truncate_pagecache(inode, inode->i_size); in hfs_write_failed() 43 hfs_file_truncate(inode); in hfs_write_failed() 68 struct inode *inode = folio->mapping->host; in hfs_release_folio() local 69 struct super_block *sb = inode->i_sb; in hfs_release_folio() 76 switch (inode->i_ino) { in hfs_release_folio() 128 struct inode *inode = mapping->host; in hfs_direct_IO() local 132 ret = blockdev_direct_IO(iocb, inode, iter, hfs_get_block); in hfs_direct_IO() 139 loff_t isize = i_size_read(inode); in hfs_direct_IO() [all …]
|
/linux/fs/coda/ |
H A D | cnode.c | 26 static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr) in coda_fill_inode() argument 28 coda_vattr_to_iattr(inode, attr); in coda_fill_inode() 30 if (S_ISREG(inode->i_mode)) { in coda_fill_inode() 31 inode->i_op = &coda_file_inode_operations; in coda_fill_inode() 32 inode->i_fop = &coda_file_operations; in coda_fill_inode() 33 } else if (S_ISDIR(inode->i_mode)) { in coda_fill_inode() 34 inode->i_op = &coda_dir_inode_operations; in coda_fill_inode() 35 inode->i_fop = &coda_dir_operations; in coda_fill_inode() 36 } else if (S_ISLNK(inode->i_mode)) { in coda_fill_inode() 37 inode->i_op = &coda_symlink_inode_operations; in coda_fill_inode() [all …]
|
/linux/fs/hfsplus/ |
H A D | inode.c | 33 struct inode *inode = mapping->host; in hfsplus_write_failed() local 35 if (to > inode->i_size) { in hfsplus_write_failed() 36 truncate_pagecache(inode, inode->i_size); in hfsplus_write_failed() 37 hfsplus_file_truncate(inode); in hfsplus_write_failed() 62 struct inode *inode = folio->mapping->host; in hfsplus_release_folio() local 63 struct super_block *sb = inode->i_sb; in hfsplus_release_folio() 70 switch (inode->i_ino) { in hfsplus_release_folio() 125 struct inode *inode = mapping->host; in hfsplus_direct_IO() local 129 ret = blockdev_direct_IO(iocb, inode, iter, hfsplus_get_block); in hfsplus_direct_IO() 136 loff_t isize = i_size_read(inode); in hfsplus_direct_IO() [all …]
|
/linux/fs/ufs/ |
H A D | namei.c | 38 static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode) in ufs_add_nondir() argument 40 int err = ufs_add_link(dentry, inode); in ufs_add_nondir() 42 d_instantiate_new(dentry, inode); in ufs_add_nondir() 45 inode_dec_link_count(inode); in ufs_add_nondir() 46 discard_new_inode(inode); in ufs_add_nondir() 50 static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) in ufs_lookup() 52 struct inode * inode = NULL; in ufs_lookup() local 60 inode = ufs_iget(dir->i_sb, ino); in ufs_lookup() 61 return d_splice_alias(inode, dentry); in ufs_lookup() 73 struct inode * dir, struct dentry * dentry, umode_t mode, in ufs_create() [all …]
|
H A D | inode.c | 47 static int ufs_block_to_path(struct inode *inode, sector_t i_block, unsigned offsets[4]) in ufs_block_to_path() argument 49 struct ufs_sb_private_info *uspi = UFS_SB(inode->i_sb)->s_uspi; in ufs_block_to_path() 74 ufs_warning(inode->i_sb, "ufs_block_to_path", "block > big"); in ufs_block_to_path() 125 static u64 ufs_frag_map(struct inode *inode, unsigned offsets[4], int depth) in ufs_frag_map() argument 127 struct ufs_inode_info *ufsi = UFS_I(inode); in ufs_frag_map() 128 struct super_block *sb = inode->i_sb; in ufs_frag_map() 222 ufs_extend_tail(struct inode *inode, u64 writes_to, in ufs_extend_tail() argument 225 struct ufs_inode_info *ufsi = UFS_I(inode); in ufs_extend_tail() 226 struct super_block *sb = inode->i_sb; in ufs_extend_tail() 240 tmp = ufs_new_fragments(inode, p, lastfrag, ufs_data_ptr_to_cpu(sb, p), in ufs_extend_tail() [all …]
|
/linux/fs/ext4/ |
H A D | inode.c | 53 struct inode *inode, 57 static __u32 ext4_inode_csum(struct inode *inode, struct ext4_inode *raw, in ext4_inode_csum() argument 60 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); in ext4_inode_csum() 72 if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE) { in ext4_inode_csum() 83 EXT4_INODE_SIZE(inode->i_sb) - offset); in ext4_inode_csum() 89 static int ext4_inode_csum_verify(struct inode *inode, struct ext4_inode *raw, in ext4_inode_csum_verify() argument 94 if (EXT4_SB(inode->i_sb)->s_es->s_creator_os != in ext4_inode_csum_verify() 96 !ext4_has_metadata_csum(inode->i_sb)) in ext4_inode_csum_verify() 100 calculated = ext4_inode_csum(inode, raw, ei); in ext4_inode_csum_verify() 101 if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE && in ext4_inode_csum_verify() [all …]
|
/linux/fs/ext2/ |
H A D | inode.c | 43 static int __ext2_write_inode(struct inode *inode, int do_sync); 48 static inline int ext2_inode_is_fast_symlink(struct inode *inode) in ext2_inode_is_fast_symlink() argument 50 int ea_blocks = EXT2_I(inode)->i_file_acl ? in ext2_inode_is_fast_symlink() 51 (inode->i_sb->s_blocksize >> 9) : 0; in ext2_inode_is_fast_symlink() 53 return (S_ISLNK(inode->i_mode) && in ext2_inode_is_fast_symlink() 54 inode->i_blocks - ea_blocks == 0); in ext2_inode_is_fast_symlink() 57 static void ext2_truncate_blocks(struct inode *inode, loff_t offset); 61 struct inode *inode = mapping->host; in ext2_write_failed() local 63 if (to > inode->i_size) { in ext2_write_failed() 64 truncate_pagecache(inode, inode->i_size); in ext2_write_failed() [all …]
|
H A D | namei.c | 40 static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode) in ext2_add_nondir() argument 42 int err = ext2_add_link(dentry, inode); in ext2_add_nondir() 44 d_instantiate_new(dentry, inode); in ext2_add_nondir() 47 inode_dec_link_count(inode); in ext2_add_nondir() 48 discard_new_inode(inode); in ext2_add_nondir() 56 static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) in ext2_lookup() 58 struct inode * inode; in ext2_lookup() local 69 inode = NULL; in ext2_lookup() 71 inode = ext2_iget(dir->i_sb, ino); in ext2_lookup() 72 if (inode == ERR_PTR(-ESTALE)) { in ext2_lookup() [all …]
|
/linux/fs/netfs/ |
H A D | locking.c | 22 static int netfs_inode_dio_wait_interruptible(struct inode *inode) in netfs_inode_dio_wait_interruptible() argument 24 if (inode_dio_finished(inode)) in netfs_inode_dio_wait_interruptible() 27 inode_dio_wait_interruptible(inode); in netfs_inode_dio_wait_interruptible() 28 return !inode_dio_finished(inode) ? -ERESTARTSYS : 0; in netfs_inode_dio_wait_interruptible() 37 return netfs_inode_dio_wait_interruptible(&ictx->inode); in netfs_block_o_direct() 56 int netfs_start_io_read(struct inode *inode) in netfs_start_io_read() argument 57 __acquires(inode->i_rwsem) in netfs_start_io_read() 59 struct netfs_inode *ictx = netfs_inode(inode); in netfs_start_io_read() 62 if (down_read_interruptible(&inode->i_rwsem) < 0) in netfs_start_io_read() 66 up_read(&inode->i_rwsem); in netfs_start_io_read() [all …]
|
/linux/fs/adfs/ |
H A D | inode.c | 17 adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh, in adfs_get_block() argument 21 if (block >= inode->i_blocks) in adfs_get_block() 24 block = __adfs_block_map(inode->i_sb, ADFS_I(inode)->indaddr, in adfs_get_block() 27 map_bh(bh, inode->i_sb, block); in adfs_get_block() 50 struct inode *inode = mapping->host; in adfs_write_failed() local 52 if (to > inode->i_size) in adfs_write_failed() 53 truncate_pagecache(inode, inode->i_size); in adfs_write_failed() 91 adfs_atts2mode(struct super_block *sb, struct inode *inode) in adfs_atts2mode() argument 93 unsigned int attr = ADFS_I(inode)->attr; in adfs_atts2mode() 102 switch (adfs_filetype(ADFS_I(inode)->loadaddr)) { in adfs_atts2mode() [all …]
|
/linux/fs/squashfs/ |
H A D | inode.c | 44 static int squashfs_new_inode(struct super_block *sb, struct inode *inode, in squashfs_new_inode() argument 51 inode->i_ino = le32_to_cpu(sqsh_ino->inode_number); in squashfs_new_inode() 52 if (inode->i_ino == 0) in squashfs_new_inode() 63 i_uid_write(inode, i_uid); in squashfs_new_inode() 64 i_gid_write(inode, i_gid); in squashfs_new_inode() 65 inode_set_mtime(inode, le32_to_cpu(sqsh_ino->mtime), 0); in squashfs_new_inode() 66 inode_set_atime(inode, inode_get_mtime_sec(inode), 0); in squashfs_new_inode() 67 inode_set_ctime(inode, inode_get_mtime_sec(inode), 0); in squashfs_new_inode() 68 inode->i_mode = le16_to_cpu(sqsh_ino->mode); in squashfs_new_inode() 69 inode->i_size = 0; in squashfs_new_inode() [all …]
|
/linux/fs/btrfs/ |
H A D | btrfs_inode.h | 340 struct inode vfs_inode; 343 static inline u64 btrfs_get_first_dir_index_to_log(const struct btrfs_inode *inode) in btrfs_get_first_dir_index_to_log() argument 345 return READ_ONCE(inode->first_dir_index_to_log); in btrfs_get_first_dir_index_to_log() 348 static inline void btrfs_set_first_dir_index_to_log(struct btrfs_inode *inode, in btrfs_set_first_dir_index_to_log() argument 351 WRITE_ONCE(inode->first_dir_index_to_log, index); in btrfs_set_first_dir_index_to_log() 357 struct inode *: container_of(_inode, struct btrfs_inode, vfs_inode), \ 358 const struct inode *: (const struct btrfs_inode *)container_of( \ 379 static inline u64 btrfs_ino(const struct btrfs_inode *inode) in btrfs_ino() argument 381 u64 ino = inode->objectid; in btrfs_ino() 383 if (test_bit(BTRFS_INODE_ROOT_STUB, &inode->runtime_flags)) in btrfs_ino() [all …]
|
/linux/fs/minix/ |
H A D | namei.c | 10 static int add_nondir(struct dentry *dentry, struct inode *inode) in add_nondir() argument 12 int err = minix_add_link(dentry, inode); in add_nondir() 14 d_instantiate(dentry, inode); in add_nondir() 17 inode_dec_link_count(inode); in add_nondir() 18 iput(inode); in add_nondir() 22 static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) in minix_lookup() 24 struct inode * inode = NULL; in minix_lookup() local 32 inode = minix_iget(dir->i_sb, ino); in minix_lookup() 33 return d_splice_alias(inode, dentry); in minix_lookup() 36 static int minix_mknod(struct mnt_idmap *idmap, struct inode *dir, in minix_mknod() [all …]
|
/linux/fs/fat/ |
H A D | file.c | 24 static int fat_ioctl_get_attributes(struct inode *inode, u32 __user *user_attr) in fat_ioctl_get_attributes() argument 28 inode_lock_shared(inode); in fat_ioctl_get_attributes() 29 attr = fat_make_attrs(inode); in fat_ioctl_get_attributes() 30 inode_unlock_shared(inode); in fat_ioctl_get_attributes() 37 struct inode *inode = file_inode(file); in fat_ioctl_set_attributes() local 38 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_ioctl_set_attributes() 39 int is_dir = S_ISDIR(inode->i_mode); in fat_ioctl_set_attributes() 51 inode_lock(inode); in fat_ioctl_set_attributes() 61 attr |= (MSDOS_I(inode)->i_attrs & ATTR_VOLUME) | in fat_ioctl_set_attributes() 63 oldattr = fat_make_attrs(inode); in fat_ioctl_set_attributes() [all …]
|