Lines Matching refs:dir

24 static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino);
25 static struct buffer_head *bfs_find_entry(struct inode *dir,
31 struct inode *dir = file_inode(f); in bfs_readdir() local
40 dir->i_sb->s_id, dir->i_ino); in bfs_readdir()
44 while (ctx->pos < dir->i_size) { in bfs_readdir()
46 block = BFS_I(dir)->i_sblock + (ctx->pos >> BFS_BSIZE_BITS); in bfs_readdir()
47 bh = sb_bread(dir->i_sb, block); in bfs_readdir()
65 } while ((offset < BFS_BSIZE) && (ctx->pos < dir->i_size)); in bfs_readdir()
78 static int bfs_create(struct user_namespace *mnt_userns, struct inode *dir, in bfs_create() argument
83 struct super_block *s = dir->i_sb; in bfs_create()
99 inode_init_owner(&init_user_ns, inode, dir, mode); in bfs_create()
113 err = bfs_add_entry(dir, &dentry->d_name, inode->i_ino); in bfs_create()
125 static struct dentry *bfs_lookup(struct inode *dir, struct dentry *dentry, in bfs_lookup() argument
131 struct bfs_sb_info *info = BFS_SB(dir->i_sb); in bfs_lookup()
137 bh = bfs_find_entry(dir, &dentry->d_name, &de); in bfs_lookup()
141 inode = bfs_iget(dir->i_sb, ino); in bfs_lookup()
147 static int bfs_link(struct dentry *old, struct inode *dir, in bfs_link() argument
155 err = bfs_add_entry(dir, &new->d_name, inode->i_ino); in bfs_link()
169 static int bfs_unlink(struct inode *dir, struct dentry *dentry) in bfs_unlink() argument
178 bh = bfs_find_entry(dir, &dentry->d_name, &de); in bfs_unlink()
189 mark_buffer_dirty_inode(bh, dir); in bfs_unlink()
190 dir->i_ctime = dir->i_mtime = current_time(dir); in bfs_unlink()
191 mark_inode_dirty(dir); in bfs_unlink()
192 inode->i_ctime = dir->i_ctime; in bfs_unlink()
267 static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) in bfs_add_entry() argument
283 sblock = BFS_I(dir)->i_sblock; in bfs_add_entry()
284 eblock = BFS_I(dir)->i_eblock; in bfs_add_entry()
286 bh = sb_bread(dir->i_sb, block); in bfs_add_entry()
293 if (pos >= dir->i_size) { in bfs_add_entry()
294 dir->i_size += BFS_DIRENT_SIZE; in bfs_add_entry()
295 dir->i_ctime = current_time(dir); in bfs_add_entry()
297 dir->i_mtime = current_time(dir); in bfs_add_entry()
298 mark_inode_dirty(dir); in bfs_add_entry()
303 mark_buffer_dirty_inode(bh, dir); in bfs_add_entry()
321 static struct buffer_head *bfs_find_entry(struct inode *dir, in bfs_find_entry() argument
335 while (block * BFS_BSIZE + offset < dir->i_size) { in bfs_find_entry()
337 bh = sb_bread(dir->i_sb, BFS_I(dir)->i_sblock + block); in bfs_find_entry()