• Home
  • Raw
  • Download

Lines Matching refs:inode

21 int fat_generic_ioctl(struct inode *inode, struct file *filp,  in fat_generic_ioctl()  argument
24 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_generic_ioctl()
32 mutex_lock(&inode->i_mutex); in fat_generic_ioctl()
33 attr = fat_make_attrs(inode); in fat_generic_ioctl()
34 mutex_unlock(&inode->i_mutex); in fat_generic_ioctl()
41 int err, is_dir = S_ISDIR(inode->i_mode); in fat_generic_ioctl()
48 mutex_lock(&inode->i_mutex); in fat_generic_ioctl()
62 attr |= (MSDOS_I(inode)->i_attrs & ATTR_VOLUME) | in fat_generic_ioctl()
64 oldattr = fat_make_attrs(inode); in fat_generic_ioctl()
68 ia.ia_ctime = current_fs_time(inode->i_sb); in fat_generic_ioctl()
73 S_IRUGO | S_IWUGO | (inode->i_mode & S_IXUGO)); in fat_generic_ioctl()
77 if (inode->i_ino == MSDOS_ROOT_INO && attr != ATTR_DIR) { in fat_generic_ioctl()
108 inode->i_flags |= S_IMMUTABLE; in fat_generic_ioctl()
110 inode->i_flags &= S_IMMUTABLE; in fat_generic_ioctl()
113 fat_save_attrs(inode, attr); in fat_generic_ioctl()
114 mark_inode_dirty(inode); in fat_generic_ioctl()
118 mutex_unlock(&inode->i_mutex); in fat_generic_ioctl()
126 static int fat_file_release(struct inode *inode, struct file *filp) in fat_file_release() argument
129 MSDOS_SB(inode->i_sb)->options.flush) { in fat_file_release()
130 fat_flush_inodes(inode->i_sb, inode, NULL); in fat_file_release()
149 static int fat_cont_expand(struct inode *inode, loff_t size) in fat_cont_expand() argument
151 struct address_space *mapping = inode->i_mapping; in fat_cont_expand()
152 loff_t start = inode->i_size, count = size - inode->i_size; in fat_cont_expand()
155 err = generic_cont_expand_simple(inode, size); in fat_cont_expand()
159 inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; in fat_cont_expand()
160 mark_inode_dirty(inode); in fat_cont_expand()
161 if (IS_SYNC(inode)) in fat_cont_expand()
162 err = sync_page_range_nolock(inode, mapping, start, count); in fat_cont_expand()
168 static int fat_free(struct inode *inode, int skip) in fat_free() argument
170 struct super_block *sb = inode->i_sb; in fat_free()
173 if (MSDOS_I(inode)->i_start == 0) in fat_free()
176 fat_cache_inval_inode(inode); in fat_free()
178 wait = IS_DIRSYNC(inode); in fat_free()
179 i_start = free_start = MSDOS_I(inode)->i_start; in fat_free()
180 i_logstart = MSDOS_I(inode)->i_logstart; in fat_free()
184 MSDOS_I(inode)->i_start = 0; in fat_free()
185 MSDOS_I(inode)->i_logstart = 0; in fat_free()
187 MSDOS_I(inode)->i_attrs |= ATTR_ARCH; in fat_free()
188 inode->i_ctime = inode->i_mtime = CURRENT_TIME_SEC; in fat_free()
190 err = fat_sync_inode(inode); in fat_free()
192 MSDOS_I(inode)->i_start = i_start; in fat_free()
193 MSDOS_I(inode)->i_logstart = i_logstart; in fat_free()
197 mark_inode_dirty(inode); in fat_free()
204 ret = fat_get_cluster(inode, skip - 1, &fclus, &dclus); in fat_free()
211 ret = fat_ent_read(inode, &fatent, dclus); in fat_free()
218 __func__, MSDOS_I(inode)->i_pos); in fat_free()
221 err = fat_ent_write(inode, &fatent, FAT_ENT_EOF, wait); in fat_free()
231 inode->i_blocks = skip << (MSDOS_SB(sb)->cluster_bits - 9); in fat_free()
234 return fat_free_clusters(inode, free_start); in fat_free()
237 void fat_truncate(struct inode *inode) in fat_truncate() argument
239 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_truncate()
247 if (MSDOS_I(inode)->mmu_private > inode->i_size) in fat_truncate()
248 MSDOS_I(inode)->mmu_private = inode->i_size; in fat_truncate()
250 nr_clusters = (inode->i_size + (cluster_size - 1)) >> sbi->cluster_bits; in fat_truncate()
252 fat_free(inode, nr_clusters); in fat_truncate()
253 fat_flush_inodes(inode->i_sb, inode, NULL); in fat_truncate()
258 struct inode *inode = dentry->d_inode; in fat_getattr() local
259 generic_fillattr(inode, stat); in fat_getattr()
260 stat->blksize = MSDOS_SB(inode->i_sb)->cluster_size; in fat_getattr()
266 struct inode *inode, umode_t *mode_ptr) in fat_sanitize_mode() argument
275 if (S_ISREG(inode->i_mode)) in fat_sanitize_mode()
288 if ((perm & (S_IRUGO | S_IXUGO)) != (inode->i_mode & (S_IRUGO|S_IXUGO))) in fat_sanitize_mode()
290 if (fat_mode_can_hold_ro(inode)) { in fat_sanitize_mode()
303 static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode) in fat_allow_set_time() argument
307 if (current_fsuid() != inode->i_uid) { in fat_allow_set_time()
308 if (in_group_p(inode->i_gid)) in fat_allow_set_time()
325 struct inode *inode = dentry->d_inode; in fat_setattr() local
335 if (attr->ia_size > inode->i_size) { in fat_setattr()
336 error = fat_cont_expand(inode, attr->ia_size); in fat_setattr()
346 if (fat_allow_set_time(sbi, inode)) in fat_setattr()
350 error = inode_change_ok(inode, attr); in fat_setattr()
377 if (fat_sanitize_mode(sbi, inode, &attr->ia_mode) < 0) in fat_setattr()
382 error = inode_setattr(inode, attr); in fat_setattr()