Lines Matching refs:inode
26 struct inode vfs_inode;
30 static inline struct hostfs_inode_info *HOSTFS_I(struct inode *inode) in HOSTFS_I() argument
32 return list_entry(inode, struct hostfs_inode_info, vfs_inode); in HOSTFS_I()
124 static char *inode_name(struct inode *ino) in inode_name()
185 static struct inode *hostfs_iget(struct super_block *sb) in hostfs_iget()
187 struct inode *inode = new_inode(sb); in hostfs_iget() local
188 if (!inode) in hostfs_iget()
190 return inode; in hostfs_iget()
222 static struct inode *hostfs_alloc_inode(struct super_block *sb) in hostfs_alloc_inode()
236 static void hostfs_evict_inode(struct inode *inode) in hostfs_evict_inode() argument
238 truncate_inode_pages_final(&inode->i_data); in hostfs_evict_inode()
239 clear_inode(inode); in hostfs_evict_inode()
240 if (HOSTFS_I(inode)->fd != -1) { in hostfs_evict_inode()
241 close_file(&HOSTFS_I(inode)->fd); in hostfs_evict_inode()
242 HOSTFS_I(inode)->fd = -1; in hostfs_evict_inode()
248 struct inode *inode = container_of(head, struct inode, i_rcu); in hostfs_i_callback() local
249 kfree(HOSTFS_I(inode)); in hostfs_i_callback()
252 static void hostfs_destroy_inode(struct inode *inode) in hostfs_destroy_inode() argument
254 call_rcu(&inode->i_rcu, hostfs_i_callback); in hostfs_destroy_inode()
305 static int hostfs_open(struct inode *ino, struct file *file) in hostfs_open()
364 static int hostfs_file_release(struct inode *inode, struct file *file) in hostfs_file_release() argument
366 filemap_write_and_wait(inode->i_mapping); in hostfs_file_release()
374 struct inode *inode = file->f_mapping->host; in hostfs_fsync() local
377 ret = filemap_write_and_wait_range(inode->i_mapping, start, end); in hostfs_fsync()
381 mutex_lock(&inode->i_mutex); in hostfs_fsync()
382 ret = fsync_file(HOSTFS_I(inode)->fd, datasync); in hostfs_fsync()
383 mutex_unlock(&inode->i_mutex); in hostfs_fsync()
410 struct inode *inode = mapping->host; in hostfs_writepage() local
414 int end_index = inode->i_size >> PAGE_CACHE_SHIFT; in hostfs_writepage()
418 count = inode->i_size & (PAGE_CACHE_SIZE-1); in hostfs_writepage()
422 err = write_file(HOSTFS_I(inode)->fd, &base, buffer, count); in hostfs_writepage()
428 if (base > inode->i_size) in hostfs_writepage()
429 inode->i_size = base; in hostfs_writepage()
486 struct inode *inode = mapping->host; in hostfs_write_end() local
502 if (err > 0 && (pos > inode->i_size)) in hostfs_write_end()
503 inode->i_size = pos; in hostfs_write_end()
518 static int read_name(struct inode *ino, char *name) in read_name()
566 static int hostfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, in hostfs_create()
569 struct inode *inode; in hostfs_create() local
573 inode = hostfs_iget(dir->i_sb); in hostfs_create()
574 if (IS_ERR(inode)) { in hostfs_create()
575 error = PTR_ERR(inode); in hostfs_create()
588 error = read_name(inode, name); in hostfs_create()
594 HOSTFS_I(inode)->fd = fd; in hostfs_create()
595 HOSTFS_I(inode)->mode = FMODE_READ | FMODE_WRITE; in hostfs_create()
596 d_instantiate(dentry, inode); in hostfs_create()
600 iput(inode); in hostfs_create()
605 static struct dentry *hostfs_lookup(struct inode *ino, struct dentry *dentry, in hostfs_lookup()
608 struct inode *inode; in hostfs_lookup() local
612 inode = hostfs_iget(ino->i_sb); in hostfs_lookup()
613 if (IS_ERR(inode)) { in hostfs_lookup()
614 err = PTR_ERR(inode); in hostfs_lookup()
623 err = read_name(inode, name); in hostfs_lookup()
627 iput(inode); in hostfs_lookup()
628 inode = NULL; in hostfs_lookup()
633 d_add(dentry, inode); in hostfs_lookup()
637 iput(inode); in hostfs_lookup()
642 static int hostfs_link(struct dentry *to, struct inode *ino, in hostfs_link()
661 static int hostfs_unlink(struct inode *ino, struct dentry *dentry) in hostfs_unlink()
677 static int hostfs_symlink(struct inode *ino, struct dentry *dentry, in hostfs_symlink()
690 static int hostfs_mkdir(struct inode *ino, struct dentry *dentry, umode_t mode) in hostfs_mkdir()
702 static int hostfs_rmdir(struct inode *ino, struct dentry *dentry) in hostfs_rmdir()
714 static int hostfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) in hostfs_mknod()
716 struct inode *inode; in hostfs_mknod() local
720 inode = hostfs_iget(dir->i_sb); in hostfs_mknod()
721 if (IS_ERR(inode)) { in hostfs_mknod()
722 err = PTR_ERR(inode); in hostfs_mknod()
731 init_special_inode(inode, mode, dev); in hostfs_mknod()
736 err = read_name(inode, name); in hostfs_mknod()
741 d_instantiate(dentry, inode); in hostfs_mknod()
747 iput(inode); in hostfs_mknod()
752 static int hostfs_rename2(struct inode *old_dir, struct dentry *old_dentry, in hostfs_rename2()
753 struct inode *new_dir, struct dentry *new_dentry, in hostfs_rename2()
780 static int hostfs_permission(struct inode *ino, int desired) in hostfs_permission()
808 struct inode *inode = d_inode(dentry); in hostfs_setattr() local
813 int fd = HOSTFS_I(inode)->fd; in hostfs_setattr()
815 err = inode_change_ok(inode, attr); in hostfs_setattr()
866 attr->ia_size != i_size_read(inode)) in hostfs_setattr()
867 truncate_setsize(inode, attr->ia_size); in hostfs_setattr()
869 setattr_copy(inode, attr); in hostfs_setattr()
870 mark_inode_dirty(inode); in hostfs_setattr()
916 static void hostfs_put_link(struct inode *unused, void *cookie) in hostfs_put_link()
929 struct inode *root_inode; in hostfs_fill_sb_common()