Searched refs:dir (Results 1 - 200 of 1634) sorted by relevance

123456789

/linux-4.4.14/fs/omfs/
H A DMakefile4 omfs-y := bitmap.o dir.o file.o inode.o
H A Ddir.c24 static struct buffer_head *omfs_get_bucket(struct inode *dir, omfs_get_bucket() argument
27 int nbuckets = (dir->i_size - OMFS_DIR_START)/8; omfs_get_bucket()
31 return omfs_bread(dir->i_sb, dir->i_ino); omfs_get_bucket()
34 static struct buffer_head *omfs_scan_list(struct inode *dir, u64 block, omfs_scan_list() argument
44 bh = omfs_bread(dir->i_sb, block); omfs_scan_list()
51 if (omfs_is_bad(OMFS_SB(dir->i_sb), &oi->i_head, block)) { omfs_scan_list()
67 static struct buffer_head *omfs_find_entry(struct inode *dir, omfs_find_entry() argument
74 bh = omfs_get_bucket(dir, name, namelen, &ofs); omfs_find_entry()
81 return omfs_scan_list(dir, block, name, namelen, &dummy); omfs_find_entry()
113 struct inode *dir = d_inode(dentry->d_parent); omfs_add_link() local
123 bh = omfs_get_bucket(dir, name, namelen, &ofs); omfs_add_link()
134 bh = omfs_bread(dir->i_sb, inode->i_ino); omfs_add_link()
142 oi->i_parent = cpu_to_be64(dir->i_ino); omfs_add_link()
146 dir->i_ctime = CURRENT_TIME_SEC; omfs_add_link()
149 mark_inode_dirty(dir); omfs_add_link()
158 struct inode *dir = d_inode(dentry->d_parent); omfs_delete_entry() local
170 bh = omfs_get_bucket(dir, name, namelen, &ofs); omfs_delete_entry()
177 bh2 = omfs_scan_list(dir, block, name, namelen, &prev); omfs_delete_entry()
190 bh = omfs_bread(dir->i_sb, prev); omfs_delete_entry()
202 dirty = omfs_iget(dir->i_sb, prev); omfs_delete_entry()
238 static int omfs_remove(struct inode *dir, struct dentry *dentry) omfs_remove() argument
254 mark_inode_dirty(dir); omfs_remove()
258 static int omfs_add_node(struct inode *dir, struct dentry *dentry, umode_t mode) omfs_add_node() argument
261 struct inode *inode = omfs_new_inode(dir, mode); omfs_add_node()
266 err = omfs_make_empty(inode, dir->i_sb); omfs_add_node()
282 static int omfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) omfs_mkdir() argument
284 return omfs_add_node(dir, dentry, mode | S_IFDIR); omfs_mkdir()
287 static int omfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, omfs_create() argument
290 return omfs_add_node(dir, dentry, mode | S_IFREG); omfs_create()
293 static struct dentry *omfs_lookup(struct inode *dir, struct dentry *dentry, omfs_lookup() argument
302 bh = omfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len); omfs_lookup()
307 inode = omfs_iget(dir->i_sb, ino); omfs_lookup()
330 static bool omfs_fill_chain(struct inode *dir, struct dir_context *ctx, omfs_fill_chain() argument
335 struct buffer_head *bh = omfs_bread(dir->i_sb, fsblock); omfs_fill_chain()
344 if (omfs_is_bad(OMFS_SB(dir->i_sb), &oi->i_head, fsblock)) { omfs_fill_chain()
381 /* overwriting existing file/dir */ omfs_rename()
406 struct inode *dir = file_inode(file); omfs_readdir() local
421 nbuckets = (dir->i_size - OMFS_DIR_START) / 8; omfs_readdir()
427 bh = omfs_bread(dir->i_sb, dir->i_ino); omfs_readdir()
435 if (!omfs_fill_chain(dir, ctx, fsblock, hindex)) omfs_readdir()
/linux-4.4.14/fs/adfs/
H A Ddir_f.c16 static void adfs_f_free(struct adfs_dir *dir);
85 adfs_dir_checkbyte(const struct adfs_dir *dir) adfs_dir_checkbyte() argument
87 struct buffer_head * const *bh = dir->bh; adfs_dir_checkbyte()
88 const int blocksize_bits = dir->sb->s_blocksize_bits; adfs_dir_checkbyte()
144 unsigned int size, struct adfs_dir *dir) adfs_dir_read()
158 dir->nr_buffers = 0; adfs_dir_read()
159 dir->sb = sb; adfs_dir_read()
166 adfs_error(sb, "dir object %lX has a hole at offset %d", adfs_dir_read()
171 dir->bh[blk] = sb_bread(sb, phys); adfs_dir_read()
172 if (!dir->bh[blk]) adfs_dir_read()
176 memcpy(&dir->dirhead, bufoff(dir->bh, 0), sizeof(dir->dirhead)); adfs_dir_read()
177 memcpy(&dir->dirtail, bufoff(dir->bh, 2007), sizeof(dir->dirtail)); adfs_dir_read()
179 if (dir->dirhead.startmasseq != dir->dirtail.new.endmasseq || adfs_dir_read()
180 memcmp(&dir->dirhead.startname, &dir->dirtail.new.endname, 4)) adfs_dir_read()
183 if (memcmp(&dir->dirhead.startname, "Nick", 4) && adfs_dir_read()
184 memcmp(&dir->dirhead.startname, "Hugo", 4)) adfs_dir_read()
187 if (adfs_dir_checkbyte(dir) != dir->dirtail.new.dircheckbyte) adfs_dir_read()
190 dir->nr_buffers = blk; adfs_dir_read()
199 brelse(dir->bh[blk]); adfs_dir_read()
201 dir->sb = NULL; adfs_dir_read()
210 adfs_dir2obj(struct adfs_dir *dir, struct object_info *obj, adfs_dir2obj() argument
230 if (ADFS_SB(dir->sb)->s_ftsuffix) adfs_dir2obj()
256 __adfs_dir_get(struct adfs_dir *dir, int pos, struct object_info *obj) __adfs_dir_get() argument
258 struct super_block *sb = dir->sb; __adfs_dir_get()
264 if (buffer > dir->nr_buffers) __adfs_dir_get()
272 memcpy(&de, dir->bh[buffer]->b_data + offset, thissize); __adfs_dir_get()
274 memcpy(((char *)&de) + thissize, dir->bh[buffer + 1]->b_data, __adfs_dir_get()
280 adfs_dir2obj(dir, obj, &de); __adfs_dir_get()
286 __adfs_dir_put(struct adfs_dir *dir, int pos, struct object_info *obj) __adfs_dir_put() argument
288 struct super_block *sb = dir->sb; __adfs_dir_put()
294 if (buffer > dir->nr_buffers) __adfs_dir_put()
305 memcpy(&de, dir->bh[buffer]->b_data + offset, thissize); __adfs_dir_put()
307 memcpy(((char *)&de) + thissize, dir->bh[buffer + 1]->b_data, __adfs_dir_put()
318 memcpy(dir->bh[buffer]->b_data + offset, &de, thissize); __adfs_dir_put()
320 memcpy(dir->bh[buffer + 1]->b_data, ((char *)&de) + thissize, __adfs_dir_put()
331 adfs_dir_find_entry(struct adfs_dir *dir, unsigned long object_id) adfs_dir_find_entry() argument
340 if (!__adfs_dir_get(dir, pos, &obj)) adfs_dir_find_entry()
353 adfs_f_read(struct super_block *sb, unsigned int id, unsigned int sz, struct adfs_dir *dir) adfs_f_read() argument
360 ret = adfs_dir_read(sb, id, sz, dir); adfs_f_read()
364 dir->parent_id = adfs_readval(dir->dirtail.new.dirparent, 3); adfs_f_read()
370 adfs_f_setpos(struct adfs_dir *dir, unsigned int fpos) adfs_f_setpos() argument
375 dir->pos = 5 + fpos * 26; adfs_f_setpos()
380 adfs_f_getnext(struct adfs_dir *dir, struct object_info *obj) adfs_f_getnext() argument
384 ret = __adfs_dir_get(dir, dir->pos, obj); adfs_f_getnext()
386 dir->pos += 26; adfs_f_getnext()
392 adfs_f_update(struct adfs_dir *dir, struct object_info *obj) adfs_f_update() argument
394 struct super_block *sb = dir->sb; adfs_f_update()
397 ret = adfs_dir_find_entry(dir, obj->file_id); adfs_f_update()
399 adfs_error(dir->sb, "unable to locate entry to update"); adfs_f_update()
403 __adfs_dir_put(dir, ret, obj); adfs_f_update()
408 dir->bh[0]->b_data[0] += 1; adfs_f_update()
409 dir->bh[dir->nr_buffers - 1]->b_data[sb->s_blocksize - 6] += 1; adfs_f_update()
411 ret = adfs_dir_checkbyte(dir); adfs_f_update()
415 dir->bh[dir->nr_buffers - 1]->b_data[sb->s_blocksize - 1] = ret; adfs_f_update()
421 memcpy(&dir->dirhead, bufoff(dir->bh, 0), sizeof(dir->dirhead)); adfs_f_update()
422 memcpy(&dir->dirtail, bufoff(dir->bh, 2007), sizeof(dir->dirtail)); adfs_f_update()
424 if (dir->dirhead.startmasseq != dir->dirtail.new.endmasseq || adfs_f_update()
425 memcmp(&dir->dirhead.startname, &dir->dirtail.new.endname, 4)) adfs_f_update()
428 if (memcmp(&dir->dirhead.startname, "Nick", 4) && adfs_f_update()
429 memcmp(&dir->dirhead.startname, "Hugo", 4)) adfs_f_update()
432 if (adfs_dir_checkbyte(dir) != dir->dirtail.new.dircheckbyte) adfs_f_update()
436 for (i = dir->nr_buffers - 1; i >= 0; i--) adfs_f_update()
437 mark_buffer_dirty(dir->bh[i]); adfs_f_update()
444 adfs_error(dir->sb, "whoops! I broke a directory!"); adfs_f_update()
450 adfs_f_sync(struct adfs_dir *dir) adfs_f_sync() argument
455 for (i = dir->nr_buffers - 1; i >= 0; i--) { adfs_f_sync()
456 struct buffer_head *bh = dir->bh[i]; adfs_f_sync()
466 adfs_f_free(struct adfs_dir *dir) adfs_f_free() argument
470 for (i = dir->nr_buffers - 1; i >= 0; i--) { adfs_f_free()
471 brelse(dir->bh[i]); adfs_f_free()
472 dir->bh[i] = NULL; adfs_f_free()
475 dir->nr_buffers = 0; adfs_f_free()
476 dir->sb = NULL; adfs_f_free()
143 adfs_dir_read(struct super_block *sb, unsigned long object_id, unsigned int size, struct adfs_dir *dir) adfs_dir_read() argument
H A Ddir_fplus.c16 adfs_fplus_read(struct super_block *sb, unsigned int id, unsigned int sz, struct adfs_dir *dir) adfs_fplus_read() argument
24 dir->nr_buffers = 0; adfs_fplus_read()
27 dir->bh_fplus = &dir->bh[0]; adfs_fplus_read()
31 adfs_error(sb, "dir object %X has a hole at offset 0", id); adfs_fplus_read()
35 dir->bh_fplus[0] = sb_bread(sb, block); adfs_fplus_read()
36 if (!dir->bh_fplus[0]) adfs_fplus_read()
38 dir->nr_buffers += 1; adfs_fplus_read()
40 h = (struct adfs_bigdirheader *)dir->bh_fplus[0]->b_data; adfs_fplus_read()
52 printk(KERN_WARNING "adfs: dir object %X has" adfs_fplus_read()
53 " malformed dir header\n", id); adfs_fplus_read()
58 if (size > ARRAY_SIZE(dir->bh)) { adfs_fplus_read()
66 " dir object %X (%d blocks)", id, size); adfs_fplus_read()
69 dir->bh_fplus = bh_fplus; adfs_fplus_read()
71 dir->bh_fplus[0] = dir->bh[0]; adfs_fplus_read()
77 adfs_error(sb, "dir object %X has a hole at offset %d", id, blk); adfs_fplus_read()
81 dir->bh_fplus[blk] = sb_bread(sb, block); adfs_fplus_read()
82 if (!dir->bh_fplus[blk]) { adfs_fplus_read()
83 adfs_error(sb, "dir object %x failed read for offset %d, mapped block %lX", adfs_fplus_read()
88 dir->nr_buffers += 1; adfs_fplus_read()
92 (dir->bh_fplus[size - 1]->b_data + (sb->s_blocksize - 8)); adfs_fplus_read()
97 printk(KERN_WARNING "adfs: dir object %X has " adfs_fplus_read()
98 "malformed dir end\n", id); adfs_fplus_read()
102 dir->parent_id = le32_to_cpu(h->bigdirparent); adfs_fplus_read()
103 dir->sb = sb; adfs_fplus_read()
107 if (dir->bh_fplus) { adfs_fplus_read()
108 for (i = 0; i < dir->nr_buffers; i++) adfs_fplus_read()
109 brelse(dir->bh_fplus[i]); adfs_fplus_read()
111 if (&dir->bh[0] != dir->bh_fplus) adfs_fplus_read()
112 kfree(dir->bh_fplus); adfs_fplus_read()
114 dir->bh_fplus = NULL; adfs_fplus_read()
117 dir->nr_buffers = 0; adfs_fplus_read()
118 dir->sb = NULL; adfs_fplus_read()
123 adfs_fplus_setpos(struct adfs_dir *dir, unsigned int fpos) adfs_fplus_setpos() argument
126 (struct adfs_bigdirheader *) dir->bh_fplus[0]->b_data; adfs_fplus_setpos()
130 dir->pos = fpos; adfs_fplus_setpos()
138 dir_memcpy(struct adfs_dir *dir, unsigned int offset, void *to, int len) dir_memcpy() argument
140 struct super_block *sb = dir->sb; dir_memcpy()
149 memcpy(to, dir->bh_fplus[buffer]->b_data + offset, len); dir_memcpy()
156 dir->bh_fplus[buffer]->b_data + offset, dir_memcpy()
160 dir->bh_fplus[buffer + 1]->b_data, dir_memcpy()
166 adfs_fplus_getnext(struct adfs_dir *dir, struct object_info *obj) adfs_fplus_getnext() argument
169 (struct adfs_bigdirheader *) dir->bh_fplus[0]->b_data; adfs_fplus_getnext()
174 if (dir->pos >= le32_to_cpu(h->bigdirentries)) adfs_fplus_getnext()
179 offset += dir->pos * sizeof(struct adfs_bigdirentry); adfs_fplus_getnext()
181 dir_memcpy(dir, offset, &bde, sizeof(struct adfs_bigdirentry)); adfs_fplus_getnext()
195 dir_memcpy(dir, offset, obj->name, obj->name_len); adfs_fplus_getnext()
211 if (ADFS_SB(dir->sb)->s_ftsuffix) adfs_fplus_getnext()
218 dir->pos += 1; adfs_fplus_getnext()
225 adfs_fplus_sync(struct adfs_dir *dir) adfs_fplus_sync() argument
230 for (i = dir->nr_buffers - 1; i >= 0; i--) { adfs_fplus_sync()
231 struct buffer_head *bh = dir->bh_fplus[i]; adfs_fplus_sync()
241 adfs_fplus_free(struct adfs_dir *dir) adfs_fplus_free() argument
245 if (dir->bh_fplus) { adfs_fplus_free()
246 for (i = 0; i < dir->nr_buffers; i++) adfs_fplus_free()
247 brelse(dir->bh_fplus[i]); adfs_fplus_free()
249 if (&dir->bh[0] != dir->bh_fplus) adfs_fplus_free()
250 kfree(dir->bh_fplus); adfs_fplus_free()
252 dir->bh_fplus = NULL; adfs_fplus_free()
255 dir->nr_buffers = 0; adfs_fplus_free()
256 dir->sb = NULL; adfs_fplus_free()
H A DMakefile7 adfs-objs := dir.o dir_f.o dir_fplus.o file.o inode.o map.o super.o
H A Ddir.c2 * linux/fs/adfs/dir.c
26 struct adfs_dir dir; adfs_readdir() local
32 ret = ops->read(sb, inode->i_ino, inode->i_size, &dir); adfs_readdir()
42 if (!dir_emit(ctx, "..", 2, dir.parent_id, DT_DIR)) adfs_readdir()
49 ret = ops->setpos(&dir, ctx->pos - 2); adfs_readdir()
52 while (ops->getnext(&dir, &obj) == 0) { adfs_readdir()
63 ops->free(&dir); adfs_readdir()
73 struct adfs_dir dir; adfs_dir_update() local
75 printk(KERN_INFO "adfs_dir_update: object %06X in dir %06X\n", adfs_dir_update()
83 ret = ops->read(sb, obj->parent_id, 0, &dir); adfs_dir_update()
88 ret = ops->update(&dir, obj); adfs_dir_update()
92 int err = ops->sync(&dir); adfs_dir_update()
97 ops->free(&dir); adfs_dir_update()
133 struct adfs_dir dir; adfs_dir_lookup_byname() local
136 ret = ops->read(sb, inode->i_ino, inode->i_size, &dir); adfs_dir_lookup_byname()
140 if (ADFS_I(inode)->parent_id != dir.parent_id) { adfs_dir_lookup_byname()
142 ADFS_I(inode)->parent_id, dir.parent_id); adfs_dir_lookup_byname()
165 ret = ops->setpos(&dir, 0); adfs_dir_lookup_byname()
170 while (ops->getnext(&dir, obj) == 0) { adfs_dir_lookup_byname()
181 ops->free(&dir); adfs_dir_lookup_byname()
261 adfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) adfs_lookup() argument
267 error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj); adfs_lookup()
274 inode = adfs_iget(dir->i_sb, &obj); adfs_lookup()
H A Dadfs.h129 int (*read)(struct super_block *sb, unsigned int id, unsigned int sz, struct adfs_dir *dir);
130 int (*setpos)(struct adfs_dir *dir, unsigned int fpos);
131 int (*getnext)(struct adfs_dir *dir, struct object_info *obj);
132 int (*update)(struct adfs_dir *dir, struct object_info *obj);
133 int (*create)(struct adfs_dir *dir, struct object_info *obj);
134 int (*remove)(struct adfs_dir *dir, struct object_info *obj);
135 int (*sync)(struct adfs_dir *dir);
136 void (*free)(struct adfs_dir *dir);
/linux-4.4.14/fs/kernfs/
H A DMakefile5 obj-y := mount.o inode.o dir.o file.o symlink.o
/linux-4.4.14/fs/bfs/
H A DMakefile7 bfs-objs := inode.o file.o dir.o
H A Ddir.c2 * fs/bfs/dir.c
23 static int bfs_add_entry(struct inode *dir, const unsigned char *name,
25 static struct buffer_head *bfs_find_entry(struct inode *dir,
31 struct inode *dir = file_inode(f); bfs_readdir() local
40 dir->i_sb->s_id, dir->i_ino); bfs_readdir()
44 while (ctx->pos < dir->i_size) { bfs_readdir()
46 block = BFS_I(dir)->i_sblock + (ctx->pos >> BFS_BSIZE_BITS); bfs_readdir()
47 bh = sb_bread(dir->i_sb, block); bfs_readdir()
65 } while ((offset < BFS_BSIZE) && (ctx->pos < dir->i_size)); bfs_readdir()
78 static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bfs_create() argument
83 struct super_block *s = dir->i_sb; bfs_create()
99 inode_init_owner(inode, dir, mode); bfs_create()
113 err = bfs_add_entry(dir, dentry->d_name.name, dentry->d_name.len, bfs_create()
126 static struct dentry *bfs_lookup(struct inode *dir, struct dentry *dentry, bfs_lookup() argument
132 struct bfs_sb_info *info = BFS_SB(dir->i_sb); bfs_lookup()
138 bh = bfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, &de); bfs_lookup()
142 inode = bfs_iget(dir->i_sb, ino); bfs_lookup()
153 static int bfs_link(struct dentry *old, struct inode *dir, bfs_link() argument
161 err = bfs_add_entry(dir, new->d_name.name, new->d_name.len, bfs_link()
176 static int bfs_unlink(struct inode *dir, struct dentry *dentry) bfs_unlink() argument
185 bh = bfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, &de); bfs_unlink()
196 mark_buffer_dirty_inode(bh, dir); bfs_unlink()
197 dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; bfs_unlink()
198 mark_inode_dirty(dir); bfs_unlink()
199 inode->i_ctime = dir->i_ctime; bfs_unlink()
276 static int bfs_add_entry(struct inode *dir, const unsigned char *name, bfs_add_entry() argument
291 sblock = BFS_I(dir)->i_sblock; bfs_add_entry()
292 eblock = BFS_I(dir)->i_eblock; bfs_add_entry()
294 bh = sb_bread(dir->i_sb, block); bfs_add_entry()
301 if (pos >= dir->i_size) { bfs_add_entry()
302 dir->i_size += BFS_DIRENT_SIZE; bfs_add_entry()
303 dir->i_ctime = CURRENT_TIME_SEC; bfs_add_entry()
305 dir->i_mtime = CURRENT_TIME_SEC; bfs_add_entry()
306 mark_inode_dirty(dir); bfs_add_entry()
311 mark_buffer_dirty_inode(bh, dir); bfs_add_entry()
329 static struct buffer_head *bfs_find_entry(struct inode *dir, bfs_find_entry() argument
341 while (block * BFS_BSIZE + offset < dir->i_size) { bfs_find_entry()
343 bh = sb_bread(dir->i_sb, BFS_I(dir)->i_sblock + block); bfs_find_entry()
/linux-4.4.14/fs/overlayfs/
H A DMakefile7 overlay-objs := super.o inode.o dir.o readdir.o copy_up.o
H A Doverlayfs.h30 static inline int ovl_do_rmdir(struct inode *dir, struct dentry *dentry) ovl_do_rmdir() argument
32 int err = vfs_rmdir(dir, dentry); ovl_do_rmdir()
37 static inline int ovl_do_unlink(struct inode *dir, struct dentry *dentry) ovl_do_unlink() argument
39 int err = vfs_unlink(dir, dentry, NULL); ovl_do_unlink()
44 static inline int ovl_do_link(struct dentry *old_dentry, struct inode *dir, ovl_do_link() argument
47 int err = vfs_link(old_dentry, dir, new_dentry, NULL); ovl_do_link()
55 static inline int ovl_do_create(struct inode *dir, struct dentry *dentry, ovl_do_create() argument
58 int err = vfs_create(dir, dentry, mode, true); ovl_do_create()
64 static inline int ovl_do_mkdir(struct inode *dir, struct dentry *dentry, ovl_do_mkdir() argument
67 int err = vfs_mkdir(dir, dentry, mode); ovl_do_mkdir()
73 static inline int ovl_do_mknod(struct inode *dir, struct dentry *dentry, ovl_do_mknod() argument
76 int err = vfs_mknod(dir, dentry, mode, dev); ovl_do_mknod()
84 static inline int ovl_do_symlink(struct inode *dir, struct dentry *dentry, ovl_do_symlink() argument
87 int err = vfs_symlink(dir, dentry, oldname); ovl_do_symlink()
127 static inline int ovl_do_whiteout(struct inode *dir, struct dentry *dentry) ovl_do_whiteout() argument
129 int err = vfs_whiteout(dir, dentry); ovl_do_whiteout()
154 struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
186 /* dir.c */
189 int ovl_create_real(struct inode *dir, struct dentry *newdentry,
192 void ovl_cleanup(struct inode *dir, struct dentry *dentry);
/linux-4.4.14/fs/qnx4/
H A DMakefile7 qnx4-objs := inode.o dir.o namei.o bitmap.o
H A Dnamei.c56 static struct buffer_head *qnx4_find_entry(int len, struct inode *dir, qnx4_find_entry() argument
65 while (blkofs * QNX4_BLOCK_SIZE + offset < dir->i_size) { qnx4_find_entry()
67 block = qnx4_block_map(dir, blkofs); qnx4_find_entry()
69 bh = sb_bread(dir->i_sb, block); qnx4_find_entry()
94 struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) qnx4_lookup() argument
104 if (!(bh = qnx4_find_entry(len, dir, name, &de, &ino))) qnx4_lookup()
115 foundinode = qnx4_iget(dir->i_sb, ino); qnx4_lookup()
/linux-4.4.14/fs/sysfs/
H A DMakefile5 obj-y := file.o dir.o symlink.o mount.o group.o
/linux-4.4.14/arch/c6x/kernel/
H A Ddma.c18 enum dma_data_direction dir) c6x_dma_sync()
22 BUG_ON(!valid_dma_direction(dir)); c6x_dma_sync()
24 switch (dir) { c6x_dma_sync()
40 enum dma_data_direction dir) dma_map_single()
44 c6x_dma_sync(addr, size, dir); dma_map_single()
48 dir, addr, true); dma_map_single()
55 size_t size, enum dma_data_direction dir) dma_unmap_single()
57 c6x_dma_sync(handle, size, dir); dma_unmap_single()
59 debug_dma_unmap_page(dev, handle, size, dir, true); dma_unmap_single()
65 int nents, enum dma_data_direction dir) dma_map_sg()
72 dir); dma_map_sg()
74 debug_dma_map_sg(dev, sglist, nents, nents, dir); dma_map_sg()
82 int nents, enum dma_data_direction dir) dma_unmap_sg()
88 dma_unmap_single(dev, sg_dma_address(sg), sg->length, dir); dma_unmap_sg()
90 debug_dma_unmap_sg(dev, sglist, nents, dir); dma_unmap_sg()
95 size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu()
97 c6x_dma_sync(handle, size, dir); dma_sync_single_for_cpu()
99 debug_dma_sync_single_for_cpu(dev, handle, size, dir); dma_sync_single_for_cpu()
105 size_t size, enum dma_data_direction dir) dma_sync_single_for_device()
107 c6x_dma_sync(handle, size, dir); dma_sync_single_for_device()
109 debug_dma_sync_single_for_device(dev, handle, size, dir); dma_sync_single_for_device()
115 int nents, enum dma_data_direction dir) dma_sync_sg_for_cpu()
122 sg->length, dir); dma_sync_sg_for_cpu()
124 debug_dma_sync_sg_for_cpu(dev, sglist, nents, dir); dma_sync_sg_for_cpu()
130 int nents, enum dma_data_direction dir) dma_sync_sg_for_device()
137 sg->length, dir); dma_sync_sg_for_device()
139 debug_dma_sync_sg_for_device(dev, sglist, nents, dir); dma_sync_sg_for_device()
17 c6x_dma_sync(dma_addr_t handle, size_t size, enum dma_data_direction dir) c6x_dma_sync() argument
39 dma_map_single(struct device *dev, void *ptr, size_t size, enum dma_data_direction dir) dma_map_single() argument
54 dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
64 dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction dir) dma_map_sg() argument
81 dma_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction dir) dma_unmap_sg() argument
94 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
104 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
114 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction dir) dma_sync_sg_for_cpu() argument
129 dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction dir) dma_sync_sg_for_device() argument
/linux-4.4.14/drivers/misc/cxl/
H A Ddebugfs.c56 struct dentry *dir; cxl_debugfs_adapter_add() local
63 dir = debugfs_create_dir(buf, cxl_debugfs); cxl_debugfs_adapter_add()
64 if (IS_ERR(dir)) cxl_debugfs_adapter_add()
65 return PTR_ERR(dir); cxl_debugfs_adapter_add()
66 adapter->debugfs = dir; cxl_debugfs_adapter_add()
68 debugfs_create_io_x64("fir1", S_IRUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_FIR1)); cxl_debugfs_adapter_add()
69 debugfs_create_io_x64("fir2", S_IRUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_FIR2)); cxl_debugfs_adapter_add()
70 debugfs_create_io_x64("fir_cntl", S_IRUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_FIR_CNTL)); cxl_debugfs_adapter_add()
71 debugfs_create_io_x64("err_ivte", S_IRUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_ErrIVTE)); cxl_debugfs_adapter_add()
73 debugfs_create_io_x64("trace", S_IRUSR | S_IWUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_TRACE)); cxl_debugfs_adapter_add()
85 struct dentry *dir; cxl_debugfs_afu_add() local
92 dir = debugfs_create_dir(buf, afu->adapter->debugfs); cxl_debugfs_afu_add()
93 if (IS_ERR(dir)) cxl_debugfs_afu_add()
94 return PTR_ERR(dir); cxl_debugfs_afu_add()
95 afu->debugfs = dir; cxl_debugfs_afu_add()
97 debugfs_create_io_x64("fir", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_FIR_SLICE_An)); cxl_debugfs_afu_add()
98 debugfs_create_io_x64("serr", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SERR_An)); cxl_debugfs_afu_add()
99 debugfs_create_io_x64("afu_debug", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_AFU_DEBUG_An)); cxl_debugfs_afu_add()
100 debugfs_create_io_x64("sr", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SR_An)); cxl_debugfs_afu_add()
102 debugfs_create_io_x64("dsisr", S_IRUSR, dir, _cxl_p2n_addr(afu, CXL_PSL_DSISR_An)); cxl_debugfs_afu_add()
103 debugfs_create_io_x64("dar", S_IRUSR, dir, _cxl_p2n_addr(afu, CXL_PSL_DAR_An)); cxl_debugfs_afu_add()
104 debugfs_create_io_x64("sstp0", S_IRUSR, dir, _cxl_p2n_addr(afu, CXL_SSTP0_An)); cxl_debugfs_afu_add()
105 debugfs_create_io_x64("sstp1", S_IRUSR, dir, _cxl_p2n_addr(afu, CXL_SSTP1_An)); cxl_debugfs_afu_add()
106 debugfs_create_io_x64("err_status", S_IRUSR, dir, _cxl_p2n_addr(afu, CXL_PSL_ErrStat_An)); cxl_debugfs_afu_add()
108 debugfs_create_io_x64("trace", S_IRUSR | S_IWUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SLICE_TRACE)); cxl_debugfs_afu_add()
/linux-4.4.14/lib/
H A Dcpu-notifier-error-inject.c21 static struct dentry *dir; variable in typeref:struct:dentry
27 dir = notifier_err_inject_init("cpu", notifier_err_inject_dir, err_inject_init()
29 if (IS_ERR(dir)) err_inject_init()
30 return PTR_ERR(dir); err_inject_init()
34 debugfs_remove_recursive(dir); err_inject_init()
42 debugfs_remove_recursive(dir); err_inject_exit()
H A Dmemory-notifier-error-inject.c19 static struct dentry *dir; variable in typeref:struct:dentry
25 dir = notifier_err_inject_init("memory", notifier_err_inject_dir, err_inject_init()
27 if (IS_ERR(dir)) err_inject_init()
28 return PTR_ERR(dir); err_inject_init()
32 debugfs_remove_recursive(dir); err_inject_init()
40 debugfs_remove_recursive(dir); err_inject_exit()
H A Dof-reconfig-notifier-error-inject.c22 static struct dentry *dir; variable in typeref:struct:dentry
28 dir = notifier_err_inject_init("OF-reconfig", err_inject_init()
30 if (IS_ERR(dir)) err_inject_init()
31 return PTR_ERR(dir); err_inject_init()
35 debugfs_remove_recursive(dir); err_inject_init()
43 debugfs_remove_recursive(dir); err_inject_exit()
H A Dpm-notifier-error-inject.c20 static struct dentry *dir; variable in typeref:struct:dentry
26 dir = notifier_err_inject_init("pm", notifier_err_inject_dir, err_inject_init()
28 if (IS_ERR(dir)) err_inject_init()
29 return PTR_ERR(dir); err_inject_init()
33 debugfs_remove_recursive(dir); err_inject_init()
41 debugfs_remove_recursive(dir); err_inject_exit()
H A Dfault-inject.c195 struct dentry *dir; fault_create_debugfs_attr() local
197 dir = debugfs_create_dir(name, parent); fault_create_debugfs_attr()
198 if (!dir) fault_create_debugfs_attr()
201 if (!debugfs_create_ul("probability", mode, dir, &attr->probability)) fault_create_debugfs_attr()
203 if (!debugfs_create_ul("interval", mode, dir, &attr->interval)) fault_create_debugfs_attr()
205 if (!debugfs_create_atomic_t("times", mode, dir, &attr->times)) fault_create_debugfs_attr()
207 if (!debugfs_create_atomic_t("space", mode, dir, &attr->space)) fault_create_debugfs_attr()
209 if (!debugfs_create_ul("verbose", mode, dir, &attr->verbose)) fault_create_debugfs_attr()
211 if (!debugfs_create_u32("verbose_ratelimit_interval_ms", mode, dir, fault_create_debugfs_attr()
214 if (!debugfs_create_u32("verbose_ratelimit_burst", mode, dir, fault_create_debugfs_attr()
217 if (!debugfs_create_bool("task-filter", mode, dir, &attr->task_filter)) fault_create_debugfs_attr()
222 if (!debugfs_create_stacktrace_depth("stacktrace-depth", mode, dir, fault_create_debugfs_attr()
225 if (!debugfs_create_ul("require-start", mode, dir, fault_create_debugfs_attr()
228 if (!debugfs_create_ul("require-end", mode, dir, &attr->require_end)) fault_create_debugfs_attr()
230 if (!debugfs_create_ul("reject-start", mode, dir, &attr->reject_start)) fault_create_debugfs_attr()
232 if (!debugfs_create_ul("reject-end", mode, dir, &attr->reject_end)) fault_create_debugfs_attr()
237 attr->dname = dget(dir); fault_create_debugfs_attr()
238 return dir; fault_create_debugfs_attr()
240 debugfs_remove_recursive(dir); fault_create_debugfs_attr()
H A Dnotifier-error-inject.c54 struct dentry *dir; notifier_err_inject_init() local
60 dir = debugfs_create_dir(name, parent); notifier_err_inject_init()
61 if (!dir) notifier_err_inject_init()
64 actions_dir = debugfs_create_dir("actions", dir); notifier_err_inject_init()
84 return dir; notifier_err_inject_init()
86 debugfs_remove_recursive(dir); notifier_err_inject_init()
H A Dswiotlb.c389 size_t size, enum dma_data_direction dir) swiotlb_bounce()
406 if (dir == DMA_TO_DEVICE) swiotlb_bounce()
418 } else if (dir == DMA_TO_DEVICE) { swiotlb_bounce()
428 enum dma_data_direction dir) swiotlb_tbl_map_single()
529 if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) swiotlb_tbl_map_single()
542 enum dma_data_direction dir) map_single()
546 return swiotlb_tbl_map_single(hwdev, start_dma_addr, phys, size, dir); map_single()
553 size_t size, enum dma_data_direction dir) swiotlb_tbl_unmap_single()
564 ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL))) swiotlb_tbl_unmap_single()
597 size_t size, enum dma_data_direction dir, swiotlb_tbl_sync_single()
609 if (likely(dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL)) swiotlb_tbl_sync_single()
613 BUG_ON(dir != DMA_TO_DEVICE); swiotlb_tbl_sync_single()
616 if (likely(dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)) swiotlb_tbl_sync_single()
620 BUG_ON(dir != DMA_FROM_DEVICE); swiotlb_tbl_sync_single()
707 swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir, swiotlb_full() argument
723 if (dir == DMA_BIDIRECTIONAL) swiotlb_full()
725 if (dir == DMA_FROM_DEVICE) swiotlb_full()
727 if (dir == DMA_TO_DEVICE) swiotlb_full()
740 enum dma_data_direction dir, swiotlb_map_page()
746 BUG_ON(dir == DMA_NONE); swiotlb_map_page()
758 map = map_single(dev, phys, size, dir); swiotlb_map_page()
760 swiotlb_full(dev, size, dir, 1); swiotlb_map_page()
768 swiotlb_tbl_unmap_single(dev, map, size, dir); swiotlb_map_page()
785 size_t size, enum dma_data_direction dir) unmap_single()
789 BUG_ON(dir == DMA_NONE); unmap_single()
792 swiotlb_tbl_unmap_single(hwdev, paddr, size, dir); unmap_single()
796 if (dir != DMA_FROM_DEVICE) unmap_single()
809 size_t size, enum dma_data_direction dir, swiotlb_unmap_page()
812 unmap_single(hwdev, dev_addr, size, dir); swiotlb_unmap_page()
828 size_t size, enum dma_data_direction dir, swiotlb_sync_single()
833 BUG_ON(dir == DMA_NONE); swiotlb_sync_single()
836 swiotlb_tbl_sync_single(hwdev, paddr, size, dir, target); swiotlb_sync_single()
840 if (dir != DMA_FROM_DEVICE) swiotlb_sync_single()
848 size_t size, enum dma_data_direction dir) swiotlb_sync_single_for_cpu()
850 swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_CPU); swiotlb_sync_single_for_cpu()
856 size_t size, enum dma_data_direction dir) swiotlb_sync_single_for_device()
858 swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_DEVICE); swiotlb_sync_single_for_device()
880 enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_map_sg_attrs()
885 BUG_ON(dir == DMA_NONE); swiotlb_map_sg_attrs()
894 sg->length, dir); for_each_sg()
898 swiotlb_full(hwdev, sg->length, dir, 0); for_each_sg()
899 swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir, for_each_sg()
915 enum dma_data_direction dir) swiotlb_map_sg()
917 return swiotlb_map_sg_attrs(hwdev, sgl, nelems, dir, NULL); swiotlb_map_sg()
927 int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_unmap_sg_attrs()
932 BUG_ON(dir == DMA_NONE); swiotlb_unmap_sg_attrs()
935 unmap_single(hwdev, sg->dma_address, sg_dma_len(sg), dir); swiotlb_unmap_sg_attrs()
942 enum dma_data_direction dir) swiotlb_unmap_sg()
944 return swiotlb_unmap_sg_attrs(hwdev, sgl, nelems, dir, NULL); swiotlb_unmap_sg()
957 int nelems, enum dma_data_direction dir, swiotlb_sync_sg()
965 sg_dma_len(sg), dir, target); swiotlb_sync_sg()
970 int nelems, enum dma_data_direction dir) swiotlb_sync_sg_for_cpu()
972 swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_CPU); swiotlb_sync_sg_for_cpu()
978 int nelems, enum dma_data_direction dir) swiotlb_sync_sg_for_device()
980 swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_DEVICE); swiotlb_sync_sg_for_device()
388 swiotlb_bounce(phys_addr_t orig_addr, phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir) swiotlb_bounce() argument
425 swiotlb_tbl_map_single(struct device *hwdev, dma_addr_t tbl_dma_addr, phys_addr_t orig_addr, size_t size, enum dma_data_direction dir) swiotlb_tbl_map_single() argument
541 map_single(struct device *hwdev, phys_addr_t phys, size_t size, enum dma_data_direction dir) map_single() argument
552 swiotlb_tbl_unmap_single(struct device *hwdev, phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir) swiotlb_tbl_unmap_single() argument
596 swiotlb_tbl_sync_single(struct device *hwdev, phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir, enum dma_sync_target target) swiotlb_tbl_sync_single() argument
738 swiotlb_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_map_page() argument
784 unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) unmap_single() argument
808 swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_unmap_page() argument
827 swiotlb_sync_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, enum dma_sync_target target) swiotlb_sync_single() argument
847 swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) swiotlb_sync_single_for_cpu() argument
855 swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) swiotlb_sync_single_for_device() argument
879 swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_map_sg_attrs() argument
914 swiotlb_map_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) swiotlb_map_sg() argument
926 swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_unmap_sg_attrs() argument
941 swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) swiotlb_unmap_sg() argument
956 swiotlb_sync_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, enum dma_sync_target target) swiotlb_sync_sg() argument
969 swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) swiotlb_sync_sg_for_cpu() argument
977 swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) swiotlb_sync_sg_for_device() argument
/linux-4.4.14/include/net/netfilter/
H A Dnf_conntrack_zones.h21 nf_ct_zone_init(struct nf_conntrack_zone *zone, u16 id, u8 dir, u8 flags) nf_ct_zone_init() argument
25 zone->dir = dir; nf_ct_zone_init()
41 zone = nf_ct_zone_init(tmp, skb->mark, zone->dir, 0); nf_ct_zone_tmpl()
56 nf_ct_zone_init(nf_ct_zone, info->id, info->dir, nf_ct_zone_add()
63 enum ip_conntrack_dir dir) nf_ct_zone_matches_dir()
65 return zone->dir & (1 << dir); nf_ct_zone_matches_dir()
69 enum ip_conntrack_dir dir) nf_ct_zone_id()
71 return nf_ct_zone_matches_dir(zone, dir) ? nf_ct_zone_id()
77 enum ip_conntrack_dir dir) nf_ct_zone_equal()
79 return nf_ct_zone_id(nf_ct_zone(a), dir) == nf_ct_zone_equal()
80 nf_ct_zone_id(b, dir); nf_ct_zone_equal()
62 nf_ct_zone_matches_dir(const struct nf_conntrack_zone *zone, enum ip_conntrack_dir dir) nf_ct_zone_matches_dir() argument
68 nf_ct_zone_id(const struct nf_conntrack_zone *zone, enum ip_conntrack_dir dir) nf_ct_zone_id() argument
75 nf_ct_zone_equal(const struct nf_conn *a, const struct nf_conntrack_zone *b, enum ip_conntrack_dir dir) nf_ct_zone_equal() argument
/linux-4.4.14/fs/hpfs/
H A Dnamei.c11 static void hpfs_update_directory_times(struct inode *dir) hpfs_update_directory_times() argument
14 if (t == dir->i_mtime.tv_sec && hpfs_update_directory_times()
15 t == dir->i_ctime.tv_sec) hpfs_update_directory_times()
17 dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t; hpfs_update_directory_times()
18 dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0; hpfs_update_directory_times()
19 hpfs_write_inode_nolock(dir); hpfs_update_directory_times()
22 static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) hpfs_mkdir() argument
38 hpfs_lock(dir->i_sb); hpfs_mkdir()
40 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); hpfs_mkdir()
43 dnode = hpfs_alloc_dnode(dir->i_sb, fno, &dno, &qbh0); hpfs_mkdir()
52 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); hpfs_mkdir()
53 result = new_inode(dir->i_sb); hpfs_mkdir()
58 hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_mkdir()
60 result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); hpfs_mkdir()
74 r = hpfs_add_dirent(dir, name, len, &dee); hpfs_mkdir()
83 fnode->up = cpu_to_le32(dir->i_ino); hpfs_mkdir()
92 de = hpfs_add_de(dir->i_sb, dnode, "\001\001", 2, 0); hpfs_mkdir()
93 de->creation_date = de->write_date = de->read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); hpfs_mkdir()
102 inc_nlink(dir); hpfs_mkdir()
113 hpfs_update_directory_times(dir); hpfs_mkdir()
115 hpfs_unlock(dir->i_sb); hpfs_mkdir()
121 hpfs_free_dnode(dir->i_sb, dno); hpfs_mkdir()
124 hpfs_free_sectors(dir->i_sb, fno, 1); hpfs_mkdir()
126 hpfs_unlock(dir->i_sb); hpfs_mkdir()
130 static int hpfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) hpfs_create() argument
143 hpfs_lock(dir->i_sb); hpfs_create()
145 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); hpfs_create()
153 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); hpfs_create()
155 result = new_inode(dir->i_sb); hpfs_create()
166 hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_create()
167 result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); hpfs_create()
179 r = hpfs_add_dirent(dir, name, len, &dee); hpfs_create()
188 fnode->up = cpu_to_le32(dir->i_ino); hpfs_create()
202 hpfs_update_directory_times(dir); hpfs_create()
204 hpfs_unlock(dir->i_sb); hpfs_create()
211 hpfs_free_sectors(dir->i_sb, fno, 1); hpfs_create()
213 hpfs_unlock(dir->i_sb); hpfs_create()
217 static int hpfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) hpfs_mknod() argument
229 if (hpfs_sb(dir->i_sb)->sb_eas < 2) return -EPERM; hpfs_mknod()
230 hpfs_lock(dir->i_sb); hpfs_mknod()
232 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); hpfs_mknod()
240 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); hpfs_mknod()
242 result = new_inode(dir->i_sb); hpfs_mknod()
248 hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_mknod()
249 result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); hpfs_mknod()
261 r = hpfs_add_dirent(dir, name, len, &dee); hpfs_mknod()
270 fnode->up = cpu_to_le32(dir->i_ino); hpfs_mknod()
276 hpfs_update_directory_times(dir); hpfs_mknod()
279 hpfs_unlock(dir->i_sb); hpfs_mknod()
285 hpfs_free_sectors(dir->i_sb, fno, 1); hpfs_mknod()
287 hpfs_unlock(dir->i_sb); hpfs_mknod()
291 static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *symlink) hpfs_symlink() argument
303 hpfs_lock(dir->i_sb); hpfs_symlink()
304 if (hpfs_sb(dir->i_sb)->sb_eas < 2) { hpfs_symlink()
305 hpfs_unlock(dir->i_sb); hpfs_symlink()
309 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); hpfs_symlink()
316 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); hpfs_symlink()
318 result = new_inode(dir->i_sb); hpfs_symlink()
323 hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_symlink()
324 result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); hpfs_symlink()
338 r = hpfs_add_dirent(dir, name, len, &dee); hpfs_symlink()
347 fnode->up = cpu_to_le32(dir->i_ino); hpfs_symlink()
355 hpfs_update_directory_times(dir); hpfs_symlink()
357 hpfs_unlock(dir->i_sb); hpfs_symlink()
363 hpfs_free_sectors(dir->i_sb, fno, 1); hpfs_symlink()
365 hpfs_unlock(dir->i_sb); hpfs_symlink()
369 static int hpfs_unlink(struct inode *dir, struct dentry *dentry) hpfs_unlink() argument
380 hpfs_lock(dir->i_sb); hpfs_unlink()
384 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); hpfs_unlink()
396 r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); hpfs_unlink()
399 hpfs_error(dir->i_sb, "there was error when removing dirent"); hpfs_unlink()
415 hpfs_update_directory_times(dir); hpfs_unlink()
416 hpfs_unlock(dir->i_sb); hpfs_unlink()
420 static int hpfs_rmdir(struct inode *dir, struct dentry *dentry) hpfs_rmdir() argument
433 hpfs_lock(dir->i_sb); hpfs_rmdir()
435 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); hpfs_rmdir()
447 hpfs_count_dnodes(dir->i_sb, hpfs_i(inode)->i_dno, NULL, NULL, &n_items); hpfs_rmdir()
452 r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); hpfs_rmdir()
455 hpfs_error(dir->i_sb, "there was error when removing dirent"); hpfs_rmdir()
462 drop_nlink(dir); hpfs_rmdir()
471 hpfs_update_directory_times(dir); hpfs_rmdir()
472 hpfs_unlock(dir->i_sb); hpfs_rmdir()
H A DMakefile7 hpfs-objs := alloc.o anode.o buffer.o dentry.o dir.o dnode.o ea.o file.o \
H A Dname.c22 static inline unsigned char upcase(unsigned char *dir, unsigned char a) upcase() argument
25 if (!dir) return a; upcase()
26 return dir[a-128]; upcase()
29 unsigned char hpfs_upcase(unsigned char *dir, unsigned char a) hpfs_upcase() argument
31 return upcase(dir, a); hpfs_upcase()
34 static inline unsigned char locase(unsigned char *dir, unsigned char a) locase() argument
37 if (!dir) return a; locase()
38 return dir[a]; locase()
H A Ddir.c2 * linux/fs/hpfs/dir.c
39 /*pr_info("dir lseek\n");*/ hpfs_dir_lseek()
196 struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) hpfs_lookup() argument
207 hpfs_lock(dir->i_sb); hpfs_lookup()
210 hpfs_unlock(dir->i_sb); hpfs_lookup()
220 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, NULL, &qbh); hpfs_lookup()
238 result = iget_locked(dir->i_sb, ino); hpfs_lookup()
240 hpfs_error(dir->i_sb, "hpfs_lookup: can't get inode"); hpfs_lookup()
247 else if (le32_to_cpu(de->ea_size) && hpfs_sb(dir->i_sb)->sb_eas) hpfs_lookup()
259 if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino; hpfs_lookup()
261 if (de->has_acl || de->has_xtd_perm) if (!(dir->i_sb->s_flags & MS_RDONLY)) { hpfs_lookup()
272 if (!(result->i_ctime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->creation_date)))) hpfs_lookup()
275 result->i_mtime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->write_date)); hpfs_lookup()
277 result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->read_date)); hpfs_lookup()
306 hpfs_unlock(dir->i_sb); hpfs_lookup()
319 hpfs_unlock(dir->i_sb); hpfs_lookup()
/linux-4.4.14/fs/fuse/
H A DMakefile8 fuse-objs := dev.o dir.o file.o inode.o control.o
/linux-4.4.14/fs/minix/
H A DMakefile7 minix-objs := bitmap.o itree_v1.o itree_v2.o namei.o inode.o file.o dir.o
H A Dnamei.c21 static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) minix_lookup() argument
26 if (dentry->d_name.len > minix_sb(dir->i_sb)->s_namelen) minix_lookup()
31 inode = minix_iget(dir->i_sb, ino); minix_lookup()
39 static int minix_mknod(struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev) minix_mknod() argument
47 inode = minix_new_inode(dir, mode, &error); minix_mknod()
57 static int minix_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) minix_tmpfile() argument
60 struct inode *inode = minix_new_inode(dir, mode, &error); minix_tmpfile()
69 static int minix_create(struct inode *dir, struct dentry *dentry, umode_t mode, minix_create() argument
72 return minix_mknod(dir, dentry, mode, 0); minix_create()
75 static int minix_symlink(struct inode * dir, struct dentry *dentry, minix_symlink() argument
82 if (i > dir->i_sb->s_blocksize) minix_symlink()
85 inode = minix_new_inode(dir, S_IFLNK | 0777, &err); minix_symlink()
104 static int minix_link(struct dentry * old_dentry, struct inode * dir, minix_link() argument
115 static int minix_mkdir(struct inode * dir, struct dentry *dentry, umode_t mode) minix_mkdir() argument
120 inode_inc_link_count(dir); minix_mkdir()
122 inode = minix_new_inode(dir, S_IFDIR | mode, &err); minix_mkdir()
130 err = minix_make_empty(inode, dir); minix_mkdir()
147 inode_dec_link_count(dir); minix_mkdir()
151 static int minix_unlink(struct inode * dir, struct dentry *dentry) minix_unlink() argument
166 inode->i_ctime = dir->i_ctime; minix_unlink()
172 static int minix_rmdir(struct inode * dir, struct dentry *dentry) minix_rmdir() argument
178 err = minix_unlink(dir, dentry); minix_rmdir()
180 inode_dec_link_count(dir); minix_rmdir()
H A Ddir.c2 * linux/fs/minix/dir.c
51 struct inode *dir = mapping->host; dir_commit_chunk() local
55 if (pos+len > dir->i_size) { dir_commit_chunk()
56 i_size_write(dir, pos+len); dir_commit_chunk()
57 mark_inode_dirty(dir); dir_commit_chunk()
59 if (IS_DIRSYNC(dir)) dir_commit_chunk()
66 static struct page * dir_get_page(struct inode *dir, unsigned long n) dir_get_page() argument
68 struct address_space *mapping = dir->i_mapping; dir_get_page()
154 struct inode * dir = d_inode(dentry->d_parent); minix_find_entry() local
155 struct super_block * sb = dir->i_sb; minix_find_entry()
158 unsigned long npages = dir_pages(dir); minix_find_entry()
169 page = dir_get_page(dir, n); minix_find_entry()
174 limit = kaddr + minix_last_byte(dir, n) - sbi->s_dirsize; minix_find_entry()
201 struct inode *dir = d_inode(dentry->d_parent); minix_add_link() local
204 struct super_block * sb = dir->i_sb; minix_add_link()
207 unsigned long npages = dir_pages(dir); minix_add_link()
225 page = dir_get_page(dir, n); minix_add_link()
231 dir_end = kaddr + minix_last_byte(dir, n); minix_add_link()
277 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; minix_add_link()
278 mark_inode_dirty(dir); minix_add_link()
314 int minix_make_empty(struct inode *inode, struct inode *dir) minix_make_empty() argument
338 de3->inode = dir->i_ino; minix_make_empty()
346 de->inode = dir->i_ino; minix_make_empty()
414 struct inode *dir = page->mapping->host; minix_set_link() local
415 struct minix_sb_info *sbi = minix_sb(dir->i_sb); minix_set_link()
433 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; minix_set_link()
434 mark_inode_dirty(dir); minix_set_link()
437 struct minix_dir_entry * minix_dotdot (struct inode *dir, struct page **p) minix_dotdot() argument
439 struct page *page = dir_get_page(dir, 0); minix_dotdot()
440 struct minix_sb_info *sbi = minix_sb(dir->i_sb); minix_dotdot()
/linux-4.4.14/fs/configfs/
H A DMakefile7 configfs-objs := inode.o file.o dir.o symlink.o mount.o item.o
/linux-4.4.14/fs/efs/
H A DMakefile7 efs-objs := super.o inode.o namei.o dir.o file.o symlink.o
H A Dnamei.c34 pr_err("%s(): failed to read dir block %d\n", efs_find_entry()
64 struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) efs_lookup() argument
69 inodenum = efs_find_entry(dir, dentry->d_name.name, dentry->d_name.len); efs_lookup()
71 inode = efs_iget(dir->i_sb, inodenum); efs_lookup()
/linux-4.4.14/fs/qnx6/
H A DMakefile7 qnx6-objs := inode.o dir.o namei.o super_mmi.o
H A Dnamei.c15 struct dentry *qnx6_lookup(struct inode *dir, struct dentry *dentry, qnx6_lookup() argument
27 ino = qnx6_find_entry(len, dir, name, &page); qnx6_lookup()
29 foundinode = qnx6_iget(dir->i_sb, ino); qnx6_lookup()
/linux-4.4.14/arch/blackfin/include/asm/
H A Ddma-mapping.h43 __dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir);
45 __dma_sync_inline(dma_addr_t addr, size_t size, enum dma_data_direction dir) __dma_sync_inline() argument
47 switch (dir) { __dma_sync_inline()
61 _dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir) _dma_sync() argument
63 if (__builtin_constant_p(dir)) _dma_sync()
64 __dma_sync_inline(addr, size, dir); _dma_sync()
66 __dma_sync(addr, size, dir); _dma_sync()
71 enum dma_data_direction dir) dma_map_single()
73 _dma_sync((dma_addr_t)ptr, size, dir); dma_map_single()
80 enum dma_data_direction dir) dma_map_page()
82 return dma_map_single(dev, page_address(page) + offset, size, dir); dma_map_page()
87 enum dma_data_direction dir) dma_unmap_single()
89 BUG_ON(!valid_dma_direction(dir)); dma_unmap_single()
94 enum dma_data_direction dir) dma_unmap_page()
96 dma_unmap_single(dev, dma_addr, size, dir); dma_unmap_page()
100 enum dma_data_direction dir);
104 int nhwentries, enum dma_data_direction dir) dma_unmap_sg()
106 BUG_ON(!valid_dma_direction(dir)); dma_unmap_sg()
112 enum dma_data_direction dir) dma_sync_single_range_for_cpu()
114 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_range_for_cpu()
120 enum dma_data_direction dir) dma_sync_single_range_for_device()
122 _dma_sync(handle + offset, size, dir); dma_sync_single_range_for_device()
127 enum dma_data_direction dir) dma_sync_single_for_cpu()
129 dma_sync_single_range_for_cpu(dev, handle, 0, size, dir); dma_sync_single_for_cpu()
134 enum dma_data_direction dir) dma_sync_single_for_device()
136 dma_sync_single_range_for_device(dev, handle, 0, size, dir); dma_sync_single_for_device()
141 enum dma_data_direction dir) dma_sync_sg_for_cpu()
143 BUG_ON(!valid_dma_direction(dir)); dma_sync_sg_for_cpu()
148 int nents, enum dma_data_direction dir);
152 enum dma_data_direction dir) dma_cache_sync()
154 _dma_sync((dma_addr_t)vaddr, size, dir); dma_cache_sync()
70 dma_map_single(struct device *dev, void *ptr, size_t size, enum dma_data_direction dir) dma_map_single() argument
78 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
86 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
93 dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
103 dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, enum dma_data_direction dir) dma_unmap_sg() argument
110 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t handle, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_cpu() argument
118 dma_sync_single_range_for_device(struct device *dev, dma_addr_t handle, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_device() argument
126 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
133 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
140 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) dma_sync_sg_for_cpu() argument
151 dma_cache_sync(struct device *dev, void *vaddr, size_t size, enum dma_data_direction dir) dma_cache_sync() argument
/linux-4.4.14/fs/nfs/
H A Dnfstrace.h171 const struct inode *dir,
176 TP_ARGS(dir, dentry, flags),
181 __field(u64, dir)
186 __entry->dev = dir->i_sb->s_dev;
187 __entry->dir = NFS_FILEID(dir);
197 (unsigned long long)__entry->dir,
205 const struct inode *dir, \
209 TP_ARGS(dir, dentry, flags))
213 const struct inode *dir,
219 TP_ARGS(dir, dentry, flags, error),
225 __field(u64, dir)
230 __entry->dev = dir->i_sb->s_dev;
231 __entry->dir = NFS_FILEID(dir);
243 (unsigned long long)__entry->dir,
251 const struct inode *dir, \
256 TP_ARGS(dir, dentry, flags, error))
281 const struct inode *dir,
286 TP_ARGS(dir, ctx, flags),
292 __field(u64, dir)
297 __entry->dev = dir->i_sb->s_dev;
298 __entry->dir = NFS_FILEID(dir);
310 (unsigned long long)__entry->dir,
317 const struct inode *dir,
323 TP_ARGS(dir, ctx, flags, error),
330 __field(u64, dir)
336 __entry->dev = dir->i_sb->s_dev;
337 __entry->dir = NFS_FILEID(dir);
351 (unsigned long long)__entry->dir,
358 const struct inode *dir,
363 TP_ARGS(dir, dentry, flags),
368 __field(u64, dir)
373 __entry->dev = dir->i_sb->s_dev;
374 __entry->dir = NFS_FILEID(dir);
384 (unsigned long long)__entry->dir,
391 const struct inode *dir,
397 TP_ARGS(dir, dentry, flags, error),
403 __field(u64, dir)
409 __entry->dev = dir->i_sb->s_dev;
410 __entry->dir = NFS_FILEID(dir);
421 (unsigned long long)__entry->dir,
428 const struct inode *dir,
432 TP_ARGS(dir, dentry),
436 __field(u64, dir)
441 __entry->dev = dir->i_sb->s_dev;
442 __entry->dir = NFS_FILEID(dir);
449 (unsigned long long)__entry->dir,
457 const struct inode *dir, \
460 TP_ARGS(dir, dentry))
464 const struct inode *dir,
469 TP_ARGS(dir, dentry, error),
474 __field(u64, dir)
479 __entry->dev = dir->i_sb->s_dev;
480 __entry->dir = NFS_FILEID(dir);
489 (unsigned long long)__entry->dir,
497 const struct inode *dir, \
501 TP_ARGS(dir, dentry, error))
519 const struct inode *dir,
523 TP_ARGS(inode, dir, dentry),
528 __field(u64, dir)
535 __entry->dir = NFS_FILEID(dir);
544 (unsigned long long)__entry->dir,
552 const struct inode *dir,
557 TP_ARGS(inode, dir, dentry, error),
563 __field(u64, dir)
570 __entry->dir = NFS_FILEID(dir);
581 (unsigned long long)__entry->dir,
701 __field(u64, dir)
706 struct inode *dir = data->dir;
708 __entry->dev = dir->i_sb->s_dev;
709 __entry->dir = NFS_FILEID(dir);
720 (unsigned long long)__entry->dir,
H A Dunlink.c33 iput(data->dir); nfs_free_unlinkdata()
65 static void nfs_dec_sillycount(struct inode *dir) nfs_dec_sillycount() argument
67 struct nfs_inode *nfsi = NFS_I(dir); nfs_dec_sillycount()
81 struct inode *dir = data->dir; nfs_async_unlink_done() local
84 if (!NFS_PROTO(dir)->unlink_done(task, dir)) nfs_async_unlink_done()
98 struct super_block *sb = data->dir->i_sb; nfs_async_unlink_release()
100 nfs_dec_sillycount(data->dir); nfs_async_unlink_release()
108 NFS_PROTO(data->dir)->unlink_rpc_prepare(task, data); nfs_unlink_prepare()
117 static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data) nfs_do_call_unlink() argument
155 nfs_dec_sillycount(dir); nfs_do_call_unlink()
165 data->dir = igrab(dir); nfs_do_call_unlink()
166 if (!data->dir) { nfs_do_call_unlink()
167 nfs_dec_sillycount(dir); nfs_do_call_unlink()
170 nfs_sb_active(dir->i_sb); nfs_do_call_unlink()
171 data->args.fh = NFS_FH(dir); nfs_do_call_unlink()
174 NFS_PROTO(dir)->unlink_setup(&msg, dir); nfs_do_call_unlink()
176 task_setup_data.rpc_client = NFS_CLIENT(dir); nfs_do_call_unlink()
186 struct inode *dir; nfs_call_unlink() local
193 dir = d_inode(parent); nfs_call_unlink()
195 spin_lock(&dir->i_lock); nfs_call_unlink()
196 if (atomic_inc_not_zero(&NFS_I(dir)->silly_count) == 0) { nfs_call_unlink()
198 hlist_add_head(&data->list, &NFS_I(dir)->silly_list); nfs_call_unlink()
199 spin_unlock(&dir->i_lock); nfs_call_unlink()
203 spin_unlock(&dir->i_lock); nfs_call_unlink()
204 ret = nfs_do_call_unlink(parent, dir, data); nfs_call_unlink()
227 struct inode *dir = d_inode(dentry); nfs_unblock_sillyrename() local
228 struct nfs_inode *nfsi = NFS_I(dir); nfs_unblock_sillyrename()
232 spin_lock(&dir->i_lock); nfs_unblock_sillyrename()
238 spin_unlock(&dir->i_lock); nfs_unblock_sillyrename()
239 if (nfs_do_call_unlink(dentry, dir, data) == 0) nfs_unblock_sillyrename()
241 spin_lock(&dir->i_lock); nfs_unblock_sillyrename()
243 spin_unlock(&dir->i_lock); nfs_unblock_sillyrename()
248 * @dir: parent directory of dentry
252 nfs_async_unlink(struct inode *dir, struct dentry *dentry) nfs_async_unlink() argument
493 * @dir: inode of directory that contains dentry
513 nfs_sillyrename(struct inode *dir, struct dentry *dentry) nfs_sillyrename() argument
524 nfs_inc_stats(dir, NFSIOS_SILLYRENAME); nfs_sillyrename()
562 error = nfs_async_unlink(dir, dentry); nfs_sillyrename()
575 task = nfs_async_rename(dir, dir, dentry, sdentry, nfs_sillyrename()
590 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_sillyrename()
H A Ddir.c2 * linux/fs/nfs/dir.c
70 static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir, struct rpc_cred *cred) alloc_nfs_open_dir_context() argument
72 struct nfs_inode *nfsi = NFS_I(dir); alloc_nfs_open_dir_context()
81 spin_lock(&dir->i_lock); alloc_nfs_open_dir_context()
83 spin_unlock(&dir->i_lock); alloc_nfs_open_dir_context()
89 static void put_nfs_open_dir_context(struct inode *dir, struct nfs_open_dir_context *ctx) put_nfs_open_dir_context() argument
91 spin_lock(&dir->i_lock); put_nfs_open_dir_context()
93 spin_unlock(&dir->i_lock); put_nfs_open_dir_context()
108 dfprintk(FILE, "NFS: open dir(%pD2)\n", filp); nfs_opendir()
431 bool nfs_use_readdirplus(struct inode *dir, struct dir_context *ctx) nfs_use_readdirplus() argument
433 if (!nfs_server_capable(dir, NFS_CAP_READDIRPLUS)) nfs_use_readdirplus()
435 if (test_and_clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(dir)->flags)) nfs_use_readdirplus()
448 void nfs_advise_use_readdirplus(struct inode *dir) nfs_advise_use_readdirplus() argument
450 set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(dir)->flags); nfs_advise_use_readdirplus()
461 void nfs_force_use_readdirplus(struct inode *dir) nfs_force_use_readdirplus() argument
463 if (!list_empty(&NFS_I(dir)->open_files)) { nfs_force_use_readdirplus()
464 nfs_advise_use_readdirplus(dir); nfs_force_use_readdirplus()
465 nfs_zap_mapping(dir, dir->i_mapping); nfs_force_use_readdirplus()
475 struct inode *dir = d_inode(parent); nfs_prime_dcache() local
498 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_prime_dcache()
521 nfs_set_verifier(alias, nfs_save_change_attribute(dir)); nfs_prime_dcache()
524 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_prime_dcache()
850 static bool nfs_dir_mapping_need_revalidate(struct inode *dir) nfs_dir_mapping_need_revalidate() argument
852 struct nfs_inode *nfsi = NFS_I(dir); nfs_dir_mapping_need_revalidate()
854 if (nfs_attribute_cache_expired(dir)) nfs_dir_mapping_need_revalidate()
940 dfprintk(FILE, "NFS: llseek dir(%pD2, %lld, %d)\n", nfs_llseek_dir()
973 dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync); nfs_fsync_dir()
983 * @dir - pointer to directory inode
986 * full lookup on all child dentries of 'dir' whenever a change occurs
989 * The caller should be holding dir->i_lock
991 void nfs_force_lookup_revalidate(struct inode *dir) nfs_force_lookup_revalidate() argument
993 NFS_I(dir)->cache_change_attribute++; nfs_force_lookup_revalidate()
1003 static int nfs_check_verifier(struct inode *dir, struct dentry *dentry, nfs_check_verifier() argument
1010 if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONE) nfs_check_verifier()
1012 if (!nfs_verify_change_attribute(dir, dentry->d_time)) nfs_check_verifier()
1016 ret = nfs_revalidate_inode_rcu(NFS_SERVER(dir), dir); nfs_check_verifier()
1018 ret = nfs_revalidate_inode(NFS_SERVER(dir), dir); nfs_check_verifier()
1021 if (!nfs_verify_change_attribute(dir, dentry->d_time)) nfs_check_verifier()
1030 static int nfs_is_exclusive_create(struct inode *dir, unsigned int flags) nfs_is_exclusive_create() argument
1032 if (NFS_PROTO(dir)->version == 2) nfs_is_exclusive_create()
1082 int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry, nfs_neg_need_reval() argument
1088 if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) nfs_neg_need_reval()
1090 return !nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU); nfs_neg_need_reval()
1106 struct inode *dir; nfs_lookup_revalidate() local
1116 dir = d_inode_rcu(parent); nfs_lookup_revalidate()
1117 if (!dir) nfs_lookup_revalidate()
1121 dir = d_inode(parent); nfs_lookup_revalidate()
1123 nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); nfs_lookup_revalidate()
1127 if (nfs_neg_need_reval(dir, dentry, flags)) { nfs_lookup_revalidate()
1143 if (NFS_PROTO(dir)->have_delegation(inode, FMODE_READ)) nfs_lookup_revalidate()
1147 if (!nfs_is_exclusive_create(dir, flags) && nfs_lookup_revalidate()
1148 nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU)) { nfs_lookup_revalidate()
1174 trace_nfs_lookup_revalidate_enter(dir, dentry, flags); nfs_lookup_revalidate()
1175 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label); nfs_lookup_revalidate()
1176 trace_nfs_lookup_revalidate_exit(dir, dentry, flags, error); nfs_lookup_revalidate()
1191 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_lookup_revalidate()
1194 nfs_advise_use_readdirplus(dir); nfs_lookup_revalidate()
1205 nfs_zap_caches(dir); nfs_lookup_revalidate()
1211 nfs_mark_for_revalidate(dir); nfs_lookup_revalidate()
1243 * parent dir (e.g.: ".", "..", procfs symlinks or mountpoint traversals).
1350 struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned int flags) nfs_lookup() argument
1361 nfs_inc_stats(dir, NFSIOS_VFSLOOKUP); nfs_lookup()
1364 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) nfs_lookup()
1371 if (nfs_is_exclusive_create(dir, flags)) { nfs_lookup()
1383 label = nfs4_label_alloc(NFS_SERVER(dir), GFP_NOWAIT); nfs_lookup()
1389 trace_nfs_lookup_enter(dir, dentry, flags); nfs_lookup()
1391 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label); nfs_lookup()
1404 nfs_advise_use_readdirplus(dir); nfs_lookup()
1413 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_lookup()
1416 trace_nfs_lookup_exit(dir, dentry, flags, error); nfs_lookup()
1474 int nfs_atomic_open(struct inode *dir, struct dentry *dentry, nfs_atomic_open() argument
1489 dir->i_sb->s_id, dir->i_ino, dentry); nfs_atomic_open()
1509 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) nfs_atomic_open()
1526 trace_nfs_atomic_open_enter(dir, ctx, open_flags); nfs_atomic_open()
1528 inode = NFS_PROTO(dir)->open_context(dir, ctx, open_flags, &attr, opened); nfs_atomic_open()
1532 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); nfs_atomic_open()
1538 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_atomic_open()
1555 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); nfs_atomic_open()
1561 res = nfs_lookup(dir, dentry, lookup_flags); nfs_atomic_open()
1589 struct inode *dir; nfs4_lookup_revalidate() local
1593 dir = d_inode_rcu(parent); nfs4_lookup_revalidate()
1594 if (!dir) nfs4_lookup_revalidate()
1598 dir = d_inode(parent); nfs4_lookup_revalidate()
1600 if (!nfs_neg_need_reval(dir, dentry, flags)) nfs4_lookup_revalidate()
1638 struct inode *dir = d_inode(parent); nfs_instantiate() local
1648 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, NULL); nfs_instantiate()
1652 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_instantiate()
1668 nfs_mark_for_revalidate(dir); nfs_instantiate()
1680 int nfs_create(struct inode *dir, struct dentry *dentry, nfs_create() argument
1688 dir->i_sb->s_id, dir->i_ino, dentry); nfs_create()
1693 trace_nfs_create_enter(dir, dentry, open_flags); nfs_create()
1694 error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags); nfs_create()
1695 trace_nfs_create_exit(dir, dentry, open_flags, error); nfs_create()
1709 nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) nfs_mknod() argument
1715 dir->i_sb->s_id, dir->i_ino, dentry); nfs_mknod()
1720 trace_nfs_mknod_enter(dir, dentry); nfs_mknod()
1721 status = NFS_PROTO(dir)->mknod(dir, dentry, &attr, rdev); nfs_mknod()
1722 trace_nfs_mknod_exit(dir, dentry, status); nfs_mknod()
1735 int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) nfs_mkdir() argument
1741 dir->i_sb->s_id, dir->i_ino, dentry); nfs_mkdir()
1746 trace_nfs_mkdir_enter(dir, dentry); nfs_mkdir()
1747 error = NFS_PROTO(dir)->mkdir(dir, dentry, &attr); nfs_mkdir()
1748 trace_nfs_mkdir_exit(dir, dentry, error); nfs_mkdir()
1764 int nfs_rmdir(struct inode *dir, struct dentry *dentry) nfs_rmdir() argument
1769 dir->i_sb->s_id, dir->i_ino, dentry); nfs_rmdir()
1771 trace_nfs_rmdir_enter(dir, dentry); nfs_rmdir()
1774 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); nfs_rmdir()
1784 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); nfs_rmdir()
1785 trace_nfs_rmdir_exit(dir, dentry, error); nfs_rmdir()
1800 struct inode *dir = d_inode(dentry->d_parent); nfs_safe_remove() local
1812 trace_nfs_remove_enter(dir, dentry); nfs_safe_remove()
1815 error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); nfs_safe_remove()
1819 error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); nfs_safe_remove()
1822 trace_nfs_remove_exit(dir, dentry, error); nfs_safe_remove()
1832 int nfs_unlink(struct inode *dir, struct dentry *dentry) nfs_unlink() argument
1837 dfprintk(VFS, "NFS: unlink(%s/%lu, %pd)\n", dir->i_sb->s_id, nfs_unlink()
1838 dir->i_ino, dentry); nfs_unlink()
1840 trace_nfs_unlink_enter(dir, dentry); nfs_unlink()
1846 error = nfs_sillyrename(dir, dentry); nfs_unlink()
1856 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_unlink()
1860 trace_nfs_unlink_exit(dir, dentry, error); nfs_unlink()
1880 int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) nfs_symlink() argument
1888 dfprintk(VFS, "NFS: symlink(%s/%lu, %pd, %s)\n", dir->i_sb->s_id, nfs_symlink()
1889 dir->i_ino, dentry, symname); nfs_symlink()
1907 trace_nfs_symlink_enter(dir, dentry); nfs_symlink()
1908 error = NFS_PROTO(dir)->symlink(dir, dentry, page, pathlen, &attr); nfs_symlink()
1909 trace_nfs_symlink_exit(dir, dentry, error); nfs_symlink()
1912 dir->i_sb->s_id, dir->i_ino, nfs_symlink()
1940 nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) nfs_link() argument
1948 trace_nfs_link_enter(inode, dir, dentry); nfs_link()
1952 error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name); nfs_link()
1957 trace_nfs_link_exit(inode, dir, dentry, error); nfs_link()
H A Dnfs3proc.c147 nfs3_proc_lookup(struct inode *dir, struct qstr *name, nfs3_proc_lookup() argument
152 .fh = NFS_FH(dir), nfs3_proc_lookup()
173 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_lookup()
174 nfs_refresh_inode(dir, res.dir_attr); nfs3_proc_lookup()
179 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_lookup()
299 static int nfs3_do_create(struct inode *dir, struct dentry *dentry, struct nfs3_createdata *data) nfs3_do_create() argument
303 status = rpc_call_sync(NFS_CLIENT(dir), &data->msg, 0); nfs3_do_create()
304 nfs_post_op_update_inode(dir, data->res.dir_attr); nfs3_do_create()
319 nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, nfs3_proc_create() argument
333 data->arg.create.fh = NFS_FH(dir); nfs3_proc_create()
345 status = posix_acl_create(dir, &sattr->ia_mode, &default_acl, &acl); nfs3_proc_create()
350 status = nfs3_do_create(dir, dentry, data); nfs3_proc_create()
407 nfs3_proc_remove(struct inode *dir, struct qstr *name) nfs3_proc_remove() argument
410 .fh = NFS_FH(dir), nfs3_proc_remove()
426 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_remove()
427 nfs_post_op_update_inode(dir, res.dir_attr); nfs3_proc_remove()
435 nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) nfs3_proc_unlink_setup() argument
446 nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir) nfs3_proc_unlink_done() argument
449 if (nfs3_async_handle_jukebox(task, dir)) nfs3_proc_unlink_done()
452 nfs_post_op_update_inode(dir, res->dir_attr); nfs3_proc_unlink_done()
457 nfs3_proc_rename_setup(struct rpc_message *msg, struct inode *dir) nfs3_proc_rename_setup() argument
483 nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) nfs3_proc_link() argument
487 .tofh = NFS_FH(dir), nfs3_proc_link()
506 nfs_post_op_update_inode(dir, res.dir_attr); nfs3_proc_link()
516 nfs3_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, nfs3_proc_symlink() argument
531 data->arg.symlink.fromfh = NFS_FH(dir); nfs3_proc_symlink()
538 status = nfs3_do_create(dir, dentry, data); nfs3_proc_symlink()
547 nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) nfs3_proc_mkdir() argument
559 status = posix_acl_create(dir, &sattr->ia_mode, &default_acl, &acl); nfs3_proc_mkdir()
564 data->arg.mkdir.fh = NFS_FH(dir); nfs3_proc_mkdir()
569 status = nfs3_do_create(dir, dentry, data); nfs3_proc_mkdir()
585 nfs3_proc_rmdir(struct inode *dir, struct qstr *name) nfs3_proc_rmdir() argument
589 .fh = NFS_FH(dir), nfs3_proc_rmdir()
605 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_rmdir()
606 nfs_post_op_update_inode(dir, dir_attr); nfs3_proc_rmdir()
626 struct inode *dir = d_inode(dentry); nfs3_proc_readdir() local
627 __be32 *verf = NFS_I(dir)->cookieverf; nfs3_proc_readdir()
629 .fh = NFS_FH(dir), nfs3_proc_readdir()
658 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs3_proc_readdir()
660 nfs_invalidate_atime(dir); nfs3_proc_readdir()
661 nfs_refresh_inode(dir, res.dir_attr); nfs3_proc_readdir()
671 nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, nfs3_proc_mknod() argument
685 status = posix_acl_create(dir, &sattr->ia_mode, &default_acl, &acl); nfs3_proc_mknod()
690 data->arg.mknod.fh = NFS_FH(dir); nfs3_proc_mknod()
714 status = nfs3_do_create(dir, dentry, data); nfs3_proc_mknod()
H A Dproc.c148 nfs_proc_lookup(struct inode *dir, struct qstr *name, nfs_proc_lookup() argument
153 .fh = NFS_FH(dir), nfs_proc_lookup()
170 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_lookup()
203 static struct nfs_createdata *nfs_alloc_createdata(struct inode *dir, nfs_alloc_createdata() argument
211 data->arg.fh = NFS_FH(dir); nfs_alloc_createdata()
229 nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, nfs_proc_create() argument
239 data = nfs_alloc_createdata(dir, dentry, sattr); nfs_proc_create()
244 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_create()
245 nfs_mark_for_revalidate(dir); nfs_proc_create()
258 nfs_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, nfs_proc_mknod() argument
279 data = nfs_alloc_createdata(dir, dentry, sattr); nfs_proc_mknod()
285 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_mknod()
286 nfs_mark_for_revalidate(dir); nfs_proc_mknod()
291 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_mknod()
302 nfs_proc_remove(struct inode *dir, struct qstr *name) nfs_proc_remove() argument
305 .fh = NFS_FH(dir), nfs_proc_remove()
315 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_remove()
316 nfs_mark_for_revalidate(dir); nfs_proc_remove()
323 nfs_proc_unlink_setup(struct rpc_message *msg, struct inode *dir) nfs_proc_unlink_setup() argument
333 static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir) nfs_proc_unlink_done() argument
335 nfs_mark_for_revalidate(dir); nfs_proc_unlink_done()
340 nfs_proc_rename_setup(struct rpc_message *msg, struct inode *dir) nfs_proc_rename_setup() argument
360 nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) nfs_proc_link() argument
364 .tofh = NFS_FH(dir), nfs_proc_link()
377 nfs_mark_for_revalidate(dir); nfs_proc_link()
383 nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, nfs_proc_symlink() argument
389 .fromfh = NFS_FH(dir), nfs_proc_symlink()
413 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_symlink()
414 nfs_mark_for_revalidate(dir); nfs_proc_symlink()
433 nfs_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) nfs_proc_mkdir() argument
442 data = nfs_alloc_createdata(dir, dentry, sattr); nfs_proc_mkdir()
448 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_mkdir()
449 nfs_mark_for_revalidate(dir); nfs_proc_mkdir()
459 nfs_proc_rmdir(struct inode *dir, struct qstr *name) nfs_proc_rmdir() argument
462 .fh = NFS_FH(dir), nfs_proc_rmdir()
473 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_rmdir()
474 nfs_mark_for_revalidate(dir); nfs_proc_rmdir()
490 struct inode *dir = d_inode(dentry); nfs_proc_readdir() local
492 .fh = NFS_FH(dir), nfs_proc_readdir()
505 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); nfs_proc_readdir()
507 nfs_invalidate_atime(dir); nfs_proc_readdir()
/linux-4.4.14/mm/
H A Dfailslab.c37 struct dentry *dir; failslab_debugfs_init() local
40 dir = fault_create_debugfs_attr("failslab", NULL, &failslab.attr); failslab_debugfs_init()
41 if (IS_ERR(dir)) failslab_debugfs_init()
42 return PTR_ERR(dir); failslab_debugfs_init()
44 if (!debugfs_create_bool("ignore-gfp-wait", mode, dir, failslab_debugfs_init()
47 if (!debugfs_create_bool("cache-filter", mode, dir, failslab_debugfs_init()
53 debugfs_remove_recursive(dir); failslab_debugfs_init()
/linux-4.4.14/arch/arc/include/asm/
H A Ddma-mapping.h46 enum dma_data_direction dir) __inline_dma_cache_sync()
48 switch (dir) { __inline_dma_cache_sync()
59 pr_err("Invalid DMA dir [%d] for OP @ %lx\n", dir, paddr); __inline_dma_cache_sync()
64 enum dma_data_direction dir);
66 #define _dma_cache_sync(addr, sz, dir) \
68 if (__builtin_constant_p(dir)) \
69 __inline_dma_cache_sync(addr, sz, dir); \
71 __arc_dma_cache_sync(addr, sz, dir); \
77 enum dma_data_direction dir) dma_map_single()
79 _dma_cache_sync((unsigned long)cpu_addr, size, dir); dma_map_single()
85 size_t size, enum dma_data_direction dir) dma_unmap_single()
92 enum dma_data_direction dir) dma_map_page()
95 return dma_map_single(dev, (void *)paddr, size, dir); dma_map_page()
100 size_t size, enum dma_data_direction dir) dma_unmap_page()
106 int nents, enum dma_data_direction dir) dma_map_sg()
113 s->length, dir); dma_map_sg()
120 int nents, enum dma_data_direction dir) dma_unmap_sg()
126 dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir); dma_unmap_sg()
131 size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu()
138 size_t size, enum dma_data_direction dir) dma_sync_single_for_device()
161 enum dma_data_direction dir) dma_sync_sg_for_cpu()
167 _dma_cache_sync((unsigned int)sg_virt(sg), sg->length, dir); dma_sync_sg_for_cpu()
172 int nelems, enum dma_data_direction dir) dma_sync_sg_for_device()
178 _dma_cache_sync((unsigned int)sg_virt(sg), sg->length, dir); dma_sync_sg_for_device()
45 __inline_dma_cache_sync(unsigned long paddr, size_t size, enum dma_data_direction dir) __inline_dma_cache_sync() argument
76 dma_map_single(struct device *dev, void *cpu_addr, size_t size, enum dma_data_direction dir) dma_map_single() argument
84 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
90 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
99 dma_unmap_page(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
105 dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) dma_map_sg() argument
119 dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) dma_unmap_sg() argument
130 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
137 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
160 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, int nelems, enum dma_data_direction dir) dma_sync_sg_for_cpu() argument
171 dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, int nelems, enum dma_data_direction dir) dma_sync_sg_for_device() argument
/linux-4.4.14/arch/arm/mach-ux500/
H A Dboard-mop500-audio.c19 .dir = DMA_DEV_TO_MEM,
25 .dir = DMA_MEM_TO_DEV,
37 .dir = DMA_DEV_TO_MEM,
43 .dir = DMA_MEM_TO_DEV,
55 .dir = DMA_DEV_TO_MEM,
61 .dir = DMA_MEM_TO_DEV,
/linux-4.4.14/include/asm-generic/
H A Ddma-mapping-common.h13 enum dma_data_direction dir, dma_map_single_attrs()
20 BUG_ON(!valid_dma_direction(dir)); dma_map_single_attrs()
23 dir, attrs); dma_map_single_attrs()
26 dir, addr, true); dma_map_single_attrs()
32 enum dma_data_direction dir, dma_unmap_single_attrs()
37 BUG_ON(!valid_dma_direction(dir)); dma_unmap_single_attrs()
39 ops->unmap_page(dev, addr, size, dir, attrs); dma_unmap_single_attrs()
40 debug_dma_unmap_page(dev, addr, size, dir, true); dma_unmap_single_attrs()
48 int nents, enum dma_data_direction dir, dma_map_sg_attrs()
57 BUG_ON(!valid_dma_direction(dir)); dma_map_sg_attrs()
58 ents = ops->map_sg(dev, sg, nents, dir, attrs); dma_map_sg_attrs()
60 debug_dma_map_sg(dev, sg, nents, ents, dir); dma_map_sg_attrs()
66 int nents, enum dma_data_direction dir,
71 BUG_ON(!valid_dma_direction(dir));
72 debug_dma_unmap_sg(dev, sg, nents, dir);
74 ops->unmap_sg(dev, sg, nents, dir, attrs);
79 enum dma_data_direction dir) dma_map_page()
85 BUG_ON(!valid_dma_direction(dir)); dma_map_page()
86 addr = ops->map_page(dev, page, offset, size, dir, NULL); dma_map_page()
87 debug_dma_map_page(dev, page, offset, size, dir, addr, false); dma_map_page()
93 size_t size, enum dma_data_direction dir) dma_unmap_page()
97 BUG_ON(!valid_dma_direction(dir)); dma_unmap_page()
99 ops->unmap_page(dev, addr, size, dir, NULL); dma_unmap_page()
100 debug_dma_unmap_page(dev, addr, size, dir, false); dma_unmap_page()
105 enum dma_data_direction dir) dma_sync_single_for_cpu()
109 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_for_cpu()
111 ops->sync_single_for_cpu(dev, addr, size, dir); dma_sync_single_for_cpu()
112 debug_dma_sync_single_for_cpu(dev, addr, size, dir); dma_sync_single_for_cpu()
117 enum dma_data_direction dir) dma_sync_single_for_device()
121 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_for_device()
123 ops->sync_single_for_device(dev, addr, size, dir); dma_sync_single_for_device()
124 debug_dma_sync_single_for_device(dev, addr, size, dir); dma_sync_single_for_device()
131 enum dma_data_direction dir) dma_sync_single_range_for_cpu()
135 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_range_for_cpu()
137 ops->sync_single_for_cpu(dev, addr + offset, size, dir); dma_sync_single_range_for_cpu()
138 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); dma_sync_single_range_for_cpu()
145 enum dma_data_direction dir) dma_sync_single_range_for_device()
149 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_range_for_device()
151 ops->sync_single_for_device(dev, addr + offset, size, dir); dma_sync_single_range_for_device()
152 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); dma_sync_single_range_for_device()
157 int nelems, enum dma_data_direction dir) dma_sync_sg_for_cpu()
161 BUG_ON(!valid_dma_direction(dir)); dma_sync_sg_for_cpu()
163 ops->sync_sg_for_cpu(dev, sg, nelems, dir); dma_sync_sg_for_cpu()
164 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); dma_sync_sg_for_cpu()
169 int nelems, enum dma_data_direction dir) dma_sync_sg_for_device()
173 BUG_ON(!valid_dma_direction(dir)); dma_sync_sg_for_device()
175 ops->sync_sg_for_device(dev, sg, nelems, dir); dma_sync_sg_for_device()
176 debug_dma_sync_sg_for_device(dev, sg, nelems, dir); dma_sync_sg_for_device()
11 dma_map_single_attrs(struct device *dev, void *ptr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) dma_map_single_attrs() argument
30 dma_unmap_single_attrs(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) dma_unmap_single_attrs() argument
47 dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) dma_map_sg_attrs() argument
77 dma_map_page(struct device *dev, struct page *page, size_t offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
92 dma_unmap_page(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
103 dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
115 dma_sync_single_for_device(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
127 dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t addr, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_cpu() argument
141 dma_sync_single_range_for_device(struct device *dev, dma_addr_t addr, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_device() argument
156 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) dma_sync_sg_for_cpu() argument
168 dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) dma_sync_sg_for_device() argument
/linux-4.4.14/drivers/oprofile/
H A Doprofile_stats.c45 struct dentry *dir; oprofile_create_stats_files() local
49 dir = oprofilefs_mkdir(root, "stats"); oprofile_create_stats_files()
50 if (!dir) oprofile_create_stats_files()
56 cpudir = oprofilefs_mkdir(dir, buf); for_each_possible_cpu()
72 oprofilefs_create_ro_atomic(dir, "sample_lost_no_mm",
74 oprofilefs_create_ro_atomic(dir, "sample_lost_no_mapping",
76 oprofilefs_create_ro_atomic(dir, "event_lost_overflow",
78 oprofilefs_create_ro_atomic(dir, "bt_lost_no_mapping",
81 oprofilefs_create_ro_atomic(dir, "multiplex_counter",
H A Doprofile_stats.h30 /* create the stats/ dir */
/linux-4.4.14/fs/fat/
H A DMakefile9 fat-y := cache.o dir.o fatent.o file.o inode.o misc.o nfs.o
H A Ddir.c2 * linux/fs/fat/dir.c
47 static inline void fat_dir_readahead(struct inode *dir, sector_t iblock, fat_dir_readahead() argument
50 struct super_block *sb = dir->i_sb; fat_dir_readahead()
58 /* root dir of FAT12/FAT16 */ fat_dir_readahead()
59 if ((sbi->fat_bits != 32) && (dir->i_ino == MSDOS_ROOT_INO)) fat_dir_readahead()
80 static int fat__get_entry(struct inode *dir, loff_t *pos, fat__get_entry() argument
83 struct super_block *sb = dir->i_sb; fat__get_entry()
94 err = fat_bmap(dir, iblock, &phys, &mapped_blocks, 0); fat__get_entry()
98 fat_dir_readahead(dir, iblock, phys); fat__get_entry()
116 static inline int fat_get_entry(struct inode *dir, loff_t *pos, fat_get_entry() argument
123 MSDOS_SB(dir->i_sb)->dir_per_block - 1) { fat_get_entry()
128 return fat__get_entry(dir, pos, bh, de); fat_get_entry()
279 static int fat_parse_long(struct inode *dir, loff_t *pos, fat_parse_long() argument
317 if (fat_get_entry(dir, pos, bh, de) < 0) fat_parse_long()
545 /* for dir ioctl */
872 static int fat_get_short_entry(struct inode *dir, loff_t *pos, fat_get_short_entry() argument
876 while (fat_get_entry(dir, pos, bh, de) >= 0) { fat_get_short_entry()
893 int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh, fat_get_dotdot_entry() argument
899 while (fat_get_short_entry(dir, &offset, bh, de) >= 0) { fat_get_dotdot_entry()
908 int fat_dir_empty(struct inode *dir) fat_dir_empty() argument
917 while (fat_get_short_entry(dir, &cpos, &bh, &de) >= 0) { fat_dir_empty()
930 * fat_subdirs counts the number of sub-directories of dir. It can be run
933 int fat_subdirs(struct inode *dir) fat_subdirs() argument
942 while (fat_get_short_entry(dir, &cpos, &bh, &de) >= 0) { fat_subdirs()
954 int fat_scan(struct inode *dir, const unsigned char *name, fat_scan() argument
957 struct super_block *sb = dir->i_sb; fat_scan()
961 while (fat_get_short_entry(dir, &sinfo->slot_off, &sinfo->bh, fat_scan()
978 int fat_scan_logstart(struct inode *dir, int i_logstart, fat_scan_logstart() argument
981 struct super_block *sb = dir->i_sb; fat_scan_logstart()
985 while (fat_get_short_entry(dir, &sinfo->slot_off, &sinfo->bh, fat_scan_logstart()
997 static int __fat_remove_entries(struct inode *dir, loff_t pos, int nr_slots) __fat_remove_entries() argument
999 struct super_block *sb = dir->i_sb; __fat_remove_entries()
1006 if (fat_get_entry(dir, &pos, &bh, &de) < 0) { __fat_remove_entries()
1018 mark_buffer_dirty_inode(bh, dir); __fat_remove_entries()
1019 if (IS_DIRSYNC(dir)) __fat_remove_entries()
1032 int fat_remove_entries(struct inode *dir, struct fat_slot_info *sinfo) fat_remove_entries() argument
1034 struct super_block *sb = dir->i_sb; fat_remove_entries()
1053 mark_buffer_dirty_inode(bh, dir); fat_remove_entries()
1054 if (IS_DIRSYNC(dir)) fat_remove_entries()
1059 dir->i_version++; fat_remove_entries()
1067 err = __fat_remove_entries(dir, sinfo->slot_off, nr_slots); fat_remove_entries()
1074 dir->i_mtime = dir->i_atime = CURRENT_TIME_SEC; fat_remove_entries()
1075 if (IS_DIRSYNC(dir)) fat_remove_entries()
1076 (void)fat_sync_inode(dir); fat_remove_entries()
1078 mark_inode_dirty(dir); fat_remove_entries()
1084 static int fat_zeroed_cluster(struct inode *dir, sector_t blknr, int nr_used, fat_zeroed_cluster() argument
1087 struct super_block *sb = dir->i_sb; fat_zeroed_cluster()
1102 mark_buffer_dirty_inode(bhs[n], dir); fat_zeroed_cluster()
1107 if (IS_DIRSYNC(dir)) { fat_zeroed_cluster()
1117 if (IS_DIRSYNC(dir)) { fat_zeroed_cluster()
1133 int fat_alloc_new_dir(struct inode *dir, struct timespec *ts) fat_alloc_new_dir() argument
1135 struct super_block *sb = dir->i_sb; fat_alloc_new_dir()
1144 err = fat_alloc_clusters(dir, &cluster, 1); fat_alloc_new_dir()
1176 fat_set_start(&de[1], MSDOS_I(dir)->i_logstart); fat_alloc_new_dir()
1180 mark_buffer_dirty_inode(bhs[0], dir); fat_alloc_new_dir()
1182 err = fat_zeroed_cluster(dir, blknr, 1, bhs, MAX_BUF_PER_PAGE); fat_alloc_new_dir()
1189 fat_free_clusters(dir, cluster); fat_alloc_new_dir()
1195 static int fat_add_new_entries(struct inode *dir, void *slots, int nr_slots, fat_add_new_entries() argument
1199 struct super_block *sb = dir->i_sb; fat_add_new_entries()
1215 err = fat_alloc_clusters(dir, cluster, *nr_cluster); fat_add_new_entries()
1241 mark_buffer_dirty_inode(bhs[n], dir); fat_add_new_entries()
1257 err = fat_zeroed_cluster(dir, start_blknr, ++n, bhs, MAX_BUF_PER_PAGE); fat_add_new_entries()
1270 fat_free_clusters(dir, cluster[0]); fat_add_new_entries()
1275 int fat_add_entries(struct inode *dir, void *slots, int nr_slots, fat_add_entries() argument
1278 struct super_block *sb = dir->i_sb; fat_add_entries()
1292 while (fat_get_entry(dir, &pos, &bh, &de) > -1) { fat_add_entries()
1313 if (dir->i_ino == MSDOS_ROOT_INO) { fat_add_entries()
1316 } else if (MSDOS_I(dir)->i_start == 0) { fat_add_entries()
1318 MSDOS_I(dir)->i_pos); fat_add_entries()
1341 mark_buffer_dirty_inode(bhs[i], dir); fat_add_entries()
1346 if (long_bhs && IS_DIRSYNC(dir)) fat_add_entries()
1352 mark_buffer_dirty_inode(bhs[i], dir); fat_add_entries()
1353 if (IS_DIRSYNC(dir)) fat_add_entries()
1368 * add the cluster to dir. fat_add_entries()
1370 cluster = fat_add_new_entries(dir, slots, nr_slots, &nr_cluster, fat_add_entries()
1376 err = fat_chain_add(dir, cluster, nr_cluster); fat_add_entries()
1378 fat_free_clusters(dir, cluster); fat_add_entries()
1381 if (dir->i_size & (sbi->cluster_size - 1)) { fat_add_entries()
1383 dir->i_size = (dir->i_size + sbi->cluster_size - 1) fat_add_entries()
1386 dir->i_size += nr_cluster << sbi->cluster_bits; fat_add_entries()
1387 MSDOS_I(dir)->mmu_private += nr_cluster << sbi->cluster_bits; fat_add_entries()
1405 __fat_remove_entries(dir, pos, free_slots); fat_add_entries()
H A Dnamei_msdos.c117 static int msdos_find(struct inode *dir, const unsigned char *name, int len, msdos_find() argument
120 struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); msdos_find()
128 err = fat_scan(dir, msdos_name, sinfo); msdos_find()
199 static struct dentry *msdos_lookup(struct inode *dir, struct dentry *dentry, msdos_lookup() argument
202 struct super_block *sb = dir->i_sb; msdos_lookup()
208 err = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo); msdos_lookup()
225 static int msdos_add_entry(struct inode *dir, const unsigned char *name, msdos_add_entry() argument
229 struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); msdos_add_entry()
248 err = fat_add_entries(dir, &de, 1, sinfo); msdos_add_entry()
252 dir->i_ctime = dir->i_mtime = *ts; msdos_add_entry()
253 if (IS_DIRSYNC(dir)) msdos_add_entry()
254 (void)fat_sync_inode(dir); msdos_add_entry()
256 mark_inode_dirty(dir); msdos_add_entry()
262 static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode, msdos_create() argument
265 struct super_block *sb = dir->i_sb; msdos_create()
280 if (!fat_scan(dir, msdos_name, &sinfo)) { msdos_create()
287 err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &ts, &sinfo); msdos_create()
303 err = fat_flush_inodes(sb, dir, inode); msdos_create()
308 static int msdos_rmdir(struct inode *dir, struct dentry *dentry) msdos_rmdir() argument
310 struct super_block *sb = dir->i_sb; msdos_rmdir()
323 err = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo); msdos_rmdir()
327 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ msdos_rmdir()
330 drop_nlink(dir); msdos_rmdir()
338 err = fat_flush_inodes(sb, dir, inode); msdos_rmdir()
344 static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) msdos_mkdir() argument
346 struct super_block *sb = dir->i_sb; msdos_mkdir()
361 if (!fat_scan(dir, msdos_name, &sinfo)) { msdos_mkdir()
368 cluster = fat_alloc_new_dir(dir, &ts); msdos_mkdir()
373 err = msdos_add_entry(dir, msdos_name, 1, is_hid, cluster, &ts, &sinfo); msdos_mkdir()
376 inc_nlink(dir); msdos_mkdir()
392 fat_flush_inodes(sb, dir, inode); msdos_mkdir()
396 fat_free_clusters(dir, cluster); msdos_mkdir()
403 static int msdos_unlink(struct inode *dir, struct dentry *dentry) msdos_unlink() argument
411 err = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo); msdos_unlink()
415 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ msdos_unlink()
424 err = fat_flush_inodes(sb, dir, inode); msdos_unlink()
H A Dnamei_vfat.c222 static int vfat_find_form(struct inode *dir, unsigned char *name) vfat_find_form() argument
225 int err = fat_scan(dir, name, &sinfo); vfat_find_form()
313 static int vfat_create_shortname(struct inode *dir, struct nls_table *nls, vfat_create_shortname() argument
317 struct fat_mount_options *opts = &MSDOS_SB(dir->i_sb)->options; vfat_create_shortname()
434 if (vfat_find_form(dir, name_res) == 0) vfat_create_shortname()
455 if (vfat_find_form(dir, name_res) < 0) vfat_create_shortname()
473 if (vfat_find_form(dir, name_res) < 0) vfat_create_shortname()
488 if (vfat_find_form(dir, name_res) < 0) vfat_create_shortname()
578 static int vfat_build_slots(struct inode *dir, const unsigned char *name, vfat_build_slots() argument
583 struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); vfat_build_slots()
610 err = vfat_create_shortname(dir, sbi->nls_disk, uname, ulen, vfat_build_slots()
655 static int vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir, vfat_add_entry() argument
671 err = vfat_build_slots(dir, qname->name, len, is_dir, cluster, ts, vfat_add_entry()
676 err = fat_add_entries(dir, slots, nr_slots, sinfo); vfat_add_entry()
681 dir->i_ctime = dir->i_mtime = dir->i_atime = *ts; vfat_add_entry()
682 if (IS_DIRSYNC(dir)) vfat_add_entry()
683 (void)fat_sync_inode(dir); vfat_add_entry()
685 mark_inode_dirty(dir); vfat_add_entry()
691 static int vfat_find(struct inode *dir, struct qstr *qname, vfat_find() argument
697 return fat_search_long(dir, qname->name, len, sinfo); vfat_find()
709 static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry, vfat_lookup() argument
712 struct super_block *sb = dir->i_sb; vfat_lookup()
720 err = vfat_find(dir, &dentry->d_name, &sinfo); vfat_lookup()
739 * FS is not corrupted (especially double linked dir). vfat_lookup()
762 dentry->d_time = dir->i_version; vfat_lookup()
769 static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, vfat_create() argument
772 struct super_block *sb = dir->i_sb; vfat_create()
781 err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); vfat_create()
784 dir->i_version++; vfat_create()
802 static int vfat_rmdir(struct inode *dir, struct dentry *dentry) vfat_rmdir() argument
805 struct super_block *sb = dir->i_sb; vfat_rmdir()
814 err = vfat_find(dir, &dentry->d_name, &sinfo); vfat_rmdir()
818 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ vfat_rmdir()
821 drop_nlink(dir); vfat_rmdir()
826 dentry->d_time = dir->i_version; vfat_rmdir()
833 static int vfat_unlink(struct inode *dir, struct dentry *dentry) vfat_unlink() argument
836 struct super_block *sb = dir->i_sb; vfat_unlink()
842 err = vfat_find(dir, &dentry->d_name, &sinfo); vfat_unlink()
846 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ vfat_unlink()
852 dentry->d_time = dir->i_version; vfat_unlink()
859 static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) vfat_mkdir() argument
861 struct super_block *sb = dir->i_sb; vfat_mkdir()
870 cluster = fat_alloc_new_dir(dir, &ts); vfat_mkdir()
875 err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); vfat_mkdir()
878 dir->i_version++; vfat_mkdir()
879 inc_nlink(dir); vfat_mkdir()
899 fat_free_clusters(dir, cluster); vfat_mkdir()
/linux-4.4.14/fs/hfs/
H A DMakefile8 catalog.o dir.o extent.o inode.o attr.o mdb.o \
H A Dcatalog.c43 rec->dir.DirID = cpu_to_be32(cnid); hfs_cat_build_record()
44 rec->dir.CrDat = mtime; hfs_cat_build_record()
45 rec->dir.MdDat = mtime; hfs_cat_build_record()
46 rec->dir.BkDat = 0; hfs_cat_build_record()
47 rec->dir.UsrInfo.frView = cpu_to_be16(0xff); hfs_cat_build_record()
82 int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode *inode) hfs_cat_create() argument
92 if (dir->i_size >= HFS_MAX_VALENCE) hfs_cat_create()
95 sb = dir->i_sb; hfs_cat_create()
103 dir->i_ino, str); hfs_cat_create()
114 hfs_cat_build_key(sb, fd.search_key, dir->i_ino, str); hfs_cat_create()
127 dir->i_size++; hfs_cat_create()
128 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; hfs_cat_create()
129 mark_inode_dirty(dir); hfs_cat_create()
213 int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str) hfs_cat_delete() argument
221 sb = dir->i_sb; hfs_cat_delete()
226 hfs_cat_build_key(sb, fd.search_key, dir->i_ino, str); hfs_cat_delete()
243 list_for_each(pos, &HFS_I(dir)->open_dir_list) { hfs_cat_delete()
262 dir->i_size--; hfs_cat_delete()
263 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; hfs_cat_delete()
264 mark_inode_dirty(dir); hfs_cat_delete()
297 /* find the old dir entry and read the data */ hfs_cat_move()
310 /* create new dir entry with the data from the old entry */ hfs_cat_move()
H A Ddir.c2 * linux/fs/hfs/dir.c
20 static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, hfs_lookup() argument
28 res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); hfs_lookup()
31 hfs_cat_build_key(dir->i_sb, fd.search_key, dir->i_ino, &dentry->d_name); hfs_lookup()
42 inode = hfs_iget(dir->i_sb, &fd.search_key->cat, &rec); hfs_lookup()
112 pr_err("walked past end of dir\n"); hfs_readdir()
127 pr_err("small dir entry\n"); hfs_readdir()
132 be32_to_cpu(entry.dir.DirID), DT_DIR)) hfs_readdir()
192 static int hfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, hfs_create() argument
198 inode = hfs_new_inode(dir, &dentry->d_name, mode); hfs_create()
202 res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode); hfs_create()
222 static int hfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) hfs_mkdir() argument
227 inode = hfs_new_inode(dir, &dentry->d_name, S_IFDIR | mode); hfs_mkdir()
231 res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode); hfs_mkdir()
254 static int hfs_remove(struct inode *dir, struct dentry *dentry) hfs_remove() argument
261 res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name); hfs_remove()
280 * XXX: how do you handle must_be dir?
/linux-4.4.14/fs/nilfs2/
H A DMakefile2 nilfs2-y := inode.o file.o dir.o super.o namei.o page.o mdt.o \
H A Dnamei.c68 nilfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) nilfs_lookup() argument
76 ino = nilfs_inode_by_name(dir, &dentry->d_name); nilfs_lookup()
77 inode = ino ? nilfs_iget(dir->i_sb, NILFS_I(dir)->i_root, ino) : NULL; nilfs_lookup()
89 static int nilfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, nilfs_create() argument
96 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_create()
99 inode = nilfs_new_inode(dir, mode); nilfs_create()
109 err = nilfs_transaction_commit(dir->i_sb); nilfs_create()
111 nilfs_transaction_abort(dir->i_sb); nilfs_create()
117 nilfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) nilfs_mknod() argument
123 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_mknod()
126 inode = nilfs_new_inode(dir, mode); nilfs_mknod()
134 err = nilfs_transaction_commit(dir->i_sb); nilfs_mknod()
136 nilfs_transaction_abort(dir->i_sb); nilfs_mknod()
141 static int nilfs_symlink(struct inode *dir, struct dentry *dentry, nilfs_symlink() argument
145 struct super_block *sb = dir->i_sb; nilfs_symlink()
153 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_symlink()
157 inode = nilfs_new_inode(dir, S_IFLNK | S_IRWXUGO); nilfs_symlink()
175 err = nilfs_transaction_commit(dir->i_sb); nilfs_symlink()
177 nilfs_transaction_abort(dir->i_sb); nilfs_symlink()
189 static int nilfs_link(struct dentry *old_dentry, struct inode *dir, nilfs_link() argument
196 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_link()
207 err = nilfs_transaction_commit(dir->i_sb); nilfs_link()
211 nilfs_transaction_abort(dir->i_sb); nilfs_link()
217 static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) nilfs_mkdir() argument
223 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_mkdir()
227 inc_nlink(dir); nilfs_mkdir()
229 inode = nilfs_new_inode(dir, S_IFDIR | mode); nilfs_mkdir()
240 err = nilfs_make_empty(inode, dir); nilfs_mkdir()
253 err = nilfs_transaction_commit(dir->i_sb); nilfs_mkdir()
255 nilfs_transaction_abort(dir->i_sb); nilfs_mkdir()
266 drop_nlink(dir); nilfs_mkdir()
267 nilfs_mark_inode_dirty(dir); nilfs_mkdir()
271 static int nilfs_do_unlink(struct inode *dir, struct dentry *dentry) nilfs_do_unlink() argument
279 de = nilfs_find_entry(dir, &dentry->d_name, &page); nilfs_do_unlink()
298 inode->i_ctime = dir->i_ctime; nilfs_do_unlink()
305 static int nilfs_unlink(struct inode *dir, struct dentry *dentry) nilfs_unlink() argument
310 err = nilfs_transaction_begin(dir->i_sb, &ti, 0); nilfs_unlink()
314 err = nilfs_do_unlink(dir, dentry); nilfs_unlink()
317 nilfs_mark_inode_dirty(dir); nilfs_unlink()
319 err = nilfs_transaction_commit(dir->i_sb); nilfs_unlink()
321 nilfs_transaction_abort(dir->i_sb); nilfs_unlink()
326 static int nilfs_rmdir(struct inode *dir, struct dentry *dentry) nilfs_rmdir() argument
332 err = nilfs_transaction_begin(dir->i_sb, &ti, 0); nilfs_rmdir()
338 err = nilfs_do_unlink(dir, dentry); nilfs_rmdir()
343 drop_nlink(dir); nilfs_rmdir()
344 nilfs_mark_inode_dirty(dir); nilfs_rmdir()
348 err = nilfs_transaction_commit(dir->i_sb); nilfs_rmdir()
350 nilfs_transaction_abort(dir->i_sb); nilfs_rmdir()
H A Ddir.c2 * dir.c - NILFS directory entry operations
23 * linux/fs/ext2/dir.c
32 * linux/fs/minix/dir.c
88 struct inode *dir = mapping->host; nilfs_commit_chunk() local
96 if (pos + copied > dir->i_size) nilfs_commit_chunk()
97 i_size_write(dir, pos + copied); nilfs_commit_chunk()
98 if (IS_DIRSYNC(dir)) nilfs_commit_chunk()
100 err = nilfs_set_file_dirty(dir, nr_dirty); nilfs_commit_chunk()
107 struct inode *dir = page->mapping->host; nilfs_check_page() local
108 struct super_block *sb = dir->i_sb; nilfs_check_page()
109 unsigned chunk_size = nilfs_chunk_size(dir); nilfs_check_page()
116 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { nilfs_check_page()
117 limit = dir->i_size & ~PAGE_CACHE_MASK; nilfs_check_page()
147 dir->i_ino nilfs_check_page()
164 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, nilfs_check_page()
173 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, nilfs_check_page()
180 static struct page *nilfs_get_page(struct inode *dir, unsigned long n) nilfs_get_page() argument
182 struct address_space *mapping = dir->i_mapping; nilfs_get_page()
319 nilfs_find_entry(struct inode *dir, const struct qstr *qstr, nilfs_find_entry() argument
326 unsigned long npages = dir_pages(dir); nilfs_find_entry()
328 struct nilfs_inode_info *ei = NILFS_I(dir); nilfs_find_entry()
343 page = nilfs_get_page(dir, n); nilfs_find_entry()
347 kaddr += nilfs_last_byte(dir, n) - reclen; nilfs_find_entry()
350 nilfs_error(dir->i_sb, __func__, nilfs_find_entry()
364 if (unlikely(n > (dir->i_blocks >> (PAGE_CACHE_SHIFT - 9)))) { nilfs_find_entry()
365 nilfs_error(dir->i_sb, __func__, nilfs_find_entry()
366 "dir %lu size %lld exceeds block count %llu", nilfs_find_entry()
367 dir->i_ino, dir->i_size, nilfs_find_entry()
368 (unsigned long long)dir->i_blocks); nilfs_find_entry()
381 struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct page **p) nilfs_dotdot() argument
383 struct page *page = nilfs_get_page(dir, 0); nilfs_dotdot()
394 ino_t nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr) nilfs_inode_by_name() argument
400 de = nilfs_find_entry(dir, qstr, &page); nilfs_inode_by_name()
410 void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de, nilfs_set_link() argument
425 dir->i_mtime = dir->i_ctime = CURRENT_TIME; nilfs_set_link()
433 struct inode *dir = d_inode(dentry->d_parent); nilfs_add_link() local
436 unsigned chunk_size = nilfs_chunk_size(dir); nilfs_add_link()
441 unsigned long npages = dir_pages(dir); nilfs_add_link()
455 page = nilfs_get_page(dir, n); nilfs_add_link()
461 dir_end = kaddr + nilfs_last_byte(dir, n); nilfs_add_link()
474 nilfs_error(dir->i_sb, __func__, nilfs_add_link()
515 dir->i_mtime = dir->i_ctime = CURRENT_TIME; nilfs_add_link()
516 nilfs_mark_inode_dirty(dir); nilfs_add_link()
531 int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) nilfs_delete_entry() argument
536 unsigned from = ((char *)dir - kaddr) & ~(nilfs_chunk_size(inode) - 1); nilfs_delete_entry()
537 unsigned to = ((char *)dir - kaddr) + nilfs_delete_entry()
538 nilfs_rec_len_from_disk(dir->rec_len); nilfs_delete_entry()
543 while ((char *)de < (char *)dir) { nilfs_delete_entry()
560 dir->inode = 0; nilfs_delete_entry()
/linux-4.4.14/fs/affs/
H A DMakefile9 affs-objs := super.o namei.o inode.o file.o dir.o amigaffs.o bitmap.o symlink.o
H A Dnamei.c188 affs_find_entry(struct inode *dir, struct dentry *dentry) affs_find_entry() argument
190 struct super_block *sb = dir->i_sb; affs_find_entry()
197 bh = affs_bread(sb, dir->i_ino); affs_find_entry()
217 affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) affs_lookup() argument
219 struct super_block *sb = dir->i_sb; affs_lookup()
225 affs_lock_dir(dir); affs_lookup()
226 bh = affs_find_entry(dir, dentry); affs_lookup()
227 affs_unlock_dir(dir); affs_lookup()
251 affs_unlink(struct inode *dir, struct dentry *dentry) affs_unlink() argument
253 pr_debug("%s(dir=%lu, %lu \"%pd\")\n", __func__, dir->i_ino, affs_unlink()
260 affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) affs_create() argument
262 struct super_block *sb = dir->i_sb; affs_create()
267 __func__, dir->i_ino, dentry, mode); affs_create()
269 inode = affs_new_inode(dir); affs_create()
281 error = affs_add_entry(dir, inode, dentry, ST_FILE); affs_create()
291 affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) affs_mkdir() argument
297 __func__, dir->i_ino, dentry, mode); affs_mkdir()
299 inode = affs_new_inode(dir); affs_mkdir()
309 error = affs_add_entry(dir, inode, dentry, ST_USERDIR); affs_mkdir()
320 affs_rmdir(struct inode *dir, struct dentry *dentry) affs_rmdir() argument
322 pr_debug("%s(dir=%lu, %lu \"%pd\")\n", __func__, dir->i_ino, affs_rmdir()
329 affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) affs_symlink() argument
331 struct super_block *sb = dir->i_sb; affs_symlink()
339 __func__, dir->i_ino, dentry, symname); affs_symlink()
342 inode = affs_new_inode(dir); affs_symlink()
390 error = affs_add_entry(dir, inode, dentry, ST_SOFTLINK); affs_symlink()
404 affs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) affs_link() argument
408 pr_debug("%s(%lu, %lu, \"%pd\")\n", __func__, inode->i_ino, dir->i_ino, affs_link()
411 return affs_add_entry(dir, inode, dentry, ST_LINKFILE); affs_link()
H A Damigaffs.c18 /* Insert a header block bh into the directory dir
23 affs_insert_hash(struct inode *dir, struct buffer_head *bh) affs_insert_hash() argument
25 struct super_block *sb = dir->i_sb; affs_insert_hash()
33 pr_debug("%s(dir=%lu, ino=%d)\n", __func__, dir->i_ino, ino); affs_insert_hash()
35 dir_bh = affs_bread(sb, dir->i_ino); affs_insert_hash()
47 AFFS_TAIL(sb, bh)->parent = cpu_to_be32(dir->i_ino); affs_insert_hash()
51 if (dir->i_ino == dir_bh->b_blocknr) affs_insert_hash()
57 mark_buffer_dirty_inode(dir_bh, dir); affs_insert_hash()
60 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; affs_insert_hash()
61 dir->i_version++; affs_insert_hash()
62 mark_inode_dirty(dir); affs_insert_hash()
72 affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh) affs_remove_hash() argument
80 sb = dir->i_sb; affs_remove_hash()
83 pr_debug("%s(dir=%lu, ino=%d, hashval=%d)\n", __func__, dir->i_ino, affs_remove_hash()
86 bh = affs_bread(sb, dir->i_ino); affs_remove_hash()
95 if (dir->i_ino == bh->b_blocknr) affs_remove_hash()
100 mark_buffer_dirty_inode(bh, dir); affs_remove_hash()
114 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; affs_remove_hash()
115 dir->i_version++; affs_remove_hash()
116 mark_inode_dirty(dir); affs_remove_hash()
141 struct inode *dir, *inode = d_inode(dentry); affs_remove_link() local
163 dir = affs_iget(sb, be32_to_cpu(AFFS_TAIL(sb, link_bh)->parent)); affs_remove_link()
164 if (IS_ERR(dir)) { affs_remove_link()
165 retval = PTR_ERR(dir); affs_remove_link()
169 affs_lock_dir(dir); affs_remove_link()
175 retval = affs_remove_hash(dir, link_bh); affs_remove_link()
177 affs_unlock_dir(dir); affs_remove_link()
183 retval = affs_insert_hash(dir, bh); affs_remove_link()
185 affs_unlock_dir(dir); affs_remove_link()
190 affs_unlock_dir(dir); affs_remove_link()
191 iput(dir); affs_remove_link()
267 struct inode *inode, *dir; affs_remove_header() local
271 dir = d_inode(dentry->d_parent); affs_remove_header()
272 sb = dir->i_sb; affs_remove_header()
286 affs_lock_dir(dir); affs_remove_header()
303 retval = affs_remove_hash(dir, bh); affs_remove_header()
308 affs_unlock_dir(dir); affs_remove_header()
323 affs_unlock_dir(dir); affs_remove_header()
/linux-4.4.14/fs/dlm/
H A DMakefile4 dir.o \
/linux-4.4.14/fs/sysv/
H A DMakefile7 sysv-objs := ialloc.o balloc.o inode.o itree.o file.o dir.o \
H A Dnamei.c45 static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, unsigned int flags) sysv_lookup() argument
55 inode = sysv_iget(dir->i_sb, ino); sysv_lookup()
63 static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev) sysv_mknod() argument
71 inode = sysv_new_inode(dir, mode); sysv_mknod()
82 static int sysv_create(struct inode * dir, struct dentry * dentry, umode_t mode, bool excl) sysv_create() argument
84 return sysv_mknod(dir, dentry, mode, 0); sysv_create()
87 static int sysv_symlink(struct inode * dir, struct dentry * dentry, sysv_symlink() argument
94 if (l > dir->i_sb->s_blocksize) sysv_symlink()
97 inode = sysv_new_inode(dir, S_IFLNK|0777); sysv_symlink()
118 static int sysv_link(struct dentry * old_dentry, struct inode * dir, sysv_link() argument
130 static int sysv_mkdir(struct inode * dir, struct dentry *dentry, umode_t mode) sysv_mkdir() argument
135 inode_inc_link_count(dir); sysv_mkdir()
137 inode = sysv_new_inode(dir, S_IFDIR|mode); sysv_mkdir()
146 err = sysv_make_empty(inode, dir); sysv_mkdir()
163 inode_dec_link_count(dir); sysv_mkdir()
167 static int sysv_unlink(struct inode * dir, struct dentry * dentry) sysv_unlink() argument
182 inode->i_ctime = dir->i_ctime; sysv_unlink()
188 static int sysv_rmdir(struct inode * dir, struct dentry * dentry) sysv_rmdir() argument
194 err = sysv_unlink(dir, dentry); sysv_rmdir()
198 inode_dec_link_count(dir); sysv_rmdir()
H A Ddir.c2 * linux/fs/sysv/dir.c
4 * minix/dir.c
7 * coh/dir.c
10 * sysv/dir.c
39 struct inode *dir = mapping->host; dir_commit_chunk() local
43 if (pos+len > dir->i_size) { dir_commit_chunk()
44 i_size_write(dir, pos+len); dir_commit_chunk()
45 mark_inode_dirty(dir); dir_commit_chunk()
47 if (IS_DIRSYNC(dir)) dir_commit_chunk()
54 static struct page * dir_get_page(struct inode *dir, unsigned long n) dir_get_page() argument
56 struct address_space *mapping = dir->i_mapping; dir_get_page()
130 struct inode * dir = d_inode(dentry->d_parent); sysv_find_entry() local
132 unsigned long npages = dir_pages(dir); sysv_find_entry()
138 start = SYSV_I(dir)->i_dir_start_lookup; sysv_find_entry()
145 page = dir_get_page(dir, n); sysv_find_entry()
167 SYSV_I(dir)->i_dir_start_lookup = n; sysv_find_entry()
174 struct inode *dir = d_inode(dentry->d_parent); sysv_add_link() local
179 unsigned long npages = dir_pages(dir); sysv_add_link()
187 page = dir_get_page(dir, n); sysv_add_link()
218 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; sysv_add_link()
219 mark_inode_dirty(dir); sysv_add_link()
247 int sysv_make_empty(struct inode *inode, struct inode *dir) sysv_make_empty() argument
270 de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), dir->i_ino); sysv_make_empty()
329 struct inode *dir = page->mapping->host; sysv_set_link() local
340 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; sysv_set_link()
341 mark_inode_dirty(dir); sysv_set_link()
344 struct sysv_dir_entry * sysv_dotdot (struct inode *dir, struct page **p) sysv_dotdot() argument
346 struct page *page = dir_get_page(dir, 0); sysv_dotdot()
/linux-4.4.14/fs/udf/
H A DMakefile7 udf-objs := balloc.o dir.o file.o ialloc.o inode.o lowlevel.o namei.o \
H A Ddirectory.c20 struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, udf_fileident_read() argument
30 struct udf_inode_info *iinfo = UDF_I(dir); udf_fileident_read()
39 dir->i_sb->s_blocksize, udf_fileident_read()
52 if (fibh->eoffset == dir->i_sb->s_blocksize) { udf_fileident_read()
54 unsigned char blocksize_bits = dir->i_sb->s_blocksize_bits; udf_fileident_read()
56 if (udf_next_aext(dir, epos, eloc, elen, 1) != udf_fileident_read()
60 block = udf_get_lb_pblock(dir->i_sb, eloc, *offset); udf_fileident_read()
70 fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block); udf_fileident_read()
80 block = udf_get_lb_pblock(dir->i_sb, eloc, udf_fileident_read()
82 tmp = udf_tgetblk(dir->i_sb, block); udf_fileident_read()
100 fi = udf_get_fileident(fibh->sbh->b_data, dir->i_sb->s_blocksize, udf_fileident_read()
108 if (fibh->eoffset <= dir->i_sb->s_blocksize) { udf_fileident_read()
111 } else if (fibh->eoffset > dir->i_sb->s_blocksize) { udf_fileident_read()
114 if (udf_next_aext(dir, epos, eloc, elen, 1) != udf_fileident_read()
118 block = udf_get_lb_pblock(dir->i_sb, eloc, *offset); udf_fileident_read()
122 if ((*offset << dir->i_sb->s_blocksize_bits) >= *elen) udf_fileident_read()
127 fibh->soffset -= dir->i_sb->s_blocksize; udf_fileident_read()
128 fibh->eoffset -= dir->i_sb->s_blocksize; udf_fileident_read()
130 fibh->ebh = udf_tread(dir->i_sb, block); udf_fileident_read()
H A Dnamei.c18 * 12/12/98 blf Created. Split out the lookup code from dir.c
144 * @dir: directory inode to search in
149 * This function searches in the directory @dir for a file name @child. When
160 static struct fileIdentDesc *udf_find_entry(struct inode *dir, udf_find_entry() argument
177 struct udf_inode_info *dinfo = UDF_I(dir); udf_find_entry()
180 struct super_block *sb = dir->i_sb; udf_find_entry()
182 size = udf_ext0_offset(dir) + dir->i_size; udf_find_entry()
183 f_pos = udf_ext0_offset(dir); udf_find_entry()
188 if (inode_bmap(dir, f_pos >> sb->s_blocksize_bits, &epos, udf_find_entry()
217 fi = udf_fileident_read(dir, &f_pos, fibh, cfi, &epos, &eloc, udf_find_entry()
286 static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry, udf_lookup() argument
306 inode = udf_iget(dir->i_sb, lb); udf_lookup()
312 fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); udf_lookup()
324 inode = udf_iget(dir->i_sb, &loc); udf_lookup()
332 static struct fileIdentDesc *udf_add_entry(struct inode *dir, udf_add_entry() argument
337 struct super_block *sb = dir->i_sb; udf_add_entry()
342 loff_t size = udf_ext0_offset(dir) + dir->i_size; udf_add_entry()
377 f_pos = udf_ext0_offset(dir); udf_add_entry()
379 fibh->soffset = fibh->eoffset = f_pos & (dir->i_sb->s_blocksize - 1); udf_add_entry()
380 dinfo = UDF_I(dir); udf_add_entry()
382 if (inode_bmap(dir, f_pos >> dir->i_sb->s_blocksize_bits, &epos, udf_add_entry()
384 block = udf_get_lb_pblock(dir->i_sb, udf_add_entry()
389 block = udf_get_lb_pblock(dir->i_sb, &eloc, offset); udf_add_entry()
390 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { udf_add_entry()
398 fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block); udf_add_entry()
408 fi = udf_fileident_read(dir, &f_pos, fibh, cfi, &epos, &eloc, udf_add_entry()
427 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, udf_add_entry()
445 fibh->soffset -= udf_ext0_offset(dir); udf_add_entry()
446 fibh->eoffset -= udf_ext0_offset(dir); udf_add_entry()
447 f_pos -= udf_ext0_offset(dir); udf_add_entry()
452 udf_expand_dir_adinicb(dir, &block, err); udf_add_entry()
456 epos.offset = udf_file_entry_alloc_offset(dir); udf_add_entry()
458 udf_current_aext(dir, &epos, &eloc, &elen, 1); udf_add_entry()
475 udf_ext0_offset(dir) + udf_add_entry()
480 dir->i_sb->s_blocksize_bits); udf_add_entry()
491 udf_write_aext(dir, &epos, &eloc, elen, 1); udf_add_entry()
503 dir->i_sb->s_blocksize_bits); udf_add_entry()
504 fibh->ebh = udf_bread(dir, udf_add_entry()
505 f_pos >> dir->i_sb->s_blocksize_bits, 1, err); udf_add_entry()
512 epos.offset = udf_file_entry_alloc_offset(dir); udf_add_entry()
516 while (udf_next_aext(dir, &epos, &eloc, &elen, 1) == udf_add_entry()
520 dir->i_sb->s_blocksize_bits); udf_add_entry()
541 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, name)) { udf_add_entry()
542 dir->i_size += nfidlen; udf_add_entry()
547 while (udf_next_aext(dir, &epos, &eloc, &elen, 1) == udf_add_entry()
550 elen -= dinfo->i_lenExtents - dir->i_size; udf_add_entry()
555 udf_write_aext(dir, &epos, &eloc, elen, 1); udf_add_entry()
556 dinfo->i_lenExtents = dir->i_size; udf_add_entry()
559 mark_inode_dirty(dir); udf_add_entry()
592 struct inode *dir = d_inode(dentry->d_parent); udf_add_nondir() local
597 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); udf_add_nondir()
608 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_add_nondir()
609 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_add_nondir()
610 mark_inode_dirty(dir); udf_add_nondir()
620 static int udf_create(struct inode *dir, struct dentry *dentry, umode_t mode, udf_create() argument
623 struct inode *inode = udf_new_inode(dir, mode); udf_create()
639 static int udf_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) udf_tmpfile() argument
641 struct inode *inode = udf_new_inode(dir, mode); udf_tmpfile()
658 static int udf_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, udf_mknod() argument
666 inode = udf_new_inode(dir, mode); udf_mknod()
674 static int udf_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) udf_mkdir() argument
680 struct udf_inode_info *dinfo = UDF_I(dir); udf_mkdir()
683 inode = udf_new_inode(dir, S_IFDIR | mode); udf_mkdir()
708 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); udf_mkdir()
721 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_mkdir()
722 inc_nlink(dir); udf_mkdir()
723 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_mkdir()
724 mark_inode_dirty(dir); udf_mkdir()
736 static int empty_dir(struct inode *dir) empty_dir() argument
741 loff_t size = udf_ext0_offset(dir) + dir->i_size; empty_dir()
747 struct udf_inode_info *dinfo = UDF_I(dir); empty_dir()
749 f_pos = udf_ext0_offset(dir); empty_dir()
750 fibh.soffset = fibh.eoffset = f_pos & (dir->i_sb->s_blocksize - 1); empty_dir()
754 else if (inode_bmap(dir, f_pos >> dir->i_sb->s_blocksize_bits, empty_dir()
757 block = udf_get_lb_pblock(dir->i_sb, &eloc, offset); empty_dir()
758 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { empty_dir()
766 fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block); empty_dir()
777 fi = udf_fileident_read(dir, &f_pos, &fibh, &cfi, &epos, &eloc, empty_dir()
805 static int udf_rmdir(struct inode *dir, struct dentry *dentry) udf_rmdir() argument
814 fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); udf_rmdir()
823 if (udf_get_lb_pblock(dir->i_sb, &tloc, 0) != inode->i_ino) udf_rmdir()
828 retval = udf_delete_entry(dir, fi, &fibh, &cfi); udf_rmdir()
836 inode_dec_link_count(dir); udf_rmdir()
837 inode->i_ctime = dir->i_ctime = dir->i_mtime = udf_rmdir()
838 current_fs_time(dir->i_sb); udf_rmdir()
839 mark_inode_dirty(dir); udf_rmdir()
850 static int udf_unlink(struct inode *dir, struct dentry *dentry) udf_unlink() argument
860 fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); udf_unlink()
870 if (udf_get_lb_pblock(dir->i_sb, &tloc, 0) != inode->i_ino) udf_unlink()
878 retval = udf_delete_entry(dir, fi, &fibh, &cfi); udf_unlink()
881 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_unlink()
882 mark_inode_dirty(dir); udf_unlink()
884 inode->i_ctime = dir->i_ctime; udf_unlink()
896 static int udf_symlink(struct inode *dir, struct dentry *dentry, udf_symlink() argument
899 struct inode *inode = udf_new_inode(dir, S_IFLNK | S_IRWXUGO); udf_symlink()
910 struct super_block *sb = dir->i_sb; udf_symlink()
1044 static int udf_link(struct dentry *old_dentry, struct inode *dir, udf_link() argument
1052 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); udf_link()
1062 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_link()
1063 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) udf_link()
1064 mark_inode_dirty(dir); udf_link()
1072 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_link()
1073 mark_inode_dirty(dir); udf_link()
H A Ddir.c2 * dir.c
40 struct inode *dir = file_inode(file); udf_readdir() local
41 struct udf_inode_info *iinfo = UDF_I(dir); udf_readdir()
52 loff_t size = udf_ext0_offset(dir) + dir->i_size; udf_readdir()
59 struct super_block *sb = dir->i_sb; udf_readdir()
77 nf_pos = udf_ext0_offset(dir); udf_readdir()
81 if (inode_bmap(dir, nf_pos >> sb->s_blocksize_bits, udf_readdir()
128 fi = udf_fileident_read(dir, &nf_pos, &fibh, &cfi, &epos, &eloc, udf_readdir()
H A Dialloc.c48 struct inode *udf_new_inode(struct inode *dir, umode_t mode) udf_new_inode() argument
50 struct super_block *sb = dir->i_sb; udf_new_inode()
54 uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; udf_new_inode()
56 struct udf_inode_info *dinfo = UDF_I(dir); udf_new_inode()
85 block = udf_new_block(dir->i_sb, NULL, udf_new_inode()
106 inode_init_owner(inode, dir, mode); udf_new_inode()
/linux-4.4.14/fs/ufs/
H A DMakefile7 ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \
H A Dnamei.c51 static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) ufs_lookup() argument
59 ino = ufs_inode_by_name(dir, &dentry->d_name); ufs_lookup()
61 inode = ufs_iget(dir->i_sb, ino); ufs_lookup()
73 static int ufs_create (struct inode * dir, struct dentry * dentry, umode_t mode, ufs_create() argument
78 inode = ufs_new_inode(dir, mode); ufs_create()
89 static int ufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) ufs_mknod() argument
97 inode = ufs_new_inode(dir, mode); ufs_mknod()
108 static int ufs_symlink (struct inode * dir, struct dentry * dentry, ufs_symlink() argument
111 struct super_block * sb = dir->i_sb; ufs_symlink()
119 inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); ufs_symlink()
149 static int ufs_link (struct dentry * old_dentry, struct inode * dir, ufs_link() argument
168 static int ufs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) ufs_mkdir() argument
173 inode_inc_link_count(dir); ufs_mkdir()
175 inode = ufs_new_inode(dir, S_IFDIR|mode); ufs_mkdir()
186 err = ufs_make_empty(inode, dir); ufs_mkdir()
204 inode_dec_link_count(dir); ufs_mkdir()
208 static int ufs_unlink(struct inode *dir, struct dentry *dentry) ufs_unlink() argument
215 de = ufs_find_entry(dir, &dentry->d_name, &page); ufs_unlink()
219 err = ufs_delete_entry(dir, de, page); ufs_unlink()
223 inode->i_ctime = dir->i_ctime; ufs_unlink()
230 static int ufs_rmdir (struct inode * dir, struct dentry *dentry) ufs_rmdir() argument
236 err = ufs_unlink(dir, dentry); ufs_rmdir()
240 inode_dec_link_count(dir); ufs_rmdir()
H A Ddir.c46 struct inode *dir = mapping->host; ufs_commit_chunk() local
49 dir->i_version++; ufs_commit_chunk()
51 if (pos+len > dir->i_size) { ufs_commit_chunk()
52 i_size_write(dir, pos+len); ufs_commit_chunk()
53 mark_inode_dirty(dir); ufs_commit_chunk()
55 if (IS_DIRSYNC(dir)) ufs_commit_chunk()
68 ino_t ufs_inode_by_name(struct inode *dir, const struct qstr *qstr) ufs_inode_by_name() argument
74 de = ufs_find_entry(dir, qstr, &page); ufs_inode_by_name()
76 res = fs32_to_cpu(dir->i_sb, de->d_ino); ufs_inode_by_name()
84 void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, ufs_set_link() argument
90 unsigned len = fs16_to_cpu(dir->i_sb, de->d_reclen); ufs_set_link()
97 de->d_ino = cpu_to_fs32(dir->i_sb, inode->i_ino); ufs_set_link()
98 ufs_set_de_type(dir->i_sb, de, inode->i_mode); ufs_set_link()
103 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ufs_set_link()
104 mark_inode_dirty(dir); ufs_set_link()
110 struct inode *dir = page->mapping->host; ufs_check_page() local
111 struct super_block *sb = dir->i_sb; ufs_check_page()
119 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { ufs_check_page()
120 limit = dir->i_size & ~PAGE_CACHE_MASK; ufs_check_page()
153 dir->i_ino ufs_check_page()
173 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, ufs_check_page()
181 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs); ufs_check_page()
187 static struct page *ufs_get_page(struct inode *dir, unsigned long n) ufs_get_page() argument
189 struct address_space *mapping = dir->i_mapping; ufs_get_page()
227 struct ufs_dir_entry *ufs_dotdot(struct inode *dir, struct page **p) ufs_dotdot() argument
229 struct page *page = ufs_get_page(dir, 0); ufs_dotdot()
233 de = ufs_next_entry(dir->i_sb, ufs_dotdot()
248 struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr, ufs_find_entry() argument
251 struct super_block *sb = dir->i_sb; ufs_find_entry()
256 unsigned long npages = dir_pages(dir); ufs_find_entry()
258 struct ufs_inode_info *ui = UFS_I(dir); ufs_find_entry()
261 UFSD("ENTER, dir_ino %lu, name %s, namlen %u\n", dir->i_ino, name, namelen); ufs_find_entry()
276 page = ufs_get_page(dir, n); ufs_find_entry()
280 kaddr += ufs_last_byte(dir, n) - reclen; ufs_find_entry()
283 ufs_error(dir->i_sb, __func__, ufs_find_entry()
311 struct inode *dir = d_inode(dentry->d_parent); ufs_add_link() local
314 struct super_block *sb = dir->i_sb; ufs_add_link()
320 unsigned long npages = dir_pages(dir); ufs_add_link()
336 page = ufs_get_page(dir, n); ufs_add_link()
342 dir_end = kaddr + ufs_last_byte(dir, n); ufs_add_link()
355 ufs_error(dir->i_sb, __func__, ufs_add_link()
398 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ufs_add_link()
400 mark_inode_dirty(dir); ufs_add_link()
508 int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, ufs_delete_entry() argument
513 unsigned from = ((char*)dir - kaddr) & ~(UFS_SB(sb)->s_uspi->s_dirblksize - 1); ufs_delete_entry()
514 unsigned to = ((char*)dir - kaddr) + fs16_to_cpu(sb, dir->d_reclen); ufs_delete_entry()
527 while ((char*)de < (char*)dir) { ufs_delete_entry()
546 dir->d_ino = 0; ufs_delete_entry()
556 int ufs_make_empty(struct inode * inode, struct inode *dir) ufs_make_empty() argument
558 struct super_block * sb = dir->i_sb; ufs_make_empty()
588 de->d_ino = cpu_to_fs32(sb, dir->i_ino); ufs_make_empty()
589 ufs_set_de_type(sb, de, dir->i_mode); ufs_make_empty()
/linux-4.4.14/arch/arm/include/asm/xen/
H A Dpage-coherent.h10 enum dma_data_direction dir, struct dma_attrs *attrs);
12 size_t size, enum dma_data_direction dir,
15 dma_addr_t handle, size_t size, enum dma_data_direction dir);
18 dma_addr_t handle, size_t size, enum dma_data_direction dir);
36 enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_map_page()
55 __generic_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs); xen_dma_map_page()
57 __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs); xen_dma_map_page()
61 size_t size, enum dma_data_direction dir, xen_dma_unmap_page()
75 __generic_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs); xen_dma_unmap_page()
77 __xen_dma_unmap_page(hwdev, handle, size, dir, attrs); xen_dma_unmap_page()
81 dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_cpu()
86 __generic_dma_ops(hwdev)->sync_single_for_cpu(hwdev, handle, size, dir); xen_dma_sync_single_for_cpu()
88 __xen_dma_sync_single_for_cpu(hwdev, handle, size, dir); xen_dma_sync_single_for_cpu()
92 dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_device()
97 __generic_dma_ops(hwdev)->sync_single_for_device(hwdev, handle, size, dir); xen_dma_sync_single_for_device()
99 __xen_dma_sync_single_for_device(hwdev, handle, size, dir); xen_dma_sync_single_for_device()
34 xen_dma_map_page(struct device *hwdev, struct page *page, dma_addr_t dev_addr, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_map_page() argument
60 xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_unmap_page() argument
80 xen_dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_cpu() argument
91 xen_dma_sync_single_for_device(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_device() argument
/linux-4.4.14/fs/ubifs/
H A Ddir.c47 * @dir: parent inode
51 * parent directory inode @dir. UBIFS inodes inherit the following flags:
59 static int inherit_flags(const struct inode *dir, umode_t mode) inherit_flags() argument
62 const struct ubifs_inode *ui = ubifs_inode(dir); inherit_flags()
64 if (!S_ISDIR(dir->i_mode)) inherit_flags()
81 * @dir: parent directory inode
88 struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir, ubifs_new_inode() argument
107 inode_init_owner(inode, dir, mode); ubifs_new_inode()
136 ui->flags = inherit_flags(dir, mode); ubifs_new_inode()
184 static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry, ubifs_lookup() argument
191 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_lookup()
193 dbg_gen("'%pd' in dir ino %lu", dentry, dir->i_ino); ubifs_lookup()
202 dent_key_init(c, &key, dir->i_ino, &dentry->d_name); ubifs_lookup()
218 inode = ubifs_iget(dir->i_sb, le64_to_cpu(dent->inum)); ubifs_lookup()
245 static int ubifs_create(struct inode *dir, struct dentry *dentry, umode_t mode, ubifs_create() argument
249 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_create()
253 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_create()
260 dbg_gen("dent '%pd', mode %#hx in dir ino %lu", ubifs_create()
261 dentry, mode, dir->i_ino); ubifs_create()
267 inode = ubifs_new_inode(c, dir, mode); ubifs_create()
273 err = ubifs_init_security(dir, inode, &dentry->d_name); ubifs_create()
278 dir->i_size += sz_change; ubifs_create()
279 dir_ui->ui_size = dir->i_size; ubifs_create()
280 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_create()
281 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_create()
292 dir->i_size -= sz_change; ubifs_create()
293 dir_ui->ui_size = dir->i_size; ubifs_create()
357 struct inode *dir = file_inode(file); ubifs_readdir() local
358 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_readdir()
360 dbg_gen("dir ino %lu, f_pos %#llx", dir->i_ino, ctx->pos); ubifs_readdir()
394 lowest_dent_key(c, &key, dir->i_ino); ubifs_readdir()
412 dent_key_init_hash(c, &key, dir->i_ino, ctx->pos); ubifs_readdir()
428 ubifs_inode(dir)->creat_sqnum); ubifs_readdir()
466 static int ubifs_dir_release(struct inode *dir, struct file *file) ubifs_dir_release() argument
499 static int ubifs_link(struct dentry *old_dentry, struct inode *dir, ubifs_link() argument
502 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_link()
505 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_link()
515 dbg_gen("dent '%pd' to ino %lu (nlink %d) in dir ino %lu", ubifs_link()
517 inode->i_nlink, dir->i_ino); ubifs_link()
518 ubifs_assert(mutex_is_locked(&dir->i_mutex)); ubifs_link()
529 lock_2_inodes(dir, inode); ubifs_link()
533 dir->i_size += sz_change; ubifs_link()
534 dir_ui->ui_size = dir->i_size; ubifs_link()
535 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_link()
536 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_link()
539 unlock_2_inodes(dir, inode); ubifs_link()
546 dir->i_size -= sz_change; ubifs_link()
547 dir_ui->ui_size = dir->i_size; ubifs_link()
549 unlock_2_inodes(dir, inode); ubifs_link()
555 static int ubifs_unlink(struct inode *dir, struct dentry *dentry) ubifs_unlink() argument
557 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_unlink()
559 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_unlink()
572 dbg_gen("dent '%pd' from ino %lu (nlink %d) in dir ino %lu", ubifs_unlink()
574 inode->i_nlink, dir->i_ino); ubifs_unlink()
575 ubifs_assert(mutex_is_locked(&dir->i_mutex)); ubifs_unlink()
588 lock_2_inodes(dir, inode); ubifs_unlink()
589 inode->i_ctime = ubifs_current_time(dir); ubifs_unlink()
591 dir->i_size -= sz_change; ubifs_unlink()
592 dir_ui->ui_size = dir->i_size; ubifs_unlink()
593 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_unlink()
594 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 1, 0); ubifs_unlink()
597 unlock_2_inodes(dir, inode); ubifs_unlink()
609 dir->i_size += sz_change; ubifs_unlink()
610 dir_ui->ui_size = dir->i_size; ubifs_unlink()
612 unlock_2_inodes(dir, inode); ubifs_unlink()
621 * @dir: VFS inode object of the directory to check
623 * This function checks if directory @dir is empty. Returns zero if the
627 static int check_dir_empty(struct ubifs_info *c, struct inode *dir) check_dir_empty() argument
634 lowest_dent_key(c, &key, dir->i_ino); check_dir_empty()
647 static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) ubifs_rmdir() argument
649 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_rmdir()
653 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_rmdir()
662 dbg_gen("directory '%pd', ino %lu in dir ino %lu", dentry, ubifs_rmdir()
663 inode->i_ino, dir->i_ino); ubifs_rmdir()
664 ubifs_assert(mutex_is_locked(&dir->i_mutex)); ubifs_rmdir()
677 lock_2_inodes(dir, inode); ubifs_rmdir()
678 inode->i_ctime = ubifs_current_time(dir); ubifs_rmdir()
680 drop_nlink(dir); ubifs_rmdir()
681 dir->i_size -= sz_change; ubifs_rmdir()
682 dir_ui->ui_size = dir->i_size; ubifs_rmdir()
683 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_rmdir()
684 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 1, 0); ubifs_rmdir()
687 unlock_2_inodes(dir, inode); ubifs_rmdir()
699 dir->i_size += sz_change; ubifs_rmdir()
700 dir_ui->ui_size = dir->i_size; ubifs_rmdir()
701 inc_nlink(dir); ubifs_rmdir()
703 unlock_2_inodes(dir, inode); ubifs_rmdir()
709 static int ubifs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ubifs_mkdir() argument
712 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_mkdir()
713 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_mkdir()
722 dbg_gen("dent '%pd', mode %#hx in dir ino %lu", ubifs_mkdir()
723 dentry, mode, dir->i_ino); ubifs_mkdir()
729 inode = ubifs_new_inode(c, dir, S_IFDIR | mode); ubifs_mkdir()
735 err = ubifs_init_security(dir, inode, &dentry->d_name); ubifs_mkdir()
742 inc_nlink(dir); ubifs_mkdir()
743 dir->i_size += sz_change; ubifs_mkdir()
744 dir_ui->ui_size = dir->i_size; ubifs_mkdir()
745 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_mkdir()
746 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_mkdir()
758 dir->i_size -= sz_change; ubifs_mkdir()
759 dir_ui->ui_size = dir->i_size; ubifs_mkdir()
760 drop_nlink(dir); ubifs_mkdir()
770 static int ubifs_mknod(struct inode *dir, struct dentry *dentry, ubifs_mknod() argument
775 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_mknod()
776 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_mknod()
789 dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino); ubifs_mknod()
804 inode = ubifs_new_inode(c, dir, mode); ubifs_mknod()
817 err = ubifs_init_security(dir, inode, &dentry->d_name); ubifs_mknod()
822 dir->i_size += sz_change; ubifs_mknod()
823 dir_ui->ui_size = dir->i_size; ubifs_mknod()
824 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_mknod()
825 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_mknod()
836 dir->i_size -= sz_change; ubifs_mknod()
837 dir_ui->ui_size = dir->i_size; ubifs_mknod()
847 static int ubifs_symlink(struct inode *dir, struct dentry *dentry, ubifs_symlink() argument
852 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_symlink()
853 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_symlink()
865 dbg_gen("dent '%pd', target '%s' in dir ino %lu", dentry, ubifs_symlink()
866 symname, dir->i_ino); ubifs_symlink()
875 inode = ubifs_new_inode(c, dir, S_IFLNK | S_IRWXUGO); ubifs_symlink()
899 err = ubifs_init_security(dir, inode, &dentry->d_name); ubifs_symlink()
904 dir->i_size += sz_change; ubifs_symlink()
905 dir_ui->ui_size = dir->i_size; ubifs_symlink()
906 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_symlink()
907 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_symlink()
918 dir->i_size -= sz_change; ubifs_symlink()
919 dir_ui->ui_size = dir->i_size; ubifs_symlink()
996 dbg_gen("dent '%pd' ino %lu in dir ino %lu to dent '%pd' in dir ino %lu", ubifs_rename()
/linux-4.4.14/fs/f2fs/
H A Ddir.c2 * fs/f2fs/dir.c
158 static struct f2fs_dir_entry *find_in_level(struct inode *dir, find_in_level() argument
175 f2fs_bug_on(F2FS_I_SB(dir), level > MAX_DIR_HASH_DEPTH); find_in_level()
177 nbucket = dir_buckets(level, F2FS_I(dir)->i_dir_level); find_in_level()
180 bidx = dir_block_index(level, F2FS_I(dir)->i_dir_level, find_in_level()
186 dentry_page = find_data_page(dir, bidx); find_in_level()
202 if (!de && room && F2FS_I(dir)->chash != namehash) { find_in_level()
203 F2FS_I(dir)->chash = namehash; find_in_level()
204 F2FS_I(dir)->clevel = level; find_in_level()
216 struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir, f2fs_find_entry() argument
219 unsigned long npages = dir_blocks(dir); f2fs_find_entry()
228 err = f2fs_fname_setup_filename(dir, child, 1, &fname); f2fs_find_entry()
232 if (f2fs_has_inline_dentry(dir)) { f2fs_find_entry()
233 de = find_in_inline_dir(dir, &fname, res_page); f2fs_find_entry()
240 max_depth = F2FS_I(dir)->i_current_depth; f2fs_find_entry()
243 de = find_in_level(dir, level, &fname, res_page); f2fs_find_entry()
252 struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p) f2fs_parent_dir() argument
258 if (f2fs_has_inline_dentry(dir)) f2fs_parent_dir()
259 return f2fs_parent_inline_dir(dir, p); f2fs_parent_dir()
261 page = get_lock_data_page(dir, 0, false); f2fs_parent_dir()
272 ino_t f2fs_inode_by_name(struct inode *dir, struct qstr *qstr) f2fs_inode_by_name() argument
278 de = f2fs_find_entry(dir, qstr, &page); f2fs_inode_by_name()
281 f2fs_dentry_kunmap(dir, page); f2fs_inode_by_name()
288 void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de, f2fs_set_link() argument
291 enum page_type type = f2fs_has_inline_dentry(dir) ? NODE : DATA; f2fs_set_link()
296 f2fs_dentry_kunmap(dir, page); f2fs_set_link()
298 dir->i_mtime = dir->i_ctime = CURRENT_TIME; f2fs_set_link()
299 mark_inode_dirty(dir); f2fs_set_link()
384 struct page *init_inode_metadata(struct inode *inode, struct inode *dir, init_inode_metadata() argument
396 err = make_empty_dir(inode, dir, page); init_inode_metadata()
401 err = f2fs_init_acl(inode, dir, page, dpage); init_inode_metadata()
405 err = f2fs_init_security(inode, dir, name, page); init_inode_metadata()
409 if (f2fs_encrypted_inode(dir) && f2fs_may_encrypt(inode)) { init_inode_metadata()
410 err = f2fs_inherit_context(dir, inode, page); init_inode_metadata()
415 page = get_node_page(F2FS_I_SB(dir), inode->i_ino); init_inode_metadata()
436 remove_orphan_inode(F2FS_I_SB(dir), inode->i_ino); init_inode_metadata()
452 void update_parent_metadata(struct inode *dir, struct inode *inode, update_parent_metadata() argument
457 inc_nlink(dir); update_parent_metadata()
458 set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); update_parent_metadata()
462 dir->i_mtime = dir->i_ctime = CURRENT_TIME; update_parent_metadata()
463 mark_inode_dirty(dir); update_parent_metadata()
465 if (F2FS_I(dir)->i_current_depth != current_depth) { update_parent_metadata()
466 F2FS_I(dir)->i_current_depth = current_depth; update_parent_metadata()
467 set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); update_parent_metadata()
516 int __f2fs_add_link(struct inode *dir, const struct qstr *name, __f2fs_add_link() argument
533 err = f2fs_fname_setup_filename(dir, name, 0, &fname); __f2fs_add_link()
540 if (f2fs_has_inline_dentry(dir)) { __f2fs_add_link()
541 err = f2fs_add_inline_entry(dir, &new_name, inode, ino, mode); __f2fs_add_link()
552 current_depth = F2FS_I(dir)->i_current_depth; __f2fs_add_link()
553 if (F2FS_I(dir)->chash == dentry_hash) { __f2fs_add_link()
554 level = F2FS_I(dir)->clevel; __f2fs_add_link()
555 F2FS_I(dir)->chash = 0; __f2fs_add_link()
568 nbucket = dir_buckets(level, F2FS_I(dir)->i_dir_level); __f2fs_add_link()
571 bidx = dir_block_index(level, F2FS_I(dir)->i_dir_level, __f2fs_add_link()
575 dentry_page = get_new_data_page(dir, NULL, block, true); __f2fs_add_link()
599 page = init_inode_metadata(inode, dir, &new_name, NULL); __f2fs_add_link()
604 if (f2fs_encrypted_inode(dir)) __f2fs_add_link()
615 F2FS_I(inode)->i_pino = dir->i_ino; __f2fs_add_link()
620 update_parent_metadata(dir, inode, current_depth); __f2fs_add_link()
625 if (is_inode_flag_set(F2FS_I(dir), FI_UPDATE_DIR)) { __f2fs_add_link()
626 update_inode_page(dir); __f2fs_add_link()
627 clear_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); __f2fs_add_link()
636 int f2fs_do_tmpfile(struct inode *inode, struct inode *dir) f2fs_do_tmpfile() argument
642 page = init_inode_metadata(inode, dir, NULL, NULL); f2fs_do_tmpfile()
657 void f2fs_drop_nlink(struct inode *dir, struct inode *inode, struct page *page) f2fs_drop_nlink() argument
659 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_drop_nlink()
664 drop_nlink(dir); f2fs_drop_nlink()
666 update_inode(dir, page); f2fs_drop_nlink()
668 update_inode_page(dir); f2fs_drop_nlink()
691 struct inode *dir, struct inode *inode) f2fs_delete_entry()
698 if (f2fs_has_inline_dentry(dir)) f2fs_delete_entry()
699 return f2fs_delete_inline_entry(dentry, page, dir, inode); f2fs_delete_entry()
716 dir->i_ctime = dir->i_mtime = CURRENT_TIME; f2fs_delete_entry()
719 f2fs_drop_nlink(dir, inode, NULL); f2fs_delete_entry()
722 !truncate_hole(dir, page->index, page->index + 1)) { f2fs_delete_entry()
726 inode_dec_dirty_pages(dir); f2fs_delete_entry()
731 bool f2fs_empty_dir(struct inode *dir) f2fs_empty_dir() argument
737 unsigned long nblock = dir_blocks(dir); f2fs_empty_dir()
739 if (f2fs_has_inline_dentry(dir)) f2fs_empty_dir()
740 return f2fs_empty_inline_dir(dir); f2fs_empty_dir()
743 dentry_page = get_lock_data_page(dir, bidx, false); f2fs_empty_dir()
851 /* readahead for multi pages of dir */ f2fs_readdir()
690 f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, struct inode *dir, struct inode *inode) f2fs_delete_entry() argument
H A Dnamei.c25 static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) f2fs_new_inode() argument
27 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_new_inode()
33 inode = new_inode(dir->i_sb); f2fs_new_inode()
45 inode_init_owner(inode, dir, mode); f2fs_new_inode()
60 if (f2fs_encrypted_inode(dir) && f2fs_may_encrypt(inode)) f2fs_new_inode()
123 static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode, f2fs_create() argument
126 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_create()
133 inode = f2fs_new_inode(dir, mode); f2fs_create()
156 if (IS_DIRSYNC(dir)) f2fs_create()
164 static int f2fs_link(struct dentry *old_dentry, struct inode *dir, f2fs_link() argument
168 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_link()
171 if (f2fs_encrypted_inode(dir) && f2fs_link()
172 !f2fs_is_child_context_consistent_with_parent(dir, inode)) f2fs_link()
189 if (IS_DIRSYNC(dir)) f2fs_link()
208 static int __recover_dot_dentries(struct inode *dir, nid_t pino) __recover_dot_dentries() argument
210 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); __recover_dot_dentries()
219 de = f2fs_find_entry(dir, &dot, &page); __recover_dot_dentries()
221 f2fs_dentry_kunmap(dir, page); __recover_dot_dentries()
224 err = __f2fs_add_link(dir, &dot, NULL, dir->i_ino, S_IFDIR); __recover_dot_dentries()
229 de = f2fs_find_entry(dir, &dotdot, &page); __recover_dot_dentries()
231 f2fs_dentry_kunmap(dir, page); __recover_dot_dentries()
234 err = __f2fs_add_link(dir, &dotdot, NULL, pino, S_IFDIR); __recover_dot_dentries()
238 clear_inode_flag(F2FS_I(dir), FI_INLINE_DOTS); __recover_dot_dentries()
239 mark_inode_dirty(dir); __recover_dot_dentries()
246 static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, f2fs_lookup() argument
258 de = f2fs_find_entry(dir, &dentry->d_name, &page); f2fs_lookup()
263 f2fs_dentry_kunmap(dir, page); f2fs_lookup()
266 inode = f2fs_iget(dir->i_sb, ino); f2fs_lookup()
271 err = __recover_dot_dentries(inode, dir->i_ino); f2fs_lookup()
282 static int f2fs_unlink(struct inode *dir, struct dentry *dentry) f2fs_unlink() argument
284 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_unlink()
290 trace_f2fs_unlink_enter(dir, dentry); f2fs_unlink()
293 de = f2fs_find_entry(dir, &dentry->d_name, &page); f2fs_unlink()
301 f2fs_dentry_kunmap(dir, page); f2fs_unlink()
305 f2fs_delete_entry(de, page, dir, inode); f2fs_unlink()
311 if (IS_DIRSYNC(dir)) f2fs_unlink()
329 static int f2fs_symlink(struct inode *dir, struct dentry *dentry, f2fs_symlink() argument
332 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_symlink()
341 if (len > dir->i_sb->s_blocksize) f2fs_symlink()
346 inode = f2fs_new_inode(dir, S_IFLNK | S_IRWXUGO); f2fs_symlink()
363 if (f2fs_encrypted_inode(dir)) { f2fs_symlink()
380 if (p_len > dir->i_sb->s_blocksize) { f2fs_symlink()
409 * Note that, it needs to do dir->fsync to make this recoverable. f2fs_symlink()
416 if (IS_DIRSYNC(dir)) f2fs_symlink()
419 f2fs_unlink(dir, dentry); f2fs_symlink()
430 static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) f2fs_mkdir() argument
432 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_mkdir()
438 inode = f2fs_new_inode(dir, S_IFDIR | mode); f2fs_mkdir()
459 if (IS_DIRSYNC(dir)) f2fs_mkdir()
469 static int f2fs_rmdir(struct inode *dir, struct dentry *dentry) f2fs_rmdir() argument
473 return f2fs_unlink(dir, dentry); f2fs_rmdir()
477 static int f2fs_mknod(struct inode *dir, struct dentry *dentry, f2fs_mknod() argument
480 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_mknod()
486 inode = f2fs_new_inode(dir, mode); f2fs_mknod()
504 if (IS_DIRSYNC(dir)) f2fs_mknod()
512 static int __f2fs_tmpfile(struct inode *dir, struct dentry *dentry, __f2fs_tmpfile() argument
515 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); __f2fs_tmpfile()
522 inode = f2fs_new_inode(dir, mode); __f2fs_tmpfile()
540 err = f2fs_do_tmpfile(inode, dir); __f2fs_tmpfile()
569 static int f2fs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) f2fs_tmpfile() argument
571 if (f2fs_encrypted_inode(dir)) { f2fs_tmpfile()
572 int err = f2fs_get_encryption_info(dir); f2fs_tmpfile()
577 return __f2fs_tmpfile(dir, dentry, mode, NULL); f2fs_tmpfile()
580 static int f2fs_create_whiteout(struct inode *dir, struct inode **whiteout) f2fs_create_whiteout() argument
582 return __f2fs_tmpfile(dir, NULL, S_IFCHR | WHITEOUT_MODE, whiteout); f2fs_create_whiteout()
832 /* update directory entry info of old dir inode */ f2fs_cross_rename()
853 /* update directory entry info of new dir inode */ f2fs_cross_rename()
H A DMakefile3 f2fs-y := dir.o file.o inode.o namei.o hash.o super.o inline.o
H A Dinline.c291 struct f2fs_dir_entry *find_in_inline_dir(struct inode *dir, find_in_inline_dir() argument
294 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); find_in_inline_dir()
302 ipage = get_node_page(sbi, dir->i_ino); find_in_inline_dir()
326 struct f2fs_dir_entry *f2fs_parent_inline_dir(struct inode *dir, f2fs_parent_inline_dir() argument
329 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_parent_inline_dir()
334 ipage = get_node_page(sbi, dir->i_ino); f2fs_parent_inline_dir()
370 static int f2fs_convert_inline_dir(struct inode *dir, struct page *ipage, f2fs_convert_inline_dir() argument
378 page = grab_cache_page(dir->i_mapping, 0); f2fs_convert_inline_dir()
384 set_new_dnode(&dn, dir, ipage, NULL, 0); f2fs_convert_inline_dir()
414 /* clear inline dir and flag after data writeback */ f2fs_convert_inline_dir()
417 stat_dec_inline_dir(dir); f2fs_convert_inline_dir()
418 clear_inode_flag(F2FS_I(dir), FI_INLINE_DENTRY); f2fs_convert_inline_dir()
420 if (i_size_read(dir) < PAGE_CACHE_SIZE) { f2fs_convert_inline_dir()
421 i_size_write(dir, PAGE_CACHE_SIZE); f2fs_convert_inline_dir()
422 set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); f2fs_convert_inline_dir()
431 int f2fs_add_inline_entry(struct inode *dir, const struct qstr *name, f2fs_add_inline_entry() argument
434 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_add_inline_entry()
445 ipage = get_node_page(sbi, dir->i_ino); f2fs_add_inline_entry()
453 err = f2fs_convert_inline_dir(dir, ipage, dentry_blk); f2fs_add_inline_entry()
462 page = init_inode_metadata(inode, dir, name, ipage); f2fs_add_inline_entry()
479 F2FS_I(inode)->i_pino = dir->i_ino; f2fs_add_inline_entry()
484 update_parent_metadata(dir, inode, 0); f2fs_add_inline_entry()
489 if (is_inode_flag_set(F2FS_I(dir), FI_UPDATE_DIR)) { f2fs_add_inline_entry()
490 update_inode(dir, ipage); f2fs_add_inline_entry()
491 clear_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); f2fs_add_inline_entry()
499 struct inode *dir, struct inode *inode) f2fs_delete_inline_entry()
517 dir->i_ctime = dir->i_mtime = CURRENT_TIME; f2fs_delete_inline_entry()
520 f2fs_drop_nlink(dir, inode, page); f2fs_delete_inline_entry()
525 bool f2fs_empty_inline_dir(struct inode *dir) f2fs_empty_inline_dir() argument
527 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_empty_inline_dir()
532 ipage = get_node_page(sbi, dir->i_ino); f2fs_empty_inline_dir()
498 f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page, struct inode *dir, struct inode *inode) f2fs_delete_inline_entry() argument
/linux-4.4.14/include/xen/
H A Dswiotlb-xen.h21 enum dma_data_direction dir,
25 size_t size, enum dma_data_direction dir,
29 int nelems, enum dma_data_direction dir,
34 int nelems, enum dma_data_direction dir,
39 size_t size, enum dma_data_direction dir);
43 int nelems, enum dma_data_direction dir);
47 size_t size, enum dma_data_direction dir);
51 int nelems, enum dma_data_direction dir);
/linux-4.4.14/arch/sh/kernel/
H A Ddma-nommu.c15 enum dma_data_direction dir, nommu_map_page()
21 dma_cache_sync(dev, page_address(page) + offset, size, dir); nommu_map_page()
27 int nents, enum dma_data_direction dir, nommu_map_sg()
38 dma_cache_sync(dev, sg_virt(s), s->length, dir); for_each_sg()
49 size_t size, enum dma_data_direction dir) nommu_sync_single()
51 dma_cache_sync(dev, phys_to_virt(addr), size, dir); nommu_sync_single()
55 int nelems, enum dma_data_direction dir) nommu_sync_sg()
61 dma_cache_sync(dev, sg_virt(s), s->length, dir); nommu_sync_sg()
13 nommu_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) nommu_map_page() argument
26 nommu_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) nommu_map_sg() argument
48 nommu_sync_single(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) nommu_sync_single() argument
54 nommu_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) nommu_sync_sg() argument
/linux-4.4.14/tools/power/cpupower/bench/
H A Dcpufreq-bench_plot.sh22 dir=`mktemp -d`
76 echo "set terminal $picture_type" >> $dir/plot_script.gpl
77 echo "set output \"$output_file\"" >> $dir/plot_script.gpl
78 echo "set title \"$global_title\"" >> $dir/plot_script.gpl
79 echo "set xlabel \"sleep/load time\"" >> $dir/plot_script.gpl
80 echo "set ylabel \"Performance (%)\"" >> $dir/plot_script.gpl
91 cat ${file[$plot]} |grep -v "^#" |awk '{printf "%lu %.1f\n",$2/1000, $6}' >$dir/data_$plot
94 echo -n "plot " >> $dir/plot_script.gpl
96 echo -n "\"$dir/data_$plot\" title \"${title[$plot]}\" with lines" >> $dir/plot_script.gpl
98 echo -n ", " >> $dir/plot_script.gpl
101 echo >> $dir/plot_script.gpl
103 gnuplot $dir/plot_script.gpl
104 rm -r $dir
/linux-4.4.14/fs/logfs/
H A Ddir.c2 * fs/logfs/dir.c - directory-related code
12 * Atomic dir operations
66 static int write_dir(struct inode *dir, struct logfs_disk_dentry *dd, write_dir() argument
69 return logfs_inode_write(dir, dd, sizeof(*dd), pos, WF_LOCK, NULL); write_dir()
157 static struct page *logfs_get_dd_page(struct inode *dir, struct dentry *dentry) logfs_get_dd_page() argument
172 if (beyond_eof(dir, index)) logfs_get_dd_page()
174 if (!logfs_exist_block(dir, index)) logfs_get_dd_page()
176 page = read_cache_page(dir->i_mapping, index, logfs_get_dd_page()
213 static int logfs_unlink(struct inode *dir, struct dentry *dentry) logfs_unlink() argument
215 struct logfs_super *super = logfs_super(dir->i_sb); logfs_unlink()
229 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; logfs_unlink()
231 page = logfs_get_dd_page(dir, dentry); logfs_unlink()
244 logfs_add_transaction(dir, ta); logfs_unlink()
246 ret = logfs_delete(dir, index, NULL); logfs_unlink()
248 ret = write_inode(dir); logfs_unlink()
251 abort_transaction(dir, ta); logfs_unlink()
264 static inline int logfs_empty_dir(struct inode *dir) logfs_empty_dir() argument
268 data = logfs_seek_data(dir, 0) << dir->i_sb->s_blocksize_bits; logfs_empty_dir()
269 return data >= i_size_read(dir); logfs_empty_dir()
272 static int logfs_rmdir(struct inode *dir, struct dentry *dentry) logfs_rmdir() argument
279 return logfs_unlink(dir, dentry); logfs_rmdir()
286 struct inode *dir = file_inode(file); logfs_readdir() local
301 if (beyond_eof(dir, pos)) logfs_readdir()
303 if (!logfs_exist_block(dir, pos)) { logfs_readdir()
305 pos = dir_seek_data(dir, pos); logfs_readdir()
308 page = read_cache_page(dir->i_mapping, pos, logfs_readdir()
332 static struct dentry *logfs_lookup(struct inode *dir, struct dentry *dentry, logfs_lookup() argument
341 page = logfs_get_dd_page(dir, dentry); logfs_lookup()
354 inode = logfs_iget(dir->i_sb, ino); logfs_lookup()
357 ino, dir->i_ino, index); logfs_lookup()
361 static void grow_dir(struct inode *dir, loff_t index) grow_dir() argument
363 index = (index + 1) << dir->i_sb->s_blocksize_bits; grow_dir()
364 if (i_size_read(dir) < index) grow_dir()
365 i_size_write(dir, index); grow_dir()
368 static int logfs_write_dir(struct inode *dir, struct dentry *dentry, logfs_write_dir() argument
380 if (logfs_exist_block(dir, index)) logfs_write_dir()
382 page = find_or_create_page(dir->i_mapping, index, GFP_KERNEL); logfs_write_dir()
393 err = logfs_write_buf(dir, page, WF_LOCK); logfs_write_dir()
397 grow_dir(dir, index); logfs_write_dir()
407 static int __logfs_create(struct inode *dir, struct dentry *dentry, __logfs_create() argument
410 struct logfs_super *super = logfs_super(dir->i_sb); __logfs_create()
446 logfs_add_transaction(dir, ta); __logfs_create()
447 ret = logfs_write_dir(dir, dentry, inode); __logfs_create()
450 ret = write_inode(dir); __logfs_create()
453 logfs_del_transaction(dir, ta); __logfs_create()
466 static int logfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) logfs_mkdir() argument
475 inode = logfs_new_inode(dir, S_IFDIR | mode); logfs_mkdir()
482 return __logfs_create(dir, dentry, inode, NULL, 0); logfs_mkdir()
485 static int logfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, logfs_create() argument
490 inode = logfs_new_inode(dir, mode); logfs_create()
498 return __logfs_create(dir, dentry, inode, NULL, 0); logfs_create()
501 static int logfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, logfs_mknod() argument
509 inode = logfs_new_inode(dir, mode); logfs_mknod()
515 return __logfs_create(dir, dentry, inode, NULL, 0); logfs_mknod()
518 static int logfs_symlink(struct inode *dir, struct dentry *dentry, logfs_symlink() argument
524 if (destlen > dir->i_sb->s_blocksize) logfs_symlink()
527 inode = logfs_new_inode(dir, S_IFLNK | 0777); logfs_symlink()
534 return __logfs_create(dir, dentry, inode, target, destlen); logfs_symlink()
537 static int logfs_link(struct dentry *old_dentry, struct inode *dir, logfs_link() argument
542 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; logfs_link()
547 return __logfs_create(dir, dentry, inode, NULL, 0); logfs_link()
550 static int logfs_get_dd(struct inode *dir, struct dentry *dentry, logfs_get_dd() argument
556 page = logfs_get_dd_page(dir, dentry); logfs_get_dd()
567 static int logfs_delete_dd(struct inode *dir, loff_t pos) logfs_delete_dd() argument
574 BUG_ON(beyond_eof(dir, pos)); logfs_delete_dd()
575 dir->i_ctime = dir->i_mtime = CURRENT_TIME; logfs_delete_dd()
576 log_dir(" Delete dentry (%lx, %llx)\n", dir->i_ino, pos); logfs_delete_dd()
577 return logfs_delete(dir, pos, NULL); logfs_delete_dd()
582 * Create a new dentry in the target dir, then remove the old dentry,
604 ta->dir = old_dir->i_ino; logfs_rename_cross()
633 static int logfs_replace_inode(struct inode *dir, struct dentry *dentry, logfs_replace_inode() argument
639 err = logfs_get_dd(dir, dentry, dd, &pos); logfs_replace_inode()
645 err = write_dir(dir, dd, pos); logfs_replace_inode()
648 log_dir("Replace dentry (%lx, %llx) %s -> %llx\n", dir->i_ino, pos, logfs_replace_inode()
650 return write_inode(dir); logfs_replace_inode()
685 ta->dir = old_dir->i_ino; logfs_rename_target()
/linux-4.4.14/scripts/
H A Dobjdiff46 dir=${1%/*}
48 if [ "$dir" = "$1" ]; then
49 dir=.
52 dir=$(cd $dir; pwd)
54 echo $TMPD/$CMT${dir#$SRCTREE}
58 dir=$(get_output_dir $1)
60 dis=$dir/${base%.o}.dis
62 [ ! -d "$dir" ] && mkdir -p $dir
H A Dheaders_check.pl5 # Usage: headers_check.pl dir arch [files...]
6 # dir: dir to look for included files
24 my ($dir, $arch, @files) = @ARGV;
54 $found = stat($dir . "/" . $inc);
57 $found = stat($dir . "/" . $inc);
114 my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path);
/linux-4.4.14/arch/c6x/include/asm/
H A Ddma-mapping.h24 enum dma_data_direction dir) dma_sync_single_range_for_device()
48 size_t size, enum dma_data_direction dir);
51 size_t size, enum dma_data_direction dir);
61 enum dma_data_direction dir) dma_map_page()
65 handle = dma_map_single(dev, page_address(page) + offset, size, dir); dma_map_page()
67 debug_dma_map_page(dev, page, offset, size, dir, handle, false); dma_map_page()
73 size_t size, enum dma_data_direction dir) dma_unmap_page()
75 dma_unmap_single(dev, handle, size, dir); dma_unmap_page()
77 debug_dma_unmap_page(dev, handle, size, dir, false); dma_unmap_page()
81 size_t size, enum dma_data_direction dir);
85 enum dma_data_direction dir);
88 int nents, enum dma_data_direction dir);
91 int nents, enum dma_data_direction dir);
20 dma_sync_single_range_for_device(struct device *dev, dma_addr_t addr, unsigned long offset, size_t size, enum dma_data_direction dir) dma_sync_single_range_for_device() argument
59 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
72 dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
/linux-4.4.14/include/linux/
H A Dswiotlb.h45 enum dma_data_direction dir);
49 size_t size, enum dma_data_direction dir);
53 size_t size, enum dma_data_direction dir,
67 enum dma_data_direction dir,
70 size_t size, enum dma_data_direction dir,
75 enum dma_data_direction dir);
79 enum dma_data_direction dir);
83 enum dma_data_direction dir, struct dma_attrs *attrs);
87 int nelems, enum dma_data_direction dir,
92 size_t size, enum dma_data_direction dir);
96 int nelems, enum dma_data_direction dir);
100 size_t size, enum dma_data_direction dir);
104 int nelems, enum dma_data_direction dir);
H A Ddma-mapping.h33 enum dma_data_direction dir,
36 size_t size, enum dma_data_direction dir,
43 int nents, enum dma_data_direction dir,
47 enum dma_data_direction dir,
51 enum dma_data_direction dir);
54 enum dma_data_direction dir);
57 enum dma_data_direction dir);
60 enum dma_data_direction dir);
265 #define dma_map_single_attrs(dev, cpu_addr, size, dir, attrs) \
266 dma_map_single(dev, cpu_addr, size, dir)
268 #define dma_unmap_single_attrs(dev, dma_addr, size, dir, attrs) \
269 dma_unmap_single(dev, dma_addr, size, dir)
271 #define dma_map_sg_attrs(dev, sgl, nents, dir, attrs) \
272 dma_map_sg(dev, sgl, nents, dir)
274 #define dma_unmap_sg_attrs(dev, sgl, nents, dir, attrs) \
275 dma_unmap_sg(dev, sgl, nents, dir)
H A Dramfs.h4 struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
/linux-4.4.14/arch/xtensa/kernel/
H A Dpci-dma.c29 enum dma_data_direction dir) dma_cache_sync()
31 switch (dir) { dma_cache_sync()
75 enum dma_data_direction dir) xtensa_sync_single_for_cpu()
77 switch (dir) { xtensa_sync_single_for_cpu()
94 enum dma_data_direction dir) xtensa_sync_single_for_device()
96 switch (dir) { xtensa_sync_single_for_device()
114 enum dma_data_direction dir) xtensa_sync_sg_for_cpu()
121 sg_dma_len(s), dir); for_each_sg()
127 enum dma_data_direction dir) xtensa_sync_sg_for_device()
134 sg_dma_len(s), dir); for_each_sg()
187 enum dma_data_direction dir, xtensa_map_page()
192 xtensa_sync_single_for_device(dev, dma_handle, size, dir); xtensa_map_page()
197 size_t size, enum dma_data_direction dir, xtensa_unmap_page()
200 xtensa_sync_single_for_cpu(dev, dma_handle, size, dir); xtensa_unmap_page()
204 int nents, enum dma_data_direction dir, xtensa_map_sg()
212 s->length, dir, attrs); for_each_sg()
219 enum dma_data_direction dir, xtensa_unmap_sg()
227 sg_dma_len(s), dir, attrs); for_each_sg()
28 dma_cache_sync(struct device *dev, void *vaddr, size_t size, enum dma_data_direction dir) dma_cache_sync() argument
73 xtensa_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) xtensa_sync_single_for_cpu() argument
92 xtensa_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) xtensa_sync_single_for_device() argument
112 xtensa_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) xtensa_sync_sg_for_cpu() argument
125 xtensa_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) xtensa_sync_sg_for_device() argument
185 xtensa_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xtensa_map_page() argument
196 xtensa_unmap_page(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xtensa_unmap_page() argument
203 xtensa_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) xtensa_map_sg() argument
217 xtensa_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) xtensa_unmap_sg() argument
/linux-4.4.14/arch/um/os-Linux/
H A Dumid.c30 char dir[512] = { '\0' }; make_uml_dir() local
42 strlcpy(dir, home, sizeof(dir)); make_uml_dir()
45 strlcat(dir, uml_dir, sizeof(dir)); make_uml_dir()
46 len = strlen(dir); make_uml_dir()
47 if (len > 0 && dir[len - 1] != '/') make_uml_dir()
48 strlcat(dir, "/", sizeof(dir)); make_uml_dir()
51 uml_dir = malloc(strlen(dir) + 1); make_uml_dir()
56 strcpy(uml_dir, dir); make_uml_dir()
73 * Unlinks the files contained in @dir and then removes @dir.
78 static int remove_files_and_dir(char *dir) remove_files_and_dir() argument
86 directory = opendir(dir); remove_files_and_dir()
97 len = strlen(dir) + sizeof("/") + strlen(ent->d_name) + 1; remove_files_and_dir()
103 sprintf(file, "%s/%s", dir, ent->d_name); remove_files_and_dir()
110 if (rmdir(dir) < 0 && errno != ENOENT) { remove_files_and_dir()
133 static inline int is_umdir_used(char *dir) is_umdir_used() argument
139 n = snprintf(file, sizeof(file), "%s/pid", dir); is_umdir_used()
189 * Try to remove the directory @dir unless it's in use.
190 * Precondition: @dir exists.
194 static int umdir_take_if_dead(char *dir) umdir_take_if_dead() argument
197 if (is_umdir_used(dir)) umdir_take_if_dead()
200 ret = remove_files_and_dir(dir); umdir_take_if_dead()
385 char dir[strlen(uml_dir) + UMID_LEN + 1], err; remove_umid_dir() local
387 sprintf(dir, "%s%s", uml_dir, umid); remove_umid_dir()
388 err = remove_files_and_dir(dir); remove_umid_dir()
H A Dmem.c23 /* Check if dir is on tmpfs. Return 0 if yes, -1 if no or error. */ check_tmpfs()
24 static int __init check_tmpfs(const char *dir) check_tmpfs() argument
28 printf("Checking if %s is on tmpfs...", dir); check_tmpfs()
29 if (statfs(dir, &st) < 0) { check_tmpfs()
62 const char *dir; choose_tempdir() local
66 dir = getenv(vars[i]); choose_tempdir()
67 if ((dir != NULL) && (*dir != '\0')) { choose_tempdir()
68 printf("%s\n", dir); choose_tempdir()
69 if (check_tmpfs(dir) >= 0) choose_tempdir()
78 dir = tmpfs_dirs[i]; choose_tempdir()
79 if (check_tmpfs(dir) >= 0) choose_tempdir()
83 dir = fallback_dir; choose_tempdir()
85 printf("Warning: tempdir %s is not on tmpfs\n", dir); choose_tempdir()
88 return strdup(dir); choose_tempdir()
/linux-4.4.14/arch/mips/oprofile/
H A Dcommon.c43 struct dentry *dir; op_mips_create_files() local
47 dir = oprofilefs_mkdir(root, buf); op_mips_create_files()
49 oprofilefs_create_ulong(dir, "enabled", &ctr[i].enabled); op_mips_create_files()
50 oprofilefs_create_ulong(dir, "event", &ctr[i].event); op_mips_create_files()
51 oprofilefs_create_ulong(dir, "count", &ctr[i].count); op_mips_create_files()
52 oprofilefs_create_ulong(dir, "kernel", &ctr[i].kernel); op_mips_create_files()
53 oprofilefs_create_ulong(dir, "user", &ctr[i].user); op_mips_create_files()
54 oprofilefs_create_ulong(dir, "exl", &ctr[i].exl); op_mips_create_files()
56 oprofilefs_create_ulong(dir, "unit_mask", &ctr[i].unit_mask); op_mips_create_files()
/linux-4.4.14/arch/m68k/kernel/
H A Ddma.c105 size_t size, enum dma_data_direction dir) dma_sync_single_for_device()
107 switch (dir) { dma_sync_single_for_device()
117 printk("dma_sync_single_for_device: unsupported dir %u\n", dir); dma_sync_single_for_device()
124 int nents, enum dma_data_direction dir) dma_sync_sg_for_device()
131 dir); for_each_sg()
137 enum dma_data_direction dir) dma_map_single()
141 dma_sync_single_for_device(dev, handle, size, dir); dma_map_single()
148 enum dma_data_direction dir) dma_map_page()
152 dma_sync_single_for_device(dev, handle, size, dir); dma_map_page()
158 enum dma_data_direction dir) dma_map_sg()
166 dir); for_each_sg()
104 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_device() argument
123 dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction dir) dma_sync_sg_for_device() argument
136 dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction dir) dma_map_single() argument
146 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
157 dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents, enum dma_data_direction dir) dma_map_sg() argument
/linux-4.4.14/tools/build/
H A DMakefile2 srctree := $(patsubst %/,%,$(dir $(shell pwd)))
3 srctree := $(patsubst %/,%,$(dir $(srctree)))
26 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
/linux-4.4.14/fs/isofs/
H A Dnamei.c35 isofs_find_entry(struct inode *dir, struct dentry *dentry, isofs_find_entry() argument
39 unsigned long bufsize = ISOFS_BUFFER_SIZE(dir); isofs_find_entry()
40 unsigned char bufbits = ISOFS_BUFFER_BITS(dir); isofs_find_entry()
43 struct isofs_sb_info *sbi = ISOFS_SB(dir->i_sb); isofs_find_entry()
45 if (!ISOFS_I(dir)->i_first_extent) isofs_find_entry()
52 while (f_pos < dir->i_size) { isofs_find_entry()
58 bh = isofs_bread(dir, block); isofs_find_entry()
89 bh = isofs_bread(dir, block); isofs_find_entry()
99 /* Basic sanity check, whether name doesn't exceed dir entry */ isofs_find_entry()
103 dir->i_ino); isofs_find_entry()
108 ((i = get_rock_ridge_filename(de, tmpname, dir)))) { isofs_find_entry()
113 dlen = get_joliet_filename(de, tmpname, dir); isofs_find_entry()
117 dlen = get_acorn_filename(de, tmpname, dir); isofs_find_entry()
120 dlen = isofs_name_translate(de, tmpname, dir); isofs_find_entry()
151 struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) isofs_lookup() argument
163 found = isofs_find_entry(dir, dentry, isofs_lookup()
169 inode = found ? isofs_iget(dir->i_sb, block, offset) : NULL; isofs_lookup()
H A DMakefile7 isofs-objs-y := namei.o inode.o dir.o util.o rock.o export.o
/linux-4.4.14/fs/reiserfs/
H A Dnamei.c304 static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen, reiserfs_find_entry() argument
311 if (namelen > REISERFS_MAX_NAME(dir->i_sb->s_blocksize)) reiserfs_find_entry()
315 make_cpu_key(&key_to_search, dir, reiserfs_find_entry()
316 get_third_component(dir->i_sb, name, namelen), reiserfs_find_entry()
321 search_by_entry_key(dir->i_sb, &key_to_search, reiserfs_find_entry()
324 reiserfs_error(dir->i_sb, "zam-7001", "io error"); reiserfs_find_entry()
352 static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry, reiserfs_lookup() argument
360 if (REISERFS_MAX_NAME(dir->i_sb->s_blocksize) < dentry->d_name.len) reiserfs_lookup()
363 reiserfs_write_lock(dir->i_sb); reiserfs_lookup()
367 reiserfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, reiserfs_lookup()
371 inode = reiserfs_iget(dir->i_sb, reiserfs_lookup()
374 reiserfs_write_unlock(dir->i_sb); reiserfs_lookup()
382 if (IS_PRIVATE(dir)) reiserfs_lookup()
385 reiserfs_write_unlock(dir->i_sb); reiserfs_lookup()
403 struct inode *dir = d_inode(child); reiserfs_get_parent() local
405 if (dir->i_nlink == 0) { reiserfs_get_parent()
410 reiserfs_write_lock(dir->i_sb); reiserfs_get_parent()
411 retval = reiserfs_find_entry(dir, "..", 2, &path_to_entry, &de); reiserfs_get_parent()
414 reiserfs_write_unlock(dir->i_sb); reiserfs_get_parent()
417 inode = reiserfs_iget(dir->i_sb, (struct cpu_key *)&de.de_dir_id); reiserfs_get_parent()
418 reiserfs_write_unlock(dir->i_sb); reiserfs_get_parent()
427 Does not mark dir inode dirty, do it after successesfull call to it */
430 struct inode *dir, const char *name, int namelen, reiserfs_add_entry()
456 if (namelen > REISERFS_MAX_NAME(dir->i_sb->s_blocksize)) reiserfs_add_entry()
460 make_cpu_key(&entry_key, dir, reiserfs_add_entry()
461 get_third_component(dir->i_sb, name, namelen), reiserfs_add_entry()
474 (get_inode_sd_version(dir) == reiserfs_add_entry()
478 * fill buffer : directory entry head, name[, dir objectid | , reiserfs_add_entry()
479 * stat data | ,stat data, dir objectid ] reiserfs_add_entry()
507 retval = reiserfs_find_entry(dir, name, namelen, &path, &de); reiserfs_add_entry()
518 reiserfs_error(dir->i_sb, "zam-7002", reiserfs_add_entry()
531 reiserfs_warning(dir->i_sb, "reiserfs-7010", reiserfs_add_entry()
548 if (search_by_entry_key(dir->i_sb, &entry_key, &path, &de) != reiserfs_add_entry()
550 reiserfs_warning(dir->i_sb, "vs-7032", reiserfs_add_entry()
563 reiserfs_paste_into_item(th, &path, &entry_key, dir, buffer, reiserfs_add_entry()
572 dir->i_size += paste_size; reiserfs_add_entry()
573 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; reiserfs_add_entry()
576 reiserfs_update_sd(th, dir); reiserfs_add_entry()
603 static int new_inode_init(struct inode *inode, struct inode *dir, umode_t mode) new_inode_init() argument
615 inode_init_owner(inode, dir, mode); new_inode_init()
619 static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, reiserfs_create() argument
630 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + reiserfs_create()
631 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); reiserfs_create()
635 retval = dquot_initialize(dir); reiserfs_create()
639 if (!(inode = new_inode(dir->i_sb))) { reiserfs_create()
642 retval = new_inode_init(inode, dir, mode); reiserfs_create()
648 jbegin_count += reiserfs_cache_default_acl(dir); reiserfs_create()
649 retval = reiserfs_security_init(dir, inode, &dentry->d_name, &security); reiserfs_create()
655 reiserfs_write_lock(dir->i_sb); reiserfs_create()
657 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_create()
664 reiserfs_new_inode(&th, dir, mode, NULL, 0 /*i_size */ , dentry, reiserfs_create()
674 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_create()
688 reiserfs_update_inode_transaction(dir); reiserfs_create()
695 reiserfs_write_unlock(dir->i_sb); reiserfs_create()
699 static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, reiserfs_mknod() argument
712 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + reiserfs_mknod()
713 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); reiserfs_mknod()
715 retval = dquot_initialize(dir); reiserfs_mknod()
719 if (!(inode = new_inode(dir->i_sb))) { reiserfs_mknod()
722 retval = new_inode_init(inode, dir, mode); reiserfs_mknod()
728 jbegin_count += reiserfs_cache_default_acl(dir); reiserfs_mknod()
729 retval = reiserfs_security_init(dir, inode, &dentry->d_name, &security); reiserfs_mknod()
735 reiserfs_write_lock(dir->i_sb); reiserfs_mknod()
737 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_mknod()
744 reiserfs_new_inode(&th, dir, mode, NULL, 0 /*i_size */ , dentry, reiserfs_mknod()
757 reiserfs_update_inode_transaction(dir); reiserfs_mknod()
760 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_mknod()
779 reiserfs_write_unlock(dir->i_sb); reiserfs_mknod()
783 static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) reiserfs_mkdir() argument
795 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + reiserfs_mkdir()
796 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); reiserfs_mkdir()
798 retval = dquot_initialize(dir); reiserfs_mkdir()
807 REISERFS_I(dir)->new_packing_locality = 1; reiserfs_mkdir()
810 if (!(inode = new_inode(dir->i_sb))) { reiserfs_mkdir()
813 retval = new_inode_init(inode, dir, mode); reiserfs_mkdir()
819 jbegin_count += reiserfs_cache_default_acl(dir); reiserfs_mkdir()
820 retval = reiserfs_security_init(dir, inode, &dentry->d_name, &security); reiserfs_mkdir()
826 reiserfs_write_lock(dir->i_sb); reiserfs_mkdir()
828 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_mkdir()
838 INC_DIR_INODE_NLINK(dir) reiserfs_mkdir()
840 retval = reiserfs_new_inode(&th, dir, mode, NULL /*symlink */ , reiserfs_mkdir()
841 old_format_only(dir->i_sb) ? reiserfs_mkdir()
845 DEC_DIR_INODE_NLINK(dir) reiserfs_mkdir()
850 reiserfs_update_inode_transaction(dir); reiserfs_mkdir()
855 /* note, _this_ add_entry will not update dir's stat data */ reiserfs_mkdir()
857 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_mkdir()
862 DEC_DIR_INODE_NLINK(dir); reiserfs_mkdir()
871 /* the above add_entry did not update dir's stat data */ reiserfs_mkdir()
872 reiserfs_update_sd(&th, dir); reiserfs_mkdir()
878 reiserfs_write_unlock(dir->i_sb); reiserfs_mkdir()
885 * we can cheat because an old format dir cannot have reiserfs_empty_dir()
886 * EMPTY_DIR_SIZE, and a new format dir cannot have reiserfs_empty_dir()
897 static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) reiserfs_rmdir() argument
914 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); reiserfs_rmdir()
916 retval = dquot_initialize(dir); reiserfs_rmdir()
920 reiserfs_write_lock(dir->i_sb); reiserfs_rmdir()
921 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_rmdir()
927 reiserfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, reiserfs_rmdir()
939 reiserfs_update_inode_transaction(dir); reiserfs_rmdir()
953 /* cut entry from dir directory */ reiserfs_rmdir()
955 dir, NULL, /* page */ reiserfs_rmdir()
966 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; reiserfs_rmdir()
969 DEC_DIR_INODE_NLINK(dir) reiserfs_rmdir()
970 dir->i_size -= (DEH_SIZE + de.de_entrylen); reiserfs_rmdir()
971 reiserfs_update_sd(&th, dir); reiserfs_rmdir()
979 reiserfs_write_unlock(dir->i_sb); reiserfs_rmdir()
990 reiserfs_write_unlock(dir->i_sb); reiserfs_rmdir()
994 static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) reiserfs_unlink() argument
1004 retval = dquot_initialize(dir); reiserfs_unlink()
1019 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); reiserfs_unlink()
1021 reiserfs_write_lock(dir->i_sb); reiserfs_unlink()
1022 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_unlink()
1028 reiserfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, reiserfs_unlink()
1038 reiserfs_update_inode_transaction(dir); reiserfs_unlink()
1064 reiserfs_cut_from_item(&th, &path, &de.de_entry_key, dir, NULL, reiserfs_unlink()
1073 dir->i_size -= (de.de_entrylen + DEH_SIZE); reiserfs_unlink()
1074 dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; reiserfs_unlink()
1075 reiserfs_update_sd(&th, dir); reiserfs_unlink()
1083 reiserfs_write_unlock(dir->i_sb); reiserfs_unlink()
1093 reiserfs_write_unlock(dir->i_sb); reiserfs_unlink()
1197 static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, reiserfs_link() argument
1209 2 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); reiserfs_link()
1211 retval = dquot_initialize(dir); reiserfs_link()
1215 reiserfs_write_lock(dir->i_sb); reiserfs_link()
1218 reiserfs_write_unlock(dir->i_sb); reiserfs_link()
1225 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_link()
1228 reiserfs_write_unlock(dir->i_sb); reiserfs_link()
1234 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_link()
1238 reiserfs_update_inode_transaction(dir); reiserfs_link()
1244 reiserfs_write_unlock(dir->i_sb); reiserfs_link()
1254 reiserfs_write_unlock(dir->i_sb); reiserfs_link()
429 reiserfs_add_entry(struct reiserfs_transaction_handle *th, struct inode *dir, const char *name, int namelen, struct inode *inode, int visible) reiserfs_add_entry() argument
/linux-4.4.14/drivers/staging/lustre/lustre/llite/
H A DMakefile3 lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \
H A Dnamei.c143 static void ll_invalidate_negative_children(struct inode *dir) ll_invalidate_negative_children() argument
147 ll_lock_dcache(dir); ll_invalidate_negative_children()
148 hlist_for_each_entry(dentry, &dir->i_dentry, d_u.d_alias) { ll_invalidate_negative_children()
162 ll_unlock_dcache(dir); ll_invalidate_negative_children()
496 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),intent=%s\n", ll_lookup_it()
574 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),flags=%u\n", ll_lookup_nd()
598 static int ll_atomic_open(struct inode *dir, struct dentry *dentry, ll_atomic_open() argument
608 "VFS Op:name=%pd,dir=%lu/%u(%p),file %p,open_flags %x,mode %x opened %d\n", ll_atomic_open()
609 dentry, dir->i_ino, ll_atomic_open()
610 dir->i_generation, dir, file, open_flags, mode, *opened); ll_atomic_open()
625 de = ll_lookup_it(dir, dentry, it, lookup_flags); ll_atomic_open()
634 rc = ll_create_it(dir, dentry, mode, it); ll_atomic_open()
677 static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it) ll_create_node() argument
681 struct ll_sb_info *sbi = ll_i2sbi(dir); ll_create_node()
689 rc = ll_prep_inode(&inode, request, dir->i_sb, it); ll_create_node()
722 static int ll_create_it(struct inode *dir, struct dentry *dentry, int mode, ll_create_it() argument
728 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),intent=%s\n", ll_create_it()
729 dentry, dir->i_ino, ll_create_it()
730 dir->i_generation, dir, LL_IT2STR(it)); ll_create_it()
736 inode = ll_create_node(dir, it); ll_create_it()
762 static int ll_new_node(struct inode *dir, struct dentry *dentry, ll_new_node() argument
769 struct ll_sb_info *sbi = ll_i2sbi(dir); ll_new_node()
776 op_data = ll_prep_md_op_data(NULL, dir, NULL, ll_new_node()
793 ll_update_times(request, dir); ll_new_node()
795 err = ll_prep_inode(&inode, request, dir->i_sb, NULL); ll_new_node()
806 static int ll_mknod(struct inode *dir, struct dentry *dchild, ll_mknod() argument
811 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p) mode %o dev %x\n", ll_mknod()
812 dchild, dir->i_ino, dir->i_generation, dir, ll_mknod()
815 if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir))) ll_mknod()
826 err = ll_new_node(dir, dchild, NULL, mode, ll_mknod()
838 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKNOD, 1); ll_mknod()
846 static int ll_create_nd(struct inode *dir, struct dentry *dentry, ll_create_nd() argument
851 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),flags=%u, excl=%d\n", ll_create_nd()
852 dentry, dir->i_ino, ll_create_nd()
853 dir->i_generation, dir, mode, want_excl); ll_create_nd()
855 rc = ll_mknod(dir, dentry, mode, 0); ll_create_nd()
857 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_CREATE, 1); ll_create_nd()
871 int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir) ll_objects_destroy() argument
899 rc = obd_unpackmd(ll_i2dtexp(dir), &lsm, eadata, body->eadatasize); ll_objects_destroy()
929 rc = obd_destroy(NULL, ll_i2dtexp(dir), oa, lsm, &oti, ll_objects_destroy()
930 ll_i2mdexp(dir)); ll_objects_destroy()
935 obd_free_memmd(ll_i2dtexp(dir), &lsm); ll_objects_destroy()
945 static int ll_unlink(struct inode *dir, struct dentry *dentry) ll_unlink() argument
951 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p)\n", ll_unlink()
952 dentry, dir->i_ino, dir->i_generation, dir); ll_unlink()
954 op_data = ll_prep_md_op_data(NULL, dir, NULL, ll_unlink()
963 rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); ll_unlink()
968 ll_update_times(request, dir); ll_unlink()
969 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_UNLINK, 1); ll_unlink()
971 rc = ll_objects_destroy(request, dir); ll_unlink()
977 static int ll_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ll_mkdir() argument
981 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p)\n", ll_mkdir()
982 dentry, dir->i_ino, dir->i_generation, dir); ll_mkdir()
984 if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir))) ll_mkdir()
987 err = ll_new_node(dir, dentry, NULL, mode, 0, LUSTRE_OPC_MKDIR); ll_mkdir()
990 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKDIR, 1); ll_mkdir()
995 static int ll_rmdir(struct inode *dir, struct dentry *dentry) ll_rmdir() argument
1001 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p)\n", ll_rmdir()
1002 dentry, dir->i_ino, dir->i_generation, dir); ll_rmdir()
1004 op_data = ll_prep_md_op_data(NULL, dir, NULL, ll_rmdir()
1013 rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); ll_rmdir()
1016 ll_update_times(request, dir); ll_rmdir()
1017 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1); ll_rmdir()
1024 static int ll_symlink(struct inode *dir, struct dentry *dentry, ll_symlink() argument
1029 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),target=%.*s\n", ll_symlink()
1030 dentry, dir->i_ino, dir->i_generation, ll_symlink()
1031 dir, 3000, oldname); ll_symlink()
1033 err = ll_new_node(dir, dentry, oldname, S_IFLNK | S_IRWXUGO, ll_symlink()
1037 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_SYMLINK, 1); ll_symlink()
1042 static int ll_link(struct dentry *old_dentry, struct inode *dir, ll_link() argument
1046 struct ll_sb_info *sbi = ll_i2sbi(dir); ll_link()
1052 "VFS Op: inode=%lu/%u(%p), dir=%lu/%u(%p), target=%pd\n", ll_link()
1053 src->i_ino, src->i_generation, src, dir->i_ino, ll_link()
1054 dir->i_generation, dir, new_dentry); ll_link()
1056 op_data = ll_prep_md_op_data(NULL, src, dir, new_dentry->d_name.name, ll_link()
1067 ll_update_times(request, dir); ll_link()
H A Dllite_nfs.c230 struct inode *dir = d_inode(dentry); ll_get_name() local
238 if (!dir || !S_ISDIR(dir->i_mode)) { ll_get_name()
243 if (!dir->i_fop) { ll_get_name()
248 mutex_lock(&dir->i_mutex); ll_get_name()
249 rc = ll_dir_read(dir, &lgd.ctx); ll_get_name()
250 mutex_unlock(&dir->i_mutex); ll_get_name()
282 struct inode *dir = d_inode(dchild); ll_get_parent() local
291 LASSERT(dir && S_ISDIR(dir->i_mode)); ll_get_parent()
293 sbi = ll_s2sbi(dir->i_sb); ll_get_parent()
296 dir->i_ino, PFID(ll_inode2fid(dir))); ll_get_parent()
302 op_data = ll_prep_md_op_data(NULL, dir, NULL, dotdot, ll_get_parent()
311 CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino); ll_get_parent()
318 PFID(ll_inode2fid(dir)), PFID(&body->fid1)); ll_get_parent()
320 result = ll_iget_for_nfs(dir->i_sb, &body->fid1, NULL); ll_get_parent()
/linux-4.4.14/arch/x86/include/asm/xen/
H A Dpage-coherent.h26 enum dma_data_direction dir, struct dma_attrs *attrs) { }
29 size_t size, enum dma_data_direction dir, xen_dma_unmap_page()
33 dma_addr_t handle, size_t size, enum dma_data_direction dir) { }
36 dma_addr_t handle, size_t size, enum dma_data_direction dir) { }
24 xen_dma_map_page(struct device *hwdev, struct page *page, dma_addr_t dev_addr, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_map_page() argument
28 xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_dma_unmap_page() argument
32 xen_dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_cpu() argument
35 xen_dma_sync_single_for_device(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_device() argument
/linux-4.4.14/arch/alpha/include/asm/
H A Ddma-mapping.h15 #define dma_cache_sync(dev, va, size, dir) ((void)0)
/linux-4.4.14/fs/gfs2/
H A DMakefile3 gfs2-y := acl.o bmap.o dir.o xattr.o glock.o \
/linux-4.4.14/fs/hfsplus/
H A DMakefile7 hfsplus-objs := super.o options.o inode.o ioctl.o extents.o catalog.o dir.o btree.o \
H A Dxattr_security.c66 int hfsplus_init_security(struct inode *inode, struct inode *dir, hfsplus_init_security() argument
69 return security_inode_init_security(inode, dir, qstr, hfsplus_init_security()
74 struct inode *dir, hfsplus_init_inode_security()
79 err = hfsplus_init_posix_acl(inode, dir); hfsplus_init_inode_security()
81 err = hfsplus_init_security(inode, dir, qstr); hfsplus_init_inode_security()
73 hfsplus_init_inode_security(struct inode *inode, struct inode *dir, const struct qstr *qstr) hfsplus_init_inode_security() argument
H A Ddir.c2 * linux/fs/hfsplus/dir.c
29 /* Find the entry inside dir named dentry->d_name */ hfsplus_lookup()
30 static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry, hfsplus_lookup() argument
41 sb = dir->i_sb; hfsplus_lookup()
47 err = hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, hfsplus_lookup()
118 inode = hfsplus_iget(dir->i_sb, cnid); hfsplus_lookup()
194 pr_err("walked past end of dir\n"); hfsplus_readdir()
214 pr_err("small dir entry\n"); hfsplus_readdir()
353 static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) hfsplus_unlink() argument
355 struct hfsplus_sb_info *sbi = HFSPLUS_SB(dir->i_sb); hfsplus_unlink()
372 dir, &dentry->d_name, hfsplus_unlink()
380 res = hfsplus_delete_cat(cnid, dir, &dentry->d_name); hfsplus_unlink()
410 static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry) hfsplus_rmdir() argument
412 struct hfsplus_sb_info *sbi = HFSPLUS_SB(dir->i_sb); hfsplus_rmdir()
420 res = hfsplus_delete_cat(inode->i_ino, dir, &dentry->d_name); hfsplus_rmdir()
432 static int hfsplus_symlink(struct inode *dir, struct dentry *dentry, hfsplus_symlink() argument
435 struct hfsplus_sb_info *sbi = HFSPLUS_SB(dir->i_sb); hfsplus_symlink()
440 inode = hfsplus_new_inode(dir->i_sb, S_IFLNK | S_IRWXUGO); hfsplus_symlink()
448 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); hfsplus_symlink()
452 res = hfsplus_init_inode_security(inode, dir, &dentry->d_name); hfsplus_symlink()
457 hfsplus_delete_cat(inode->i_ino, dir, &dentry->d_name); hfsplus_symlink()
474 static int hfsplus_mknod(struct inode *dir, struct dentry *dentry, hfsplus_mknod() argument
477 struct hfsplus_sb_info *sbi = HFSPLUS_SB(dir->i_sb); hfsplus_mknod()
482 inode = hfsplus_new_inode(dir->i_sb, mode); hfsplus_mknod()
489 res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); hfsplus_mknod()
493 res = hfsplus_init_inode_security(inode, dir, &dentry->d_name); hfsplus_mknod()
498 hfsplus_delete_cat(inode->i_ino, dir, &dentry->d_name); hfsplus_mknod()
515 static int hfsplus_create(struct inode *dir, struct dentry *dentry, umode_t mode, hfsplus_create() argument
518 return hfsplus_mknod(dir, dentry, mode, 0); hfsplus_create()
521 static int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) hfsplus_mkdir() argument
523 return hfsplus_mknod(dir, dentry, mode | S_IFDIR, 0); hfsplus_mkdir()
H A Dcatalog.c222 static void hfsplus_subfolders_inc(struct inode *dir) hfsplus_subfolders_inc() argument
224 struct hfsplus_sb_info *sbi = HFSPLUS_SB(dir->i_sb); hfsplus_subfolders_inc()
231 HFSPLUS_I(dir)->subfolders++; hfsplus_subfolders_inc()
235 static void hfsplus_subfolders_dec(struct inode *dir) hfsplus_subfolders_dec() argument
237 struct hfsplus_sb_info *sbi = HFSPLUS_SB(dir->i_sb); hfsplus_subfolders_dec()
247 if (HFSPLUS_I(dir)->subfolders) hfsplus_subfolders_dec()
248 HFSPLUS_I(dir)->subfolders--; hfsplus_subfolders_dec()
252 int hfsplus_create_cat(u32 cnid, struct inode *dir, hfsplus_create_cat() argument
255 struct super_block *sb = dir->i_sb; hfsplus_create_cat()
271 dir->i_ino, str); hfsplus_create_cat()
287 err = hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str); hfsplus_create_cat()
303 dir->i_size++; hfsplus_create_cat()
305 hfsplus_subfolders_inc(dir); hfsplus_create_cat()
306 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; hfsplus_create_cat()
307 hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); hfsplus_create_cat()
321 int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str) hfsplus_delete_cat() argument
323 struct super_block *sb = dir->i_sb; hfsplus_delete_cat()
345 fd.search_key->cat.parent = cpu_to_be32(dir->i_ino); hfsplus_delete_cat()
354 err = hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, str); hfsplus_delete_cat()
377 list_for_each(pos, &HFSPLUS_I(dir)->open_dir_list) { hfsplus_delete_cat()
397 dir->i_size--; hfsplus_delete_cat()
399 hfsplus_subfolders_dec(dir); hfsplus_delete_cat()
400 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; hfsplus_delete_cat()
401 hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); hfsplus_delete_cat()
405 hfsplus_delete_all_attrs(dir, cnid); hfsplus_delete_cat()
432 /* find the old dir entry and read the data */ hfsplus_rename_cat()
450 /* create new dir entry with the data from the old entry */ hfsplus_rename_cat()
H A Dxattr.h37 int hfsplus_init_security(struct inode *inode, struct inode *dir,
40 int hfsplus_init_inode_security(struct inode *inode, struct inode *dir,
H A Dacl.h23 static inline int hfsplus_init_posix_acl(struct inode *inode, struct inode *dir) hfsplus_init_posix_acl() argument
H A Dposix_acl.c111 int hfsplus_init_posix_acl(struct inode *inode, struct inode *dir) hfsplus_init_posix_acl() argument
117 "[%s]: ino %lu, dir->ino %lu\n", hfsplus_init_posix_acl()
118 __func__, inode->i_ino, dir->i_ino); hfsplus_init_posix_acl()
123 err = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl); hfsplus_init_posix_acl()
/linux-4.4.14/fs/afs/
H A DMakefile12 dir.o \
H A Ddir.c0 /* dir.c: AFS filesystem directory handling
22 static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
31 static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
33 static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
34 static int afs_rmdir(struct inode *dir, struct dentry *dentry);
35 static int afs_unlink(struct inode *dir, struct dentry *dentry);
36 static int afs_link(struct dentry *from, struct inode *dir,
38 static int afs_symlink(struct inode *dir, struct dentry *dentry,
109 /* dir hash table */
131 static inline void afs_dir_check_page(struct inode *dir, struct page *page) afs_dir_check_page() argument
144 printk("kAFS: %s(%lu): wrong number of dir blocks %d!=%hu\n", afs_dir_check_page()
145 __func__, dir->i_ino, qty, afs_dir_check_page()
152 latter = dir->i_size - page_offset(page); afs_dir_check_page()
164 __func__, dir->i_ino, tmp, qty, afs_dir_check_page()
190 static struct page *afs_dir_get_page(struct inode *dir, unsigned long index, afs_dir_get_page() argument
194 _enter("{%lu},%lu", dir->i_ino, index); afs_dir_get_page()
196 page = read_cache_page(dir->i_mapping, index, afs_page_filler, key); afs_dir_get_page()
200 afs_dir_check_page(dir, page); afs_dir_get_page()
277 " %u travelled beyond end dir block" afs_dir_iterate_block()
321 static int afs_dir_iterate(struct inode *dir, struct dir_context *ctx, afs_dir_iterate() argument
330 _enter("{%lu},%u,,", dir->i_ino, (unsigned)ctx->pos); afs_dir_iterate()
332 if (test_bit(AFS_VNODE_DELETED, &AFS_FS_I(dir)->flags)) { afs_dir_iterate()
343 while (ctx->pos < dir->i_size) { afs_dir_iterate()
347 page = afs_dir_get_page(dir, blkoff / PAGE_SIZE, key); afs_dir_iterate()
369 } while (ctx->pos < dir->i_size && blkoff < limit); afs_dir_iterate()
426 static int afs_do_lookup(struct inode *dir, struct dentry *dentry, afs_do_lookup() argument
429 struct afs_super_info *as = dir->i_sb->s_fs_info; afs_do_lookup()
437 _enter("{%lu},%p{%pd},", dir->i_ino, dentry, dentry); afs_do_lookup()
440 ret = afs_dir_iterate(dir, &cookie.ctx, key); afs_do_lookup()
462 int ret, struct dentry *dentry, struct inode *dir, struct key *key, afs_try_auto_mntpt()
466 struct afs_vnode *vnode = AFS_FS_I(dir); afs_try_auto_mntpt()
476 inode = afs_iget_autocell(dir, devname, strlen(devname), key); afs_try_auto_mntpt()
494 static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, afs_lookup() argument
503 vnode = AFS_FS_I(dir); afs_lookup()
533 ret = afs_do_lookup(dir, dentry, &fid, key); afs_lookup()
535 inode = afs_try_auto_mntpt(ret, dentry, dir, key, &fid); afs_lookup()
554 inode = afs_iget(dir->i_sb, key, &fid, NULL, NULL); afs_lookup()
579 struct afs_vnode *vnode, *dir; afs_d_revalidate() local
604 dir = AFS_FS_I(d_inode(parent)); afs_d_revalidate()
607 if (test_bit(AFS_VNODE_MODIFIED, &dir->flags)) afs_d_revalidate()
608 afs_validate(dir, key); afs_d_revalidate()
610 if (test_bit(AFS_VNODE_DELETED, &dir->flags)) { afs_d_revalidate()
611 _debug("%pd: parent dir deleted", dentry); afs_d_revalidate()
615 dir_version = (void *) (unsigned long) dir->status.data_version; afs_d_revalidate()
617 goto out_valid; /* the dir contents are unchanged */ afs_d_revalidate()
619 _debug("dir modified"); afs_d_revalidate()
622 ret = afs_do_lookup(&dir->vfs_inode, dentry, &fid, key); afs_d_revalidate()
666 _debug("failed to iterate dir %pd: %d", afs_d_revalidate()
730 static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) afs_mkdir() argument
741 dvnode = AFS_FS_I(dir); afs_mkdir()
758 inode = afs_iget(dir->i_sb, key, &fid, &status, &cb); afs_mkdir()
796 static int afs_rmdir(struct inode *dir, struct dentry *dentry) afs_rmdir() argument
802 dvnode = AFS_FS_I(dir); afs_rmdir()
838 static int afs_unlink(struct inode *dir, struct dentry *dentry) afs_unlink() argument
844 dvnode = AFS_FS_I(dir); afs_unlink()
906 static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, afs_create() argument
918 dvnode = AFS_FS_I(dir); afs_create()
935 inode = afs_iget(dir->i_sb, key, &fid, &status, &cb); afs_create()
973 static int afs_link(struct dentry *from, struct inode *dir, afs_link() argument
981 dvnode = AFS_FS_I(dir); afs_link()
1015 static int afs_symlink(struct inode *dir, struct dentry *dentry, afs_symlink() argument
1026 dvnode = AFS_FS_I(dir); afs_symlink()
1047 inode = afs_iget(dir->i_sb, key, &fid, &status, NULL); afs_symlink()
461 afs_try_auto_mntpt( int ret, struct dentry *dentry, struct inode *dir, struct key *key, struct afs_fid *fid) afs_try_auto_mntpt() argument
/linux-4.4.14/fs/ceph/
H A DMakefile7 ceph-y := super.o inode.o dir.o file.o locks.o addr.o ioctl.o \
H A Ddir.c112 * regardless of what dir changes take place on the
134 * falling back to a "normal" sync readdir if any dentries in the dir
137 * Complete dir indicates that we have all dentries in the dir. It is
146 struct inode *dir = d_inode(parent); __dcache_readdir() local
154 dout("__dcache_readdir %p v%u at %llu\n", dir, shared_gen, ctx->pos); __dcache_readdir()
167 if (ptr_pos >= i_size_read(dir)) { __dcache_readdir()
177 cache_ctl.page = find_lock_page(&dir->i_data, pgoff); __dcache_readdir()
192 if (ceph_dir_is_complete_ordered(dir) && __dcache_readdir()
193 ptr_pos < i_size_read(dir)) __dcache_readdir()
380 /* preclude from marking dir ordered */ ceph_readdir()
383 /* note dir version at start of readdir so ceph_readdir()
392 /* preclude from marking dir complete */ ceph_readdir()
461 * if dir_release_count still matches the dir, no dentries ceph_readdir()
463 * the complete dir contents in our cache. ceph_readdir()
558 /* .snap dir? */ ceph_handle_snapdir()
617 * Look up a single dir entry. If there is a lookup intent, inform
620 static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry, ceph_lookup() argument
623 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_lookup()
630 dir, dentry, dentry); ceph_lookup()
641 struct ceph_inode_info *ci = ceph_inode(dir); ceph_lookup()
645 dout(" dir %p flags are %d\n", dir, ci->i_ceph_flags); ceph_lookup()
649 !is_root_ceph_dentry(dir, dentry) && ceph_lookup()
654 dout(" dir %p complete, -ENOENT\n", dir); ceph_lookup()
662 op = ceph_snap(dir) == CEPH_SNAPDIR ? ceph_lookup()
671 req->r_locked_dir = dir; ceph_lookup()
684 int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry) ceph_handle_notrace_create() argument
686 struct dentry *result = ceph_lookup(dir, dentry, 0); ceph_handle_notrace_create()
707 static int ceph_mknod(struct inode *dir, struct dentry *dentry, ceph_mknod() argument
710 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_mknod()
716 if (ceph_snap(dir) != CEPH_NOSNAP) ceph_mknod()
719 err = ceph_pre_init_acls(dir, &mode, &acls); ceph_mknod()
723 dout("mknod in dir %p dentry %p mode 0%ho rdev %d\n", ceph_mknod()
724 dir, dentry, mode, rdev); ceph_mknod()
732 req->r_locked_dir = dir; ceph_mknod()
741 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_mknod()
743 err = ceph_handle_notrace_create(dir, dentry); ceph_mknod()
754 static int ceph_create(struct inode *dir, struct dentry *dentry, umode_t mode, ceph_create() argument
757 return ceph_mknod(dir, dentry, mode, 0); ceph_create()
760 static int ceph_symlink(struct inode *dir, struct dentry *dentry, ceph_symlink() argument
763 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_symlink()
768 if (ceph_snap(dir) != CEPH_NOSNAP) ceph_symlink()
771 dout("symlink in dir %p dentry %p to '%s'\n", dir, dentry, dest); ceph_symlink()
783 req->r_locked_dir = dir; ceph_symlink()
788 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_symlink()
790 err = ceph_handle_notrace_create(dir, dentry); ceph_symlink()
798 static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ceph_mkdir() argument
800 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_mkdir()
807 if (ceph_snap(dir) == CEPH_SNAPDIR) { ceph_mkdir()
810 dout("mksnap dir %p snap '%pd' dn %p\n", dir, ceph_mkdir()
812 } else if (ceph_snap(dir) == CEPH_NOSNAP) { ceph_mkdir()
813 dout("mkdir dir %p dn %p mode 0%ho\n", dir, dentry, mode); ceph_mkdir()
820 err = ceph_pre_init_acls(dir, &mode, &acls); ceph_mkdir()
832 req->r_locked_dir = dir; ceph_mkdir()
840 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_mkdir()
844 err = ceph_handle_notrace_create(dir, dentry); ceph_mkdir()
855 static int ceph_link(struct dentry *old_dentry, struct inode *dir, ceph_link() argument
858 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_link()
863 if (ceph_snap(dir) != CEPH_NOSNAP) ceph_link()
866 dout("link in dir %p old_dentry %p dentry %p\n", dir, ceph_link()
876 req->r_locked_dir = dir; ceph_link()
881 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_link()
915 static int ceph_unlink(struct inode *dir, struct dentry *dentry) ceph_unlink() argument
917 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_unlink()
924 if (ceph_snap(dir) == CEPH_SNAPDIR) { ceph_unlink()
926 dout("rmsnap dir %p '%pd' dn %p\n", dir, dentry, dentry); ceph_unlink()
928 } else if (ceph_snap(dir) == CEPH_NOSNAP) { ceph_unlink()
929 dout("unlink/rmdir dir %p dn %p inode %p\n", ceph_unlink()
930 dir, dentry, inode); ceph_unlink()
942 req->r_locked_dir = dir; ceph_unlink()
946 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_unlink()
971 dout("rename dir %p dentry %p to dir %p dentry %p\n", ceph_rename()
1035 struct inode *dir = NULL; dentry_lease_is_valid() local
1054 dir = d_inode(dentry->d_parent); dentry_lease_is_valid()
1065 ceph_mdsc_lease_send_msg(session, dir, dentry, dentry_lease_is_valid()
1076 static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry) dir_lease_is_valid() argument
1078 struct ceph_inode_info *ci = ceph_inode(dir); dir_lease_is_valid()
1086 dout("dir_lease_is_valid dir %p v%u dentry %p v%u = %d\n", dir_lease_is_valid()
1087 dir, (unsigned)ci->i_shared_gen, dentry, dir_lease_is_valid()
1098 struct inode *dir; ceph_d_revalidate() local
1106 dir = ceph_get_dentry_parent_inode(dentry); ceph_d_revalidate()
1109 if (ceph_snap(dir) != CEPH_NOSNAP) { ceph_d_revalidate()
1117 dir_lease_is_valid(dir, dentry)) { ceph_d_revalidate()
1128 ceph_dir_clear_complete(dir); ceph_d_revalidate()
1130 iput(dir); ceph_d_revalidate()
1173 /* if we are not hashed, we don't affect dir's completeness */ ceph_d_prune()
1185 * read() on a dir. This weird interface hack only works if mounted
1283 unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn) ceph_dentry_hash() argument
1285 struct ceph_inode_info *dci = ceph_inode(dir); ceph_dentry_hash()
/linux-4.4.14/fs/coda/
H A DMakefile7 coda-objs := psdev.o cache.o cnode.o inode.o dir.o file.o upcall.o \
H A Ddir.c40 static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsigned int flags) coda_lookup() argument
42 struct super_block *sb = dir->i_sb; coda_lookup()
50 coda_i2s(dir), (int)length, name); coda_lookup()
55 if (is_root_inode(dir) && coda_iscontrol(name, length)) { coda_lookup()
60 int error = venus_lookup(sb, coda_i2f(dir), name, length, coda_lookup()
102 static inline void coda_dir_update_mtime(struct inode *dir) coda_dir_update_mtime() argument
107 coda_flag_inode(dir, C_VATTR); coda_dir_update_mtime()
112 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; coda_dir_update_mtime()
121 static inline void coda_dir_inc_nlink(struct inode *dir) coda_dir_inc_nlink() argument
123 if (dir->i_nlink >= 2) coda_dir_inc_nlink()
124 inc_nlink(dir); coda_dir_inc_nlink()
127 static inline void coda_dir_drop_nlink(struct inode *dir) coda_dir_drop_nlink() argument
129 if (dir->i_nlink > 2) coda_dir_drop_nlink()
130 drop_nlink(dir); coda_dir_drop_nlink()
134 static int coda_create(struct inode *dir, struct dentry *de, umode_t mode, bool excl) coda_create() argument
143 if (is_root_inode(dir) && coda_iscontrol(name, length)) coda_create()
146 error = venus_create(dir->i_sb, coda_i2f(dir), name, length, coda_create()
151 inode = coda_iget(dir->i_sb, &newfid, &attrs); coda_create()
158 coda_dir_update_mtime(dir); coda_create()
166 static int coda_mkdir(struct inode *dir, struct dentry *de, umode_t mode) coda_mkdir() argument
175 if (is_root_inode(dir) && coda_iscontrol(name, len)) coda_mkdir()
179 error = venus_mkdir(dir->i_sb, coda_i2f(dir), coda_mkdir()
184 inode = coda_iget(dir->i_sb, &newfid, &attrs); coda_mkdir()
191 coda_dir_inc_nlink(dir); coda_mkdir()
192 coda_dir_update_mtime(dir); coda_mkdir()
258 static int coda_unlink(struct inode *dir, struct dentry *de) coda_unlink() argument
264 error = venus_remove(dir->i_sb, coda_i2f(dir), name, len); coda_unlink()
268 coda_dir_update_mtime(dir); coda_unlink()
273 static int coda_rmdir(struct inode *dir, struct dentry *de) coda_rmdir() argument
279 error = venus_rmdir(dir->i_sb, coda_i2f(dir), name, len); coda_rmdir()
286 coda_dir_drop_nlink(dir); coda_rmdir()
287 coda_dir_update_mtime(dir); coda_rmdir()
371 pr_err("%s: read dir %s failed %d\n", coda_venus_readdir()
386 pr_err("%s: invalid dir %s\n", coda_venus_readdir()
/linux-4.4.14/fs/ext2/
H A DMakefile7 ext2-y := balloc.o dir.o file.o ialloc.o inode.o \
H A Dnamei.c10 * directory layout is in fs/ext2/dir.c - it turned out to be easily separatable
57 static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) ext2_lookup() argument
65 ino = ext2_inode_by_name(dir, &dentry->d_name); ext2_lookup()
68 inode = ext2_iget(dir->i_sb, ino); ext2_lookup()
70 ext2_error(dir->i_sb, __func__, ext2_lookup()
96 static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode, bool excl) ext2_create() argument
101 err = dquot_initialize(dir); ext2_create()
105 inode = ext2_new_inode(dir, mode, &dentry->d_name); ext2_create()
121 static int ext2_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ext2_tmpfile() argument
123 struct inode *inode = ext2_new_inode(dir, mode, NULL); ext2_tmpfile()
141 static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev) ext2_mknod() argument
146 err = dquot_initialize(dir); ext2_mknod()
150 inode = ext2_new_inode (dir, mode, &dentry->d_name); ext2_mknod()
163 static int ext2_symlink (struct inode * dir, struct dentry * dentry, ext2_symlink() argument
166 struct super_block * sb = dir->i_sb; ext2_symlink()
174 err = dquot_initialize(dir); ext2_symlink()
178 inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO, &dentry->d_name); ext2_symlink()
213 static int ext2_link (struct dentry * old_dentry, struct inode * dir, ext2_link() argument
219 err = dquot_initialize(dir); ext2_link()
237 static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) ext2_mkdir() argument
242 err = dquot_initialize(dir); ext2_mkdir()
246 inode_inc_link_count(dir); ext2_mkdir()
248 inode = ext2_new_inode(dir, S_IFDIR | mode, &dentry->d_name); ext2_mkdir()
262 err = ext2_make_empty(inode, dir); ext2_mkdir()
281 inode_dec_link_count(dir); ext2_mkdir()
285 static int ext2_unlink(struct inode * dir, struct dentry *dentry) ext2_unlink() argument
292 err = dquot_initialize(dir); ext2_unlink()
296 de = ext2_find_entry (dir, &dentry->d_name, &page); ext2_unlink()
306 inode->i_ctime = dir->i_ctime; ext2_unlink()
313 static int ext2_rmdir (struct inode * dir, struct dentry *dentry) ext2_rmdir() argument
319 err = ext2_unlink(dir, dentry); ext2_rmdir()
323 inode_dec_link_count(dir); ext2_rmdir()
H A Ddir.c2 * linux/fs/ext2/dir.c
11 * linux/fs/minix/dir.c
91 struct inode *dir = mapping->host; ext2_commit_chunk() local
94 dir->i_version++; ext2_commit_chunk()
97 if (pos+len > dir->i_size) { ext2_commit_chunk()
98 i_size_write(dir, pos+len); ext2_commit_chunk()
99 mark_inode_dirty(dir); ext2_commit_chunk()
102 if (IS_DIRSYNC(dir)) { ext2_commit_chunk()
105 err = sync_inode_metadata(dir, 1); ext2_commit_chunk()
115 struct inode *dir = page->mapping->host; ext2_check_page() local
116 struct super_block *sb = dir->i_sb; ext2_check_page()
117 unsigned chunk_size = ext2_chunk_size(dir); ext2_check_page()
125 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { ext2_check_page()
126 limit = dir->i_size & ~PAGE_CACHE_MASK; ext2_check_page()
159 "of chunk size", dir->i_ino); ext2_check_page()
179 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, ext2_check_page()
189 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, ext2_check_page()
197 static struct page * ext2_get_page(struct inode *dir, unsigned long n, ext2_get_page() argument
200 struct address_space *mapping = dir->i_mapping; ext2_get_page()
361 struct ext2_dir_entry_2 *ext2_find_entry (struct inode * dir, ext2_find_entry() argument
368 unsigned long npages = dir_pages(dir); ext2_find_entry()
370 struct ext2_inode_info *ei = EXT2_I(dir); ext2_find_entry()
386 page = ext2_get_page(dir, n, dir_has_error); ext2_find_entry()
390 kaddr += ext2_last_byte(dir, n) - reclen; ext2_find_entry()
393 ext2_error(dir->i_sb, __func__, ext2_find_entry()
409 if (unlikely(n > (dir->i_blocks >> (PAGE_CACHE_SHIFT - 9)))) { ext2_find_entry()
410 ext2_error(dir->i_sb, __func__, ext2_find_entry()
411 "dir %lu size %lld exceeds block count %llu", ext2_find_entry()
412 dir->i_ino, dir->i_size, ext2_find_entry()
413 (unsigned long long)dir->i_blocks); ext2_find_entry()
426 struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p) ext2_dotdot() argument
428 struct page *page = ext2_get_page(dir, 0, 0); ext2_dotdot()
438 ino_t ext2_inode_by_name(struct inode *dir, struct qstr *child) ext2_inode_by_name() argument
444 de = ext2_find_entry (dir, child, &page); ext2_inode_by_name()
458 void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, ext2_set_link() argument
474 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ext2_set_link()
475 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; ext2_set_link()
476 mark_inode_dirty(dir); ext2_set_link()
484 struct inode *dir = d_inode(dentry->d_parent); ext2_add_link() local
487 unsigned chunk_size = ext2_chunk_size(dir); ext2_add_link()
492 unsigned long npages = dir_pages(dir); ext2_add_link()
506 page = ext2_get_page(dir, n, 0); ext2_add_link()
512 dir_end = kaddr + ext2_last_byte(dir, n); ext2_add_link()
525 ext2_error(dir->i_sb, __func__, ext2_add_link()
564 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ext2_add_link()
565 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; ext2_add_link()
566 mark_inode_dirty(dir); ext2_add_link()
581 int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) ext2_delete_entry() argument
585 unsigned from = ((char*)dir - kaddr) & ~(ext2_chunk_size(inode)-1); ext2_delete_entry()
586 unsigned to = ((char *)dir - kaddr) + ext2_delete_entry()
587 ext2_rec_len_from_disk(dir->rec_len); ext2_delete_entry()
593 while ((char*)de < (char*)dir) { ext2_delete_entry()
611 dir->inode = 0; ext2_delete_entry()
/linux-4.4.14/include/linux/netfilter/
H A Dnf_conntrack_zones_common.h18 u8 dir; member in struct:nf_conntrack_zone
H A Dnf_conntrack_tcp.h23 u_int32_t last_seq; /* Last sequence number seen in dir */
24 u_int32_t last_ack; /* Last sequence number seen in opposite dir */
26 u_int16_t last_win; /* Last window advertisement seen in dir */
/linux-4.4.14/arch/mips/math-emu/
H A Dme-debugfs.c33 struct dentry *d, *dir; debugfs_fpuemu() local
37 dir = debugfs_create_dir("fpuemustats", mips_debugfs_dir); debugfs_fpuemu()
38 if (!dir) debugfs_fpuemu()
46 d = debugfs_create_file(#m , S_IRUGO, dir, \ debugfs_fpuemu()
/linux-4.4.14/tools/perf/tests/
H A Dpmu.c86 static char dir[PATH_MAX]; test_format_dir_get() local
89 snprintf(dir, PATH_MAX, "/tmp/perf-pmu-test-format-XXXXXX"); test_format_dir_get()
90 if (!mkdtemp(dir)) test_format_dir_get()
98 snprintf(name, PATH_MAX, "%s/%s", dir, format->name); test_format_dir_get()
110 return dir; test_format_dir_get()
114 static int test_format_dir_put(char *dir) test_format_dir_put() argument
117 snprintf(buf, PATH_MAX, "rm -f %s/*\n", dir); test_format_dir_put()
121 snprintf(buf, PATH_MAX, "rmdir %s\n", dir); test_format_dir_put()
/linux-4.4.14/net/ipv4/netfilter/
H A Dnf_nat_h323.c99 int dir = CTINFO2DIR(ctinfo); set_sig_addr() local
106 if (addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && set_sig_addr()
107 port == info->sig_port[dir]) { set_sig_addr()
119 &ct->tuplehash[!dir].tuple.dst.u3.ip, set_sig_addr()
120 info->sig_port[!dir]); set_sig_addr()
123 &ct->tuplehash[!dir]. set_sig_addr()
125 info->sig_port[!dir]); set_sig_addr()
126 } else if (addr.ip == ct->tuplehash[dir].tuple.dst.u3.ip && set_sig_addr()
127 port == info->sig_port[dir]) { set_sig_addr()
131 &ct->tuplehash[!dir].tuple.src.u3.ip, set_sig_addr()
132 info->sig_port[!dir]); set_sig_addr()
135 &ct->tuplehash[!dir]. set_sig_addr()
137 info->sig_port[!dir]); set_sig_addr()
151 int dir = CTINFO2DIR(ctinfo); set_ras_addr() local
158 addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && set_ras_addr()
159 port == ct->tuplehash[dir].tuple.src.u.udp.port) { set_ras_addr()
162 &ct->tuplehash[!dir].tuple.dst.u3.ip, set_ras_addr()
163 ntohs(ct->tuplehash[!dir].tuple.dst.u.udp.port)); set_ras_addr()
165 &ct->tuplehash[!dir].tuple.dst.u3, set_ras_addr()
166 ct->tuplehash[!dir].tuple. set_ras_addr()
184 int dir = CTINFO2DIR(ctinfo); nat_rtp_rtcp() local
191 rtp_exp->dir = !dir; nat_rtp_rtcp()
194 rtcp_exp->dir = !dir; nat_rtp_rtcp()
198 if (info->rtp_port[i][dir] == rtp_port) { nat_rtp_rtcp()
203 rtp_exp->tuple.dst.u.udp.port = info->rtp_port[i][dir]; nat_rtp_rtcp()
205 htons(ntohs(info->rtp_port[i][dir]) + 1); nat_rtp_rtcp()
207 } else if (info->rtp_port[i][dir] == 0) { nat_rtp_rtcp()
253 &ct->tuplehash[!dir].tuple.dst.u3, nat_rtp_rtcp()
257 info->rtp_port[i][dir] = rtp_port; nat_rtp_rtcp()
258 info->rtp_port[i][!dir] = htons(nated_port); nat_rtp_rtcp()
287 int dir = CTINFO2DIR(ctinfo); nat_t120() local
293 exp->dir = !dir; nat_t120()
316 &ct->tuplehash[!dir].tuple.dst.u3, nat_t120()
339 int dir = CTINFO2DIR(ctinfo); nat_h245() local
345 exp->dir = !dir; nat_h245()
348 if (info->sig_port[dir] == port) nat_h245()
349 nated_port = ntohs(info->sig_port[!dir]); nat_h245()
372 &ct->tuplehash[!dir].tuple.dst.u3, nat_h245()
375 info->sig_port[dir] = port; nat_h245()
376 info->sig_port[!dir] = htons(nated_port); nat_h245()
411 new->tuplehash[!this->dir].tuple.src.u3; ip_nat_q931_expect()
418 new->master->tuplehash[!this->dir].tuple.src.u3; ip_nat_q931_expect()
430 int dir = CTINFO2DIR(ctinfo); nat_q931() local
437 exp->dir = !dir; nat_q931()
440 if (info->sig_port[dir] == port) nat_q931()
441 nated_port = ntohs(info->sig_port[!dir]); nat_q931()
464 &ct->tuplehash[!dir].tuple.dst.u3, nat_q931()
467 info->sig_port[dir] = port; nat_q931()
468 info->sig_port[!dir] = htons(nated_port); nat_q931()
475 &ct->tuplehash[!dir].tuple.dst.u3, nat_q931()
476 info->sig_port[!dir]); nat_q931()
505 new->tuplehash[!this->dir].tuple.src.u3; ip_nat_callforwarding_expect()
523 int dir = CTINFO2DIR(ctinfo); nat_callforwarding() local
528 exp->tuple.dst.u3.ip = ct->tuplehash[!dir].tuple.dst.u3.ip; nat_callforwarding()
531 exp->dir = !dir; nat_callforwarding()
554 &ct->tuplehash[!dir].tuple.dst.u3, nat_callforwarding()
/linux-4.4.14/fs/exofs/
H A Ddir.c60 struct inode *dir = mapping->host; exofs_commit_chunk() local
63 dir->i_version++; exofs_commit_chunk()
68 if (pos+len > dir->i_size) { exofs_commit_chunk()
69 i_size_write(dir, pos+len); exofs_commit_chunk()
70 mark_inode_dirty(dir); exofs_commit_chunk()
74 if (IS_DIRSYNC(dir)) exofs_commit_chunk()
84 struct inode *dir = page->mapping->host; exofs_check_page() local
85 unsigned chunk_size = exofs_chunk_size(dir); exofs_check_page()
93 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { exofs_check_page()
94 limit = dir->i_size & ~PAGE_CACHE_MASK; exofs_check_page()
122 dir->i_ino exofs_check_page()
141 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, exofs_check_page()
150 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, exofs_check_page()
157 static struct page *exofs_get_page(struct inode *dir, unsigned long n) exofs_get_page() argument
159 struct address_space *mapping = dir->i_mapping; exofs_get_page()
303 struct exofs_dir_entry *exofs_find_entry(struct inode *dir, exofs_find_entry() argument
310 unsigned long npages = dir_pages(dir); exofs_find_entry()
312 struct exofs_i_info *oi = exofs_i(dir); exofs_find_entry()
326 page = exofs_get_page(dir, n); exofs_find_entry()
330 kaddr += exofs_last_byte(dir, n) - reclen; exofs_find_entry()
335 dir->i_ino); exofs_find_entry()
357 struct exofs_dir_entry *exofs_dotdot(struct inode *dir, struct page **p) exofs_dotdot() argument
359 struct page *page = exofs_get_page(dir, 0); exofs_dotdot()
385 ino_t exofs_inode_by_name(struct inode *dir, struct dentry *dentry) exofs_inode_by_name() argument
391 de = exofs_find_entry(dir, dentry, &page); exofs_inode_by_name()
399 int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de, exofs_set_link() argument
419 dir->i_mtime = dir->i_ctime = CURRENT_TIME; exofs_set_link()
420 mark_inode_dirty(dir); exofs_set_link()
426 struct inode *dir = d_inode(dentry->d_parent); exofs_add_link() local
429 unsigned chunk_size = exofs_chunk_size(dir); exofs_add_link()
435 unsigned long npages = dir_pages(dir); exofs_add_link()
444 page = exofs_get_page(dir, n); exofs_add_link()
450 dir_end = kaddr + exofs_last_byte(dir, n); exofs_add_link()
506 dir->i_mtime = dir->i_ctime = CURRENT_TIME; exofs_add_link()
507 mark_inode_dirty(dir); exofs_add_link()
519 int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page) exofs_delete_entry() argument
525 unsigned from = ((char *)dir - kaddr) & ~(exofs_chunk_size(inode)-1); exofs_delete_entry()
526 unsigned to = ((char *)dir - kaddr) + le16_to_cpu(dir->rec_len); exofs_delete_entry()
532 while (de < dir) { exofs_delete_entry()
554 dir->inode_no = 0; exofs_delete_entry()
H A Dnamei.c48 static struct dentry *exofs_lookup(struct inode *dir, struct dentry *dentry, exofs_lookup() argument
57 ino = exofs_inode_by_name(dir, dentry); exofs_lookup()
58 inode = ino ? exofs_iget(dir->i_sb, ino) : NULL; exofs_lookup()
62 static int exofs_create(struct inode *dir, struct dentry *dentry, umode_t mode, exofs_create() argument
65 struct inode *inode = exofs_new_inode(dir, mode); exofs_create()
77 static int exofs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, exofs_mknod() argument
83 inode = exofs_new_inode(dir, mode); exofs_mknod()
93 static int exofs_symlink(struct inode *dir, struct dentry *dentry, exofs_symlink() argument
96 struct super_block *sb = dir->i_sb; exofs_symlink()
105 inode = exofs_new_inode(dir, S_IFLNK | S_IRWXUGO); exofs_symlink()
139 static int exofs_link(struct dentry *old_dentry, struct inode *dir, exofs_link() argument
151 static int exofs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) exofs_mkdir() argument
156 inode_inc_link_count(dir); exofs_mkdir()
158 inode = exofs_new_inode(dir, S_IFDIR | mode); exofs_mkdir()
169 err = exofs_make_empty(inode, dir); exofs_mkdir()
186 inode_dec_link_count(dir); exofs_mkdir()
190 static int exofs_unlink(struct inode *dir, struct dentry *dentry) exofs_unlink() argument
197 de = exofs_find_entry(dir, dentry, &page); exofs_unlink()
205 inode->i_ctime = dir->i_ctime; exofs_unlink()
212 static int exofs_rmdir(struct inode *dir, struct dentry *dentry) exofs_rmdir() argument
218 err = exofs_unlink(dir, dentry); exofs_rmdir()
222 inode_dec_link_count(dir); exofs_rmdir()
/linux-4.4.14/arch/arm/xen/
H A Dmm.c48 size_t size, enum dma_data_direction dir, enum dma_cache_op op) dma_cache_maint()
70 if (op == DMA_UNMAP && dir != DMA_TO_DEVICE) dma_cache_maint()
73 if (dir == DMA_FROM_DEVICE) dma_cache_maint()
88 size_t size, enum dma_data_direction dir) __xen_dma_page_dev_to_cpu()
90 dma_cache_maint(handle & PAGE_MASK, handle & ~PAGE_MASK, size, dir, DMA_UNMAP); __xen_dma_page_dev_to_cpu()
94 size_t size, enum dma_data_direction dir) __xen_dma_page_cpu_to_dev()
96 dma_cache_maint(handle & PAGE_MASK, handle & ~PAGE_MASK, size, dir, DMA_MAP); __xen_dma_page_cpu_to_dev()
101 enum dma_data_direction dir, struct dma_attrs *attrs) __xen_dma_map_page()
108 __xen_dma_page_cpu_to_dev(hwdev, dev_addr, size, dir); __xen_dma_map_page()
112 size_t size, enum dma_data_direction dir, __xen_dma_unmap_page()
121 __xen_dma_page_dev_to_cpu(hwdev, handle, size, dir); __xen_dma_unmap_page()
125 dma_addr_t handle, size_t size, enum dma_data_direction dir) __xen_dma_sync_single_for_cpu()
129 __xen_dma_page_dev_to_cpu(hwdev, handle, size, dir); __xen_dma_sync_single_for_cpu()
133 dma_addr_t handle, size_t size, enum dma_data_direction dir) __xen_dma_sync_single_for_device()
137 __xen_dma_page_cpu_to_dev(hwdev, handle, size, dir); __xen_dma_sync_single_for_device()
47 dma_cache_maint(dma_addr_t handle, unsigned long offset, size_t size, enum dma_data_direction dir, enum dma_cache_op op) dma_cache_maint() argument
87 __xen_dma_page_dev_to_cpu(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) __xen_dma_page_dev_to_cpu() argument
93 __xen_dma_page_cpu_to_dev(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) __xen_dma_page_cpu_to_dev() argument
99 __xen_dma_map_page(struct device *hwdev, struct page *page, dma_addr_t dev_addr, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __xen_dma_map_page() argument
111 __xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __xen_dma_unmap_page() argument
124 __xen_dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) __xen_dma_sync_single_for_cpu() argument
132 __xen_dma_sync_single_for_device(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir) __xen_dma_sync_single_for_device() argument
/linux-4.4.14/fs/ocfs2/
H A Ddir.c4 * dir.c
10 * Portions of this code from linux/fs/ext3/dir.c
19 * linux/fs/minix/dir.c
52 #include "dir.h"
77 struct inode *dir,
88 static int ocfs2_supports_dir_trailer(struct inode *dir) ocfs2_supports_dir_trailer() argument
90 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_supports_dir_trailer()
92 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) ocfs2_supports_dir_trailer()
95 return ocfs2_meta_ecc(osb) || ocfs2_dir_indexed(dir); ocfs2_supports_dir_trailer()
106 static int ocfs2_new_dir_wants_trailer(struct inode *dir) ocfs2_new_dir_wants_trailer() argument
108 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_new_dir_wants_trailer()
136 static int ocfs2_skip_dir_trailer(struct inode *dir, ocfs2_skip_dir_trailer() argument
143 if (!ocfs2_supports_dir_trailer(dir)) ocfs2_skip_dir_trailer()
166 * Link an unindexed block with a dir trailer structure into the index free
170 static int ocfs2_dx_dir_link_trailer(struct inode *dir, handle_t *handle, ocfs2_dx_dir_link_trailer() argument
178 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_dx_dir_link_trailer()
184 trailer = ocfs2_trailer_from_bh(dirdata_bh, dir->i_sb); ocfs2_dx_dir_link_trailer()
270 static void ocfs2_dx_dir_name_hash(struct inode *dir, const char *name, int len, ocfs2_dx_dir_name_hash() argument
273 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_dx_dir_name_hash()
313 * bh passed here can be an inode block or a dir data block, depending
316 static int ocfs2_check_dir_entry(struct inode * dir, ocfs2_check_dir_entry() argument
331 ((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize)) ocfs2_check_dir_entry()
337 (unsigned long long)OCFS2_I(dir)->ip_blkno, error_msg, ocfs2_check_dir_entry()
359 struct inode *dir, ocfs2_search_dirblock()
383 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { ocfs2_search_dirblock()
410 struct inode *dir, ocfs2_find_entry_id()
418 ret = ocfs2_read_inode_block(dir, &di_bh); ocfs2_find_entry_id()
427 found = ocfs2_search_dirblock(di_bh, dir, name, namelen, 0, ocfs2_find_entry_id()
428 data->id_data, i_size_read(dir), res_dir); ocfs2_find_entry_id()
476 static int ocfs2_check_dir_trailer(struct inode *dir, struct buffer_head *bh) ocfs2_check_dir_trailer() argument
481 trailer = ocfs2_trailer_from_bh(bh, dir->i_sb); ocfs2_check_dir_trailer()
483 rc = ocfs2_error(dir->i_sb, ocfs2_check_dir_trailer()
490 rc = ocfs2_error(dir->i_sb, ocfs2_check_dir_trailer()
497 OCFS2_I(dir)->ip_blkno) { ocfs2_check_dir_trailer()
498 rc = ocfs2_error(dir->i_sb, ocfs2_check_dir_trailer()
501 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_check_dir_trailer()
552 static int ocfs2_read_dir_block_direct(struct inode *dir, u64 phys, ocfs2_read_dir_block_direct() argument
558 ret = ocfs2_read_block(INODE_CACHE(dir), phys, &tmp, ocfs2_read_dir_block_direct()
565 if (ocfs2_supports_dir_trailer(dir)) { ocfs2_read_dir_block_direct()
566 ret = ocfs2_check_dir_trailer(dir, tmp); ocfs2_read_dir_block_direct()
594 "Checksum failed for dir index root block %llu\n", ocfs2_validate_dx_root()
609 static int ocfs2_read_dx_root(struct inode *dir, struct ocfs2_dinode *di, ocfs2_read_dx_root() argument
616 ret = ocfs2_read_block(INODE_CACHE(dir), blkno, &tmp, ocfs2_read_dx_root()
637 "Checksum failed for dir index leaf block %llu\n", ocfs2_validate_dx_leaf()
650 static int ocfs2_read_dx_leaf(struct inode *dir, u64 blkno, ocfs2_read_dx_leaf() argument
656 ret = ocfs2_read_block(INODE_CACHE(dir), blkno, &tmp, ocfs2_read_dx_leaf()
670 static int ocfs2_read_dx_leaves(struct inode *dir, u64 start, int num, ocfs2_read_dx_leaves() argument
675 ret = ocfs2_read_blocks(INODE_CACHE(dir), start, num, dx_leaf_bhs, 0, ocfs2_read_dx_leaves()
684 struct inode *dir, ocfs2_find_entry_el()
698 sb = dir->i_sb; ocfs2_find_entry_el()
700 nblocks = i_size_read(dir) >> sb->s_blocksize_bits; ocfs2_find_entry_el()
701 start = OCFS2_I(dir)->ip_dir_start_lookup; ocfs2_find_entry_el()
728 err = ocfs2_read_dir_block(dir, b++, &bh, ocfs2_find_entry_el()
735 if (ocfs2_read_dir_block(dir, block, &bh, 0)) { ocfs2_find_entry_el()
740 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_find_entry_el()
744 i = ocfs2_search_dirblock(bh, dir, name, namelen, ocfs2_find_entry_el()
749 OCFS2_I(dir)->ip_dir_start_lookup = block; ocfs2_find_entry_el()
767 nblocks = i_size_read(dir) >> sb->s_blocksize_bits; ocfs2_find_entry_el()
909 struct inode *dir, ocfs2_dx_dir_search()
924 ocfs2_dx_dir_name_hash(dir, name, namelen, &res->dl_hinfo); ocfs2_dx_dir_search()
933 ret = ocfs2_dx_dir_lookup(dir, dr_el, hinfo, NULL, &phys); ocfs2_dx_dir_search()
939 trace_ocfs2_dx_dir_search((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_search()
943 ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh); ocfs2_dx_dir_search()
973 ret = ocfs2_read_dir_block_direct(dir, ocfs2_dx_dir_search()
986 found = ocfs2_search_dirblock(dir_ent_bh, dir, name, namelen, ocfs2_dx_dir_search()
988 dir->i_sb->s_blocksize, &dir_ent); ocfs2_dx_dir_search()
1023 struct inode *dir, ocfs2_find_entry_dx()
1032 ret = ocfs2_read_inode_block(dir, &di_bh); ocfs2_find_entry_dx()
1040 ret = ocfs2_read_dx_root(dir, di, &dx_root_bh); ocfs2_find_entry_dx()
1047 ret = ocfs2_dx_dir_search(name, namelen, dir, dx_root, lookup); ocfs2_find_entry_dx()
1063 * Try to find an entry of the provided name within 'dir'.
1077 struct inode *dir, struct ocfs2_dir_lookup_result *lookup) ocfs2_find_entry()
1082 if (ocfs2_dir_indexed(dir)) ocfs2_find_entry()
1083 return ocfs2_find_entry_dx(name, namelen, dir, lookup); ocfs2_find_entry()
1086 * The unindexed dir code only uses part of the lookup ocfs2_find_entry()
1090 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) ocfs2_find_entry()
1091 bh = ocfs2_find_entry_id(name, namelen, dir, &res_dir); ocfs2_find_entry()
1093 bh = ocfs2_find_entry_el(name, namelen, dir, &res_dir); ocfs2_find_entry()
1106 int ocfs2_update_entry(struct inode *dir, handle_t *handle, ocfs2_update_entry() argument
1121 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) ocfs2_update_entry()
1124 ret = access(handle, INODE_CACHE(dir), de_bh, ocfs2_update_entry()
1144 static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir, __ocfs2_delete_entry() argument
1153 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) __ocfs2_delete_entry()
1160 if (!ocfs2_check_dir_entry(dir, de, bh, i)) { __ocfs2_delete_entry()
1166 status = access(handle, INODE_CACHE(dir), bh, __ocfs2_delete_entry()
1177 dir->i_version++; __ocfs2_delete_entry()
1248 static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir, ocfs2_delete_entry_dx() argument
1289 (unsigned long long)OCFS2_I(dir)->ip_blkno, index, ocfs2_delete_entry_dx()
1299 trailer = ocfs2_trailer_from_bh(leaf_bh, dir->i_sb); ocfs2_delete_entry_dx()
1314 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_delete_entry_dx()
1322 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), ocfs2_delete_entry_dx()
1331 trace_ocfs2_delete_entry_dx((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_delete_entry_dx()
1334 ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry, ocfs2_delete_entry_dx()
1341 max_rec_len = ocfs2_find_max_rec_len(dir->i_sb, leaf_bh); ocfs2_delete_entry_dx()
1365 struct inode *dir, ocfs2_delete_entry_id()
1374 ret = ocfs2_read_inode_block(dir, &di_bh); ocfs2_delete_entry_id()
1383 ret = __ocfs2_delete_entry(handle, dir, de_del, bh, data->id_data, ocfs2_delete_entry_id()
1384 i_size_read(dir)); ocfs2_delete_entry_id()
1392 struct inode *dir, ocfs2_delete_entry_el()
1396 return __ocfs2_delete_entry(handle, dir, de_del, bh, bh->b_data, ocfs2_delete_entry_el()
1405 struct inode *dir, ocfs2_delete_entry()
1408 if (ocfs2_dir_indexed(dir)) ocfs2_delete_entry()
1409 return ocfs2_delete_entry_dx(handle, dir, res); ocfs2_delete_entry()
1411 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) ocfs2_delete_entry()
1412 return ocfs2_delete_entry_id(handle, dir, res->dl_entry, ocfs2_delete_entry()
1415 return ocfs2_delete_entry_el(handle, dir, res->dl_entry, ocfs2_delete_entry()
1473 static int __ocfs2_dx_dir_leaf_insert(struct inode *dir, handle_t *handle, __ocfs2_dx_dir_leaf_insert() argument
1481 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), dx_leaf_bh, __ocfs2_dx_dir_leaf_insert()
1496 static void ocfs2_dx_inline_root_insert(struct inode *dir, handle_t *handle, ocfs2_dx_inline_root_insert() argument
1504 static int ocfs2_dx_dir_insert(struct inode *dir, handle_t *handle, ocfs2_dx_dir_insert() argument
1511 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_dx_dir_insert()
1520 ocfs2_dx_inline_root_insert(dir, handle, ocfs2_dx_dir_insert()
1525 ret = __ocfs2_dx_dir_leaf_insert(dir, handle, &lookup->dl_hinfo, ocfs2_dx_dir_insert()
1539 static void ocfs2_remove_block_from_free_list(struct inode *dir, ocfs2_remove_block_from_free_list() argument
1547 trailer = ocfs2_trailer_from_bh(lookup->dl_leaf_bh, dir->i_sb); ocfs2_remove_block_from_free_list()
1555 prev = ocfs2_trailer_from_bh(bh, dir->i_sb); ocfs2_remove_block_from_free_list()
1570 static void ocfs2_recalc_free_list(struct inode *dir, handle_t *handle, ocfs2_recalc_free_list() argument
1577 max_rec_len = ocfs2_find_max_rec_len(dir->i_sb, lookup->dl_leaf_bh); ocfs2_recalc_free_list()
1584 trailer = ocfs2_trailer_from_bh(lookup->dl_leaf_bh, dir->i_sb); ocfs2_recalc_free_list()
1588 ocfs2_remove_block_from_free_list(dir, handle, lookup); ocfs2_recalc_free_list()
1593 * like orphan dir can call this instead.
1599 struct inode *dir, __ocfs2_add_entry()
1609 struct super_block *sb = dir->i_sb; __ocfs2_add_entry()
1618 if (ocfs2_dir_indexed(dir)) { __ocfs2_add_entry()
1622 * An indexed dir may require that we update the free space __ocfs2_add_entry()
1632 INODE_CACHE(dir), bh, __ocfs2_add_entry()
1637 INODE_CACHE(dir), bh, __ocfs2_add_entry()
1644 } else if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { __ocfs2_add_entry()
1646 size = i_size_read(dir); __ocfs2_add_entry()
1660 if (!ocfs2_check_dir_entry(dir, de, insert_bh, offset)) { __ocfs2_add_entry()
1671 mlog_bug_on_msg(ocfs2_skip_dir_trailer(dir, de, offset, size), __ocfs2_add_entry()
1672 "Hit dir trailer trying to insert %.*s " __ocfs2_add_entry()
1677 offset, ocfs2_dir_trailer_blk_off(dir->i_sb)); __ocfs2_add_entry()
1680 dir->i_mtime = dir->i_ctime = CURRENT_TIME; __ocfs2_add_entry()
1681 retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); __ocfs2_add_entry()
1689 INODE_CACHE(dir), __ocfs2_add_entry()
1694 INODE_CACHE(dir), __ocfs2_add_entry()
1698 if (!retval && ocfs2_dir_indexed(dir)) __ocfs2_add_entry()
1699 retval = ocfs2_dx_dir_insert(dir, __ocfs2_add_entry()
1729 if (ocfs2_dir_indexed(dir)) __ocfs2_add_entry()
1730 ocfs2_recalc_free_list(dir, handle, lookup); __ocfs2_add_entry()
1732 dir->i_version++; __ocfs2_add_entry()
1765 mlog(ML_ERROR, "Unable to read inode block for dir %llu\n", ocfs2_dir_foreach_blk_id()
1774 /* If the dir block has changed since the last call to ocfs2_dir_foreach_blk_id()
1868 /* If the dir block has changed since the last call to ocfs2_dir_foreach_blk_el()
1988 * NOTE: this should always be called with parent dir i_mutex taken.
2017 int ocfs2_lookup_ino_from_name(struct inode *dir, const char *name, ocfs2_lookup_ino_from_name() argument
2023 ret = ocfs2_find_files_on_disk(name, namelen, blkno, dir, &lookup); ocfs2_lookup_ino_from_name()
2034 * Callers should have i_mutex + a cluster lock on dir
2036 int ocfs2_check_dir_for_entry(struct inode *dir, ocfs2_check_dir_for_entry() argument
2044 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); ocfs2_check_dir_for_entry()
2046 if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) { ocfs2_check_dir_for_entry()
2137 * Returns 1 if dir is empty, zero otherwise.
2163 mlog(ML_ERROR, "bad directory (dir #%llu) - no `.' or `..'\n", ocfs2_empty_dir()
2311 handle_t *handle, struct inode *dir, ocfs2_dx_dir_attach_index()
2326 ocfs2_trailer_from_bh(dirdata_bh, dir->i_sb); ocfs2_dx_dir_attach_index()
2336 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_attach_index()
2344 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), dx_root_bh); ocfs2_dx_dir_attach_index()
2346 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_dx_dir_attach_index()
2361 dx_root->dr_dir_blkno = cpu_to_le64(OCFS2_I(dir)->ip_blkno); ocfs2_dx_dir_attach_index()
2378 ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, ocfs2_dx_dir_attach_index()
2387 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_attach_index()
2388 OCFS2_I(dir)->ip_dyn_features |= OCFS2_INDEXED_DIR_FL; ocfs2_dx_dir_attach_index()
2389 di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features); ocfs2_dx_dir_attach_index()
2390 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_attach_index()
2403 handle_t *handle, struct inode *dir, ocfs2_dx_dir_format_cluster()
2419 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), bh); ocfs2_dx_dir_format_cluster()
2421 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), bh, ocfs2_dx_dir_format_cluster()
2438 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_format_cluster()
2451 * Allocates and formats a new cluster for use in an indexed dir
2455 static int __ocfs2_dx_dir_new_cluster(struct inode *dir, __ocfs2_dx_dir_new_cluster() argument
2464 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); __ocfs2_dx_dir_new_cluster()
2483 ret = ocfs2_dx_dir_format_cluster(osb, handle, dir, dx_leaves, __ocfs2_dx_dir_new_cluster()
2495 static int ocfs2_dx_dir_new_cluster(struct inode *dir, ocfs2_dx_dir_new_cluster() argument
2506 ret = __ocfs2_dx_dir_new_cluster(dir, cpos, handle, data_ac, dx_leaves, ocfs2_dx_dir_new_cluster()
2612 static int ocfs2_dx_dir_index_block(struct inode *dir, ocfs2_dx_dir_index_block() argument
2627 limit = de_buf + dir->i_sb->s_blocksize; ocfs2_dx_dir_index_block()
2636 ocfs2_dx_dir_name_hash(dir, de->name, namelen, &hinfo); ocfs2_dx_dir_index_block()
2638 i = ocfs2_dx_dir_hash_idx(OCFS2_SB(dir->i_sb), &hinfo); ocfs2_dx_dir_index_block()
2641 ret = __ocfs2_dx_dir_leaf_insert(dir, handle, &hinfo, ocfs2_dx_dir_index_block()
2661 static void ocfs2_dx_dir_index_root_block(struct inode *dir, ocfs2_dx_dir_index_root_block() argument
2674 limit = de_buf + dir->i_sb->s_blocksize; ocfs2_dx_dir_index_root_block()
2682 ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo); ocfs2_dx_dir_index_root_block()
2685 (unsigned long long)dir->i_ino, ocfs2_dx_dir_index_root_block()
2704 static int ocfs2_new_dx_should_be_inline(struct inode *dir, ocfs2_new_dx_should_be_inline() argument
2713 limit = de_buf + i_size_read(dir); ocfs2_new_dx_should_be_inline()
2725 return dirent_count < ocfs2_dx_entries_per_root(dir->i_sb); ocfs2_new_dx_should_be_inline()
2731 * expansion from an inline directory to one with extents. The first dir block
2737 * accounting. We do this here since we're already walking the entire dir
2740 * We add the dir trailer if this filesystem wants it.
2743 struct inode *dir) ocfs2_expand_last_dirent()
2745 struct super_block *sb = dir->i_sb; ocfs2_expand_last_dirent()
2753 if (ocfs2_new_dir_wants_trailer(dir)) ocfs2_expand_last_dirent()
2792 static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, ocfs2_expand_inline_dir() argument
2798 struct super_block *sb = dir->i_sb; ocfs2_expand_inline_dir()
2803 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_expand_inline_dir()
2804 struct ocfs2_inode_info *oi = OCFS2_I(dir); ocfs2_expand_inline_dir()
2816 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(dir), di_bh); ocfs2_expand_inline_dir()
2826 dx_inline = ocfs2_new_dx_should_be_inline(dir, di_bh); ocfs2_expand_inline_dir()
2877 ret = dquot_alloc_space_nodirty(dir, ocfs2_expand_inline_dir()
2889 ret = __ocfs2_dx_dir_new_cluster(dir, 0, handle, data_ac, ocfs2_expand_inline_dir()
2896 bytes_allocated += ocfs2_clusters_to_bytes(dir->i_sb, 1); ocfs2_expand_inline_dir()
2911 bytes_allocated += ocfs2_clusters_to_bytes(dir->i_sb, 1); ocfs2_expand_inline_dir()
2918 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off); ocfs2_expand_inline_dir()
2926 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), dirdata_bh); ocfs2_expand_inline_dir()
2928 ret = ocfs2_journal_access_db(handle, INODE_CACHE(dir), dirdata_bh, ocfs2_expand_inline_dir()
2935 memcpy(dirdata_bh->b_data, di->id2.i_data.id_data, i_size_read(dir)); ocfs2_expand_inline_dir()
2936 memset(dirdata_bh->b_data + i_size_read(dir), 0, ocfs2_expand_inline_dir()
2937 sb->s_blocksize - i_size_read(dir)); ocfs2_expand_inline_dir()
2938 i = ocfs2_expand_last_dirent(dirdata_bh->b_data, i_size_read(dir), dir); ocfs2_expand_inline_dir()
2939 if (ocfs2_new_dir_wants_trailer(dir)) { ocfs2_expand_inline_dir()
2941 * Prepare the dir trailer up front. It will otherwise look ocfs2_expand_inline_dir()
2943 * (unlikely), then all we'll have done is given first dir ocfs2_expand_inline_dir()
2946 ocfs2_init_dir_trailer(dir, dirdata_bh, i); ocfs2_expand_inline_dir()
2949 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_expand_inline_dir()
2961 ret = ocfs2_dx_dir_index_block(dir, handle, dx_leaves, ocfs2_expand_inline_dir()
2978 ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, ocfs2_expand_inline_dir()
2990 ocfs2_dinode_new_extent_list(dir, di); ocfs2_expand_inline_dir()
2992 i_size_write(dir, sb->s_blocksize); ocfs2_expand_inline_dir()
2993 dir->i_mtime = dir->i_ctime = CURRENT_TIME; ocfs2_expand_inline_dir()
2996 di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec); ocfs2_expand_inline_dir()
2997 di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec); ocfs2_expand_inline_dir()
2998 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_expand_inline_dir()
3015 dir->i_blocks = ocfs2_inode_sector_count(dir); ocfs2_expand_inline_dir()
3020 ret = ocfs2_dx_dir_attach_index(osb, handle, dir, di_bh, ocfs2_expand_inline_dir()
3029 ocfs2_dx_dir_index_root_block(dir, dx_root_bh, ocfs2_expand_inline_dir()
3033 INODE_CACHE(dir), ocfs2_expand_inline_dir()
3053 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off); ocfs2_expand_inline_dir()
3061 bytes_allocated += ocfs2_clusters_to_bytes(dir->i_sb, 1); ocfs2_expand_inline_dir()
3074 off = ocfs2_dx_dir_hash_idx(OCFS2_SB(dir->i_sb), ocfs2_expand_inline_dir()
3085 dquot_free_space_nodirty(dir, bytes_allocated); ocfs2_expand_inline_dir()
3111 struct inode *dir, ocfs2_do_extend_dir()
3121 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_do_extend_dir()
3122 extend = (i_size_read(dir) == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)); ocfs2_do_extend_dir()
3123 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_do_extend_dir()
3126 u32 offset = OCFS2_I(dir)->ip_clusters; ocfs2_do_extend_dir()
3128 status = dquot_alloc_space_nodirty(dir, ocfs2_do_extend_dir()
3134 status = ocfs2_add_inode_data(OCFS2_SB(sb), dir, &offset, ocfs2_do_extend_dir()
3144 v_blkno = ocfs2_blocks_for_bytes(sb, i_size_read(dir)); ocfs2_do_extend_dir()
3145 status = ocfs2_extent_map_get_blocks(dir, v_blkno, &p_blkno, NULL, NULL); ocfs2_do_extend_dir()
3160 dquot_free_space_nodirty(dir, ocfs2_clusters_to_bytes(sb, 1)); ocfs2_do_extend_dir()
3175 struct inode *dir, ocfs2_extend_dir()
3195 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { ocfs2_extend_dir()
3202 status = ocfs2_expand_inline_dir(dir, parent_fe_bh, ocfs2_extend_dir()
3233 down_write(&OCFS2_I(dir)->ip_alloc_sem); ocfs2_extend_dir()
3235 dir_i_size = i_size_read(dir); ocfs2_extend_dir()
3240 down_write(&OCFS2_I(dir)->ip_alloc_sem); ocfs2_extend_dir()
3242 dir_i_size = i_size_read(dir); ocfs2_extend_dir()
3243 trace_ocfs2_extend_dir((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_extend_dir()
3246 /* dir->i_size is always block aligned. */ ocfs2_extend_dir()
3247 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_extend_dir()
3248 if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) { ocfs2_extend_dir()
3249 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_extend_dir()
3250 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(dir), ocfs2_extend_dir()
3276 data_ac->ac_resv = &OCFS2_I(dir)->ip_la_data_resv; ocfs2_extend_dir()
3280 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_extend_dir()
3285 if (ocfs2_dir_indexed(dir)) ocfs2_extend_dir()
3297 status = ocfs2_do_extend_dir(osb->sb, handle, dir, parent_fe_bh, ocfs2_extend_dir()
3304 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), new_bh); ocfs2_extend_dir()
3306 status = ocfs2_journal_access_db(handle, INODE_CACHE(dir), new_bh, ocfs2_extend_dir()
3316 if (ocfs2_supports_dir_trailer(dir)) { ocfs2_extend_dir()
3319 ocfs2_init_dir_trailer(dir, new_bh, le16_to_cpu(de->rec_len)); ocfs2_extend_dir()
3321 if (ocfs2_dir_indexed(dir)) { ocfs2_extend_dir()
3322 status = ocfs2_dx_dir_link_trailer(dir, handle, ocfs2_extend_dir()
3332 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_extend_dir()
3335 dir_i_size += dir->i_sb->s_blocksize; ocfs2_extend_dir()
3336 i_size_write(dir, dir_i_size); ocfs2_extend_dir()
3337 dir->i_blocks = ocfs2_inode_sector_count(dir); ocfs2_extend_dir()
3338 status = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); ocfs2_extend_dir()
3351 up_write(&OCFS2_I(dir)->ip_alloc_sem); ocfs2_extend_dir()
3363 static int ocfs2_find_dir_space_id(struct inode *dir, struct buffer_head *di_bh, ocfs2_find_dir_space_id() argument
3369 struct super_block *sb = dir->i_sb; ocfs2_find_dir_space_id()
3374 unsigned int rec_len, new_rec_len, free_space = dir->i_sb->s_blocksize; ocfs2_find_dir_space_id()
3380 if (ocfs2_new_dir_wants_trailer(dir)) ocfs2_find_dir_space_id()
3381 free_space = ocfs2_dir_trailer_blk_off(sb) - i_size_read(dir); ocfs2_find_dir_space_id()
3383 free_space = dir->i_sb->s_blocksize - i_size_read(dir); ocfs2_find_dir_space_id()
3386 limit = de_buf + i_size_read(dir); ocfs2_find_dir_space_id()
3392 if (!ocfs2_check_dir_entry(dir, de, di_bh, offset)) { ocfs2_find_dir_space_id()
3434 static int ocfs2_find_dir_space_el(struct inode *dir, const char *name, ocfs2_find_dir_space_el() argument
3441 struct super_block *sb = dir->i_sb; ocfs2_find_dir_space_el()
3443 int blocksize = dir->i_sb->s_blocksize; ocfs2_find_dir_space_el()
3445 status = ocfs2_read_dir_block(dir, 0, &bh, 0); ocfs2_find_dir_space_el()
3457 if (i_size_read(dir) <= offset) { ocfs2_find_dir_space_el()
3465 status = ocfs2_read_dir_block(dir, ocfs2_find_dir_space_el()
3474 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { ocfs2_find_dir_space_el()
3483 if (ocfs2_skip_dir_trailer(dir, de, offset % blocksize, ocfs2_find_dir_space_el()
3655 static void ocfs2_dx_dir_transfer_leaf(struct inode *dir, u32 split_hash, ocfs2_dx_dir_transfer_leaf() argument
3678 memcpy(tmp_dx_leaf, orig_dx_leaf, dir->i_sb->s_blocksize); ocfs2_dx_dir_transfer_leaf()
3692 memcpy(orig_dx_leaf, tmp_dx_leaf, dir->i_sb->s_blocksize); ocfs2_dx_dir_transfer_leaf()
3713 static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, ocfs2_dx_dir_rebalance() argument
3732 trace_ocfs2_dx_dir_rebalance((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_rebalance()
3736 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_dx_dir_rebalance()
3749 "%llu, %d\n", (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_rebalance()
3769 ret = ocfs2_lock_allocators(dir, &et, 1, 0, &data_ac, &meta_ac); ocfs2_dx_dir_rebalance()
3785 ret = dquot_alloc_space_nodirty(dir, ocfs2_dx_dir_rebalance()
3786 ocfs2_clusters_to_bytes(dir->i_sb, 1)); ocfs2_dx_dir_rebalance()
3791 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), dx_leaf_bh, ocfs2_dx_dir_rebalance()
3841 orig_leaves_start = ocfs2_block_to_cluster_start(dir->i_sb, leaf_blkno); ocfs2_dx_dir_rebalance()
3842 ret = ocfs2_read_dx_leaves(dir, orig_leaves_start, num_dx_leaves, ocfs2_dx_dir_rebalance()
3850 ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle, ocfs2_dx_dir_rebalance()
3859 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), ocfs2_dx_dir_rebalance()
3867 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), ocfs2_dx_dir_rebalance()
3876 ocfs2_dx_dir_transfer_leaf(dir, split_hash, handle, tmp_dx_leaf, ocfs2_dx_dir_rebalance()
3881 dquot_free_space_nodirty(dir, ocfs2_dx_dir_rebalance()
3882 ocfs2_clusters_to_bytes(dir->i_sb, 1)); ocfs2_dx_dir_rebalance()
3884 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_dx_dir_rebalance()
3908 static int ocfs2_find_dir_space_dx(struct ocfs2_super *osb, struct inode *dir, ocfs2_find_dir_space_dx() argument
3924 ret = ocfs2_dx_dir_lookup(dir, &dx_root->dr_list, &lookup->dl_hinfo, ocfs2_find_dir_space_dx()
3931 ret = ocfs2_read_dx_leaf(dir, blkno, &dx_leaf_bh); ocfs2_find_dir_space_dx()
3953 ret = ocfs2_dx_dir_rebalance(osb, dir, dx_root_bh, dx_leaf_bh, ocfs2_find_dir_space_dx()
3981 static int ocfs2_search_dx_free_list(struct inode *dir, ocfs2_search_dx_free_list() argument
4001 ret = ocfs2_read_dir_block_direct(dir, next_block, &leaf_bh); ocfs2_search_dx_free_list()
4007 db = ocfs2_trailer_from_bh(leaf_bh, dir->i_sb); ocfs2_search_dx_free_list()
4029 static int ocfs2_expand_inline_dx_root(struct inode *dir, ocfs2_expand_inline_dx_root() argument
4037 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_expand_inline_dx_root()
4064 ret = dquot_alloc_space_nodirty(dir, ocfs2_expand_inline_dx_root()
4075 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_expand_inline_dx_root()
4082 ret = __ocfs2_dx_dir_new_cluster(dir, 0, handle, data_ac, dx_leaves, ocfs2_expand_inline_dx_root()
4117 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_expand_inline_dx_root()
4123 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_expand_inline_dx_root()
4128 dquot_free_space_nodirty(dir, ocfs2_expand_inline_dx_root()
4129 ocfs2_clusters_to_bytes(dir->i_sb, 1)); ocfs2_expand_inline_dx_root()
4160 static int ocfs2_prepare_dx_dir_for_insert(struct inode *dir, ocfs2_prepare_dx_dir_for_insert() argument
4167 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_prepare_dx_dir_for_insert()
4173 ret = ocfs2_read_dx_root(dir, di, &dx_root_bh); ocfs2_prepare_dx_dir_for_insert()
4197 ret = ocfs2_expand_inline_dx_root(dir, dx_root_bh); ocfs2_prepare_dx_dir_for_insert()
4210 ret = ocfs2_find_dir_space_dx(osb, dir, di_bh, dx_root_bh, name, ocfs2_prepare_dx_dir_for_insert()
4224 ret = ocfs2_search_dx_free_list(dir, dx_root_bh, namelen, lookup); ocfs2_prepare_dx_dir_for_insert()
4235 ret = ocfs2_extend_dir(osb, dir, di_bh, 1, lookup, &leaf_bh); ocfs2_prepare_dx_dir_for_insert()
4258 * happens here. Success returns zero, and enough context in the dir
4263 struct inode *dir, ocfs2_prepare_dir_for_insert()
4274 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen); ocfs2_prepare_dir_for_insert()
4294 ocfs2_dx_dir_name_hash(dir, name, namelen, &lookup->dl_hinfo); ocfs2_prepare_dir_for_insert()
4296 if (ocfs2_dir_indexed(dir)) { ocfs2_prepare_dir_for_insert()
4297 ret = ocfs2_prepare_dx_dir_for_insert(dir, parent_fe_bh, ocfs2_prepare_dir_for_insert()
4304 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { ocfs2_prepare_dir_for_insert()
4305 ret = ocfs2_find_dir_space_id(dir, parent_fe_bh, name, ocfs2_prepare_dir_for_insert()
4308 ret = ocfs2_find_dir_space_el(dir, name, namelen, &bh); ocfs2_prepare_dir_for_insert()
4321 ret = ocfs2_extend_dir(osb, dir, parent_fe_bh, blocks_wanted, ocfs2_prepare_dir_for_insert()
4339 static int ocfs2_dx_dir_remove_index(struct inode *dir, ocfs2_dx_dir_remove_index() argument
4344 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_dx_dir_remove_index()
4379 ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, ocfs2_dx_dir_remove_index()
4386 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_remove_index()
4387 OCFS2_I(dir)->ip_dyn_features &= ~OCFS2_INDEXED_DIR_FL; ocfs2_dx_dir_remove_index()
4388 di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features); ocfs2_dx_dir_remove_index()
4389 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_remove_index()
4391 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_dx_dir_remove_index()
4420 int ocfs2_dx_dir_truncate(struct inode *dir, struct buffer_head *di_bh) ocfs2_dx_dir_truncate() argument
4426 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_dx_dir_truncate()
4435 if (!ocfs2_dir_indexed(dir)) ocfs2_dx_dir_truncate()
4438 ret = ocfs2_read_dx_root(dir, di, &dx_root_bh); ocfs2_dx_dir_truncate()
4448 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_dx_dir_truncate()
4452 ret = ocfs2_dx_dir_lookup_rec(dir, &dx_root->dr_list, ocfs2_dx_dir_truncate()
4459 p_cpos = ocfs2_blocks_to_clusters(dir->i_sb, blkno); ocfs2_dx_dir_truncate()
4461 ret = ocfs2_remove_btree_range(dir, &et, cpos, p_cpos, clen, 0, ocfs2_dx_dir_truncate()
4475 ret = ocfs2_dx_dir_remove_index(dir, di_bh, dx_root_bh); ocfs2_dx_dir_truncate()
4481 ocfs2_remove_from_cache(INODE_CACHE(dir), dx_root_bh); ocfs2_dx_dir_truncate()
358 ocfs2_search_dirblock(struct buffer_head *bh, struct inode *dir, const char *name, int namelen, unsigned long offset, char *first_de, unsigned int bytes, struct ocfs2_dir_entry **res_dir) ocfs2_search_dirblock() argument
408 ocfs2_find_entry_id(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_entry **res_dir) ocfs2_find_entry_id() argument
683 ocfs2_find_entry_el(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_entry **res_dir) ocfs2_find_entry_el() argument
908 ocfs2_dx_dir_search(const char *name, int namelen, struct inode *dir, struct ocfs2_dx_root_block *dx_root, struct ocfs2_dir_lookup_result *res) ocfs2_dx_dir_search() argument
1022 ocfs2_find_entry_dx(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_lookup_result *lookup) ocfs2_find_entry_dx() argument
1076 ocfs2_find_entry(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_lookup_result *lookup) ocfs2_find_entry() argument
1364 ocfs2_delete_entry_id(handle_t *handle, struct inode *dir, struct ocfs2_dir_entry *de_del, struct buffer_head *bh) ocfs2_delete_entry_id() argument
1391 ocfs2_delete_entry_el(handle_t *handle, struct inode *dir, struct ocfs2_dir_entry *de_del, struct buffer_head *bh) ocfs2_delete_entry_el() argument
1404 ocfs2_delete_entry(handle_t *handle, struct inode *dir, struct ocfs2_dir_lookup_result *res) ocfs2_delete_entry() argument
1598 __ocfs2_add_entry(handle_t *handle, struct inode *dir, const char *name, int namelen, struct inode *inode, u64 blkno, struct buffer_head *parent_fe_bh, struct ocfs2_dir_lookup_result *lookup) __ocfs2_add_entry() argument
2310 ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, handle_t *handle, struct inode *dir, struct buffer_head *di_bh, struct buffer_head *dirdata_bh, struct ocfs2_alloc_context *meta_ac, int dx_inline, u32 num_entries, struct buffer_head **ret_dx_root_bh) ocfs2_dx_dir_attach_index() argument
2402 ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb, handle_t *handle, struct inode *dir, struct buffer_head **dx_leaves, int num_dx_leaves, u64 start_blk) ocfs2_dx_dir_format_cluster() argument
2742 ocfs2_expand_last_dirent(char *start, unsigned int old_size, struct inode *dir) ocfs2_expand_last_dirent() argument
3109 ocfs2_do_extend_dir(struct super_block *sb, handle_t *handle, struct inode *dir, struct buffer_head *parent_fe_bh, struct ocfs2_alloc_context *data_ac, struct ocfs2_alloc_context *meta_ac, struct buffer_head **new_bh) ocfs2_do_extend_dir() argument
3174 ocfs2_extend_dir(struct ocfs2_super *osb, struct inode *dir, struct buffer_head *parent_fe_bh, unsigned int blocks_wanted, struct ocfs2_dir_lookup_result *lookup, struct buffer_head **new_de_bh) ocfs2_extend_dir() argument
4262 ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb, struct inode *dir, struct buffer_head *parent_fe_bh, const char *name, int namelen, struct ocfs2_dir_lookup_result *lookup) ocfs2_prepare_dir_for_insert() argument
H A Ddir.h4 * dir.h
49 * dir free space
58 struct inode *dir,
61 struct inode *dir,
64 struct inode *dir,
79 int ocfs2_update_entry(struct inode *dir, handle_t *handle,
83 int ocfs2_check_dir_for_entry(struct inode *dir,
93 int ocfs2_lookup_ino_from_name(struct inode *dir, const char *name,
98 struct inode *dir,
112 int ocfs2_dx_dir_truncate(struct inode *dir, struct buffer_head *di_bh);
H A Dnamei.c10 * Portions of this code from linux/fs/ext3/dir.c
19 * linux/fs/minix/dir.c
51 #include "dir.h"
70 struct inode *dir,
107 /* An orphan dir name is an 8 byte value, printed as a hex string */
110 static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, ocfs2_lookup() argument
119 trace_ocfs2_lookup(dir, dentry, dentry->d_name.len, ocfs2_lookup()
121 (unsigned long long)OCFS2_I(dir)->ip_blkno, 0); ocfs2_lookup()
128 status = ocfs2_inode_lock_nested(dir, NULL, 0, OI_LS_PARENT); ocfs2_lookup()
136 status = ocfs2_lookup_ino_from_name(dir, dentry->d_name.name, ocfs2_lookup()
141 inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0, 0); ocfs2_lookup()
175 OCFS2_I(dir)->ip_blkno); ocfs2_lookup()
189 ocfs2_inode_unlock(dir, 0); ocfs2_lookup()
198 static struct inode *ocfs2_get_init_inode(struct inode *dir, umode_t mode) ocfs2_get_init_inode() argument
203 inode = new_inode(dir->i_sb); ocfs2_get_init_inode()
214 inode_init_owner(inode, dir, mode); ocfs2_get_init_inode()
237 static int ocfs2_mknod(struct inode *dir, ocfs2_mknod() argument
264 trace_ocfs2_mknod(dir, dentry, dentry->d_name.len, dentry->d_name.name, ocfs2_mknod()
265 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_mknod()
268 status = dquot_initialize(dir); ocfs2_mknod()
275 osb = OCFS2_SB(dir->i_sb); ocfs2_mknod()
277 status = ocfs2_inode_lock(dir, &parent_fe_bh, 1); ocfs2_mknod()
284 if (S_ISDIR(mode) && (dir->i_nlink >= ocfs2_link_max(osb))) { ocfs2_mknod()
296 status = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_mknod()
301 /* get a spot inside the dir. */ ocfs2_mknod()
302 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, ocfs2_mknod()
318 inode = ocfs2_get_init_inode(dir, mode); ocfs2_mknod()
327 status = ocfs2_init_security_get(inode, dir, &dentry->d_name, &si); ocfs2_mknod()
338 status = ocfs2_calc_xattr_init(dir, parent_fe_bh, mode, ocfs2_mknod()
389 status = ocfs2_mknod_locked(osb, dir, inode, dev, ocfs2_mknod()
398 status = ocfs2_fill_new_dir(osb, handle, dir, inode, ocfs2_mknod()
405 status = ocfs2_journal_access_di(handle, INODE_CACHE(dir), ocfs2_mknod()
414 inc_nlink(dir); ocfs2_mknod()
417 status = ocfs2_init_acl(handle, inode, dir, new_fe_bh, parent_fe_bh, ocfs2_mknod()
440 OCFS2_I(dir)->ip_blkno); ocfs2_mknod()
465 ocfs2_inode_unlock(dir, 1); ocfs2_mknod()
504 static int __ocfs2_mknod_locked(struct inode *dir, __ocfs2_mknod_locked() argument
514 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); __ocfs2_mknod_locked()
617 struct inode *dir, ocfs2_mknod_locked()
631 status = ocfs2_claim_new_inode(handle, dir, parent_fe_bh, ocfs2_mknod_locked()
639 status = __ocfs2_mknod_locked(dir, inode, dev, new_fe_bh, ocfs2_mknod_locked()
653 static int ocfs2_mkdir(struct inode *dir, ocfs2_mkdir() argument
659 trace_ocfs2_mkdir(dir, dentry, dentry->d_name.len, dentry->d_name.name, ocfs2_mkdir()
660 OCFS2_I(dir)->ip_blkno, mode); ocfs2_mkdir()
661 ret = ocfs2_mknod(dir, dentry, mode | S_IFDIR, 0); ocfs2_mkdir()
668 static int ocfs2_create(struct inode *dir, ocfs2_create() argument
675 trace_ocfs2_create(dir, dentry, dentry->d_name.len, dentry->d_name.name, ocfs2_create()
676 (unsigned long long)OCFS2_I(dir)->ip_blkno, mode); ocfs2_create()
677 ret = ocfs2_mknod(dir, dentry, mode | S_IFREG, 0); ocfs2_create()
685 struct inode *dir, ocfs2_link()
696 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_link()
708 err = dquot_initialize(dir); ocfs2_link()
715 &parent_fe_bh, dir, 0); ocfs2_link()
735 if (!dir->i_nlink) { ocfs2_link()
756 err = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_link()
761 err = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, ocfs2_link()
817 err = ocfs2_dentry_attach_lock(dentry, inode, OCFS2_I(dir)->ip_blkno); ocfs2_link()
833 ocfs2_double_unlock(old_dir, dir); ocfs2_link()
877 static int ocfs2_unlink(struct inode *dir, ocfs2_unlink() argument
885 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_unlink()
895 trace_ocfs2_unlink(dir, dentry, dentry->d_name.len, ocfs2_unlink()
897 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_unlink()
900 status = dquot_initialize(dir); ocfs2_unlink()
906 BUG_ON(d_inode(dentry->d_parent) != dir); ocfs2_unlink()
911 status = ocfs2_inode_lock_nested(dir, &parent_node_bh, 1, ocfs2_unlink()
920 dentry->d_name.len, &blkno, dir, ocfs2_unlink()
990 /* delete the name from the parent dir */ ocfs2_unlink()
991 status = ocfs2_delete_entry(handle, dir, &lookup); ocfs2_unlink()
1003 dir->i_ctime = dir->i_mtime = CURRENT_TIME; ocfs2_unlink()
1005 drop_nlink(dir); ocfs2_unlink()
1007 status = ocfs2_mark_inode_dirty(handle, dir, parent_node_bh); ocfs2_unlink()
1011 inc_nlink(dir); ocfs2_unlink()
1036 ocfs2_inode_unlock(dir, 1); ocfs2_unlink()
1624 mlog(ML_ERROR, "need to change nlink for old dir " ocfs2_rename()
1789 static int ocfs2_symlink(struct inode *dir, ocfs2_symlink() argument
1817 trace_ocfs2_symlink_begin(dir, dentry, symname, ocfs2_symlink()
1820 status = dquot_initialize(dir); ocfs2_symlink()
1826 sb = dir->i_sb; ocfs2_symlink()
1834 status = ocfs2_inode_lock(dir, &parent_fe_bh, 1); ocfs2_symlink()
1848 status = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_symlink()
1853 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, ocfs2_symlink()
1868 inode = ocfs2_get_init_inode(dir, S_IFLNK | S_IRWXUGO); ocfs2_symlink()
1877 status = ocfs2_init_security_get(inode, dir, &dentry->d_name, &si); ocfs2_symlink()
1889 status = ocfs2_calc_security_init(dir, &si, &want_clusters, ocfs2_symlink()
1925 trace_ocfs2_symlink_create(dir, dentry, dentry->d_name.len, ocfs2_symlink()
1927 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_symlink()
1930 status = ocfs2_mknod_locked(osb, dir, inode, ocfs2_symlink()
2003 status = ocfs2_dentry_attach_lock(dentry, inode, OCFS2_I(dir)->ip_blkno); ocfs2_symlink()
2030 ocfs2_inode_unlock(dir, 1); ocfs2_symlink()
2168 * @ret_orphan_dir: Orphan dir inode - returned locked!
2169 * @blkno: Actual block number of the inode to be inserted into orphan dir.
2170 * @lookup: dir lookup result, to be passed back into functions like
2296 /* Record which orphan dir our inode now resides ocfs2_orphan_add()
2298 * dir to lock. */ ocfs2_orphan_add()
2320 /* unlike orphan_add, we expect the orphan dir to already be locked here. */ ocfs2_orphan_del()
2396 * ocfs2_prep_new_orphaned_file() - Prepare the orphan dir to receive a newly
2397 * allocated file. This is different from the typical 'add to orphan dir'
2399 * the orphan dir stringifies the inode block number to come up with it's
2403 * @dir: The directory which this inode will ultimately wind up under - not the
2404 * orphan dir!
2405 * @dir_bh: buffer_head the @dir inode block
2407 * with the string to be used for orphan dirent. Pass back to the orphan dir
2409 * @ret_orphan_dir: orphan dir inode returned to be passed back into orphan
2410 * dir code.
2412 * @orphan_insert: Dir insert context to be passed back into orphan dir code.
2420 static int ocfs2_prep_new_orphaned_file(struct inode *dir, ocfs2_prep_new_orphaned_file() argument
2430 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_prep_new_orphaned_file()
2449 ret = ocfs2_find_new_inode_loc(dir, dir_bh, inode_ac, ocfs2_prep_new_orphaned_file()
2478 /* Unroll orphan dir locking */ ocfs2_prep_new_orphaned_file()
2489 int ocfs2_create_inode_in_orphan(struct inode *dir, ocfs2_create_inode_in_orphan() argument
2496 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_create_inode_in_orphan()
2507 status = ocfs2_inode_lock(dir, &parent_di_bh, 1); ocfs2_create_inode_in_orphan()
2514 status = ocfs2_prep_new_orphaned_file(dir, parent_di_bh, ocfs2_create_inode_in_orphan()
2523 inode = ocfs2_get_init_inode(dir, mode); ocfs2_create_inode_in_orphan()
2544 status = ocfs2_claim_new_inode_at_loc(handle, dir, inode_ac, ocfs2_create_inode_in_orphan()
2554 status = __ocfs2_mknod_locked(dir, inode, ocfs2_create_inode_in_orphan()
2571 /* get open lock so that only nodes can't remove it from orphan dir. */ ocfs2_create_inode_in_orphan()
2605 ocfs2_inode_unlock(dir, 1); ocfs2_create_inode_in_orphan()
2762 int ocfs2_mv_orphaned_inode_to_new(struct inode *dir, ocfs2_mv_orphaned_inode_to_new() argument
2769 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_mv_orphaned_inode_to_new()
2776 trace_ocfs2_mv_orphaned_inode_to_new(dir, dentry, ocfs2_mv_orphaned_inode_to_new()
2778 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_mv_orphaned_inode_to_new()
2781 status = ocfs2_inode_lock(dir, &parent_di_bh, 1); ocfs2_mv_orphaned_inode_to_new()
2795 status = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_mv_orphaned_inode_to_new()
2800 /* get a spot inside the dir. */ ocfs2_mv_orphaned_inode_to_new()
2801 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_di_bh, ocfs2_mv_orphaned_inode_to_new()
2873 OCFS2_I(dir)->ip_blkno); ocfs2_mv_orphaned_inode_to_new()
2889 ocfs2_inode_unlock(dir, 1); ocfs2_mv_orphaned_inode_to_new()
616 ocfs2_mknod_locked(struct ocfs2_super *osb, struct inode *dir, struct inode *inode, dev_t dev, struct buffer_head **new_fe_bh, struct buffer_head *parent_fe_bh, handle_t *handle, struct ocfs2_alloc_context *inode_ac) ocfs2_mknod_locked() argument
684 ocfs2_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) ocfs2_link() argument
H A DMakefile18 dir.o \
/linux-4.4.14/arch/arm/common/
H A Ddmabounce.c108 size_t size, enum dma_data_direction dir) alloc_safe_buffer()
115 dev_dbg(dev, "%s(ptr=%p, size=%d, dir=%d)\n", alloc_safe_buffer()
116 __func__, ptr, size, dir); alloc_safe_buffer()
134 buf->direction = dir; alloc_safe_buffer()
246 enum dma_data_direction dir) map_single()
254 buf = alloc_safe_buffer(device_info, ptr, size, dir); map_single()
265 if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) { map_single()
275 size_t size, enum dma_data_direction dir) unmap_single()
278 BUG_ON(buf->direction != dir); unmap_single()
286 if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { unmap_single()
312 unsigned long offset, size_t size, enum dma_data_direction dir, dmabounce_map_page()
318 dev_dbg(dev, "%s(page=%p,off=%#lx,size=%zx,dir=%x)\n", dmabounce_map_page()
319 __func__, page, offset, size, dir); dmabounce_map_page()
328 arm_dma_ops.sync_single_for_device(dev, dma_addr, size, dir); dmabounce_map_page()
337 return map_single(dev, page_address(page) + offset, size, dir); dmabounce_map_page()
347 enum dma_data_direction dir, struct dma_attrs *attrs) dmabounce_unmap_page()
351 dev_dbg(dev, "%s(dma=%#x,size=%d,dir=%x)\n", dmabounce_unmap_page()
352 __func__, dma_addr, size, dir); dmabounce_unmap_page()
356 arm_dma_ops.sync_single_for_cpu(dev, dma_addr, size, dir); dmabounce_unmap_page()
360 unmap_single(dev, buf, size, dir); dmabounce_unmap_page()
364 size_t sz, enum dma_data_direction dir) __dmabounce_sync_for_cpu()
369 dev_dbg(dev, "%s(dma=%#x,sz=%zx,dir=%x)\n", __dmabounce_sync_for_cpu()
370 __func__, addr, sz, dir); __dmabounce_sync_for_cpu()
378 BUG_ON(buf->direction != dir); __dmabounce_sync_for_cpu()
386 if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { __dmabounce_sync_for_cpu()
395 dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_cpu()
397 if (!__dmabounce_sync_for_cpu(dev, handle, size, dir)) dmabounce_sync_for_cpu()
400 arm_dma_ops.sync_single_for_cpu(dev, handle, size, dir); dmabounce_sync_for_cpu()
404 size_t sz, enum dma_data_direction dir) __dmabounce_sync_for_device()
409 dev_dbg(dev, "%s(dma=%#x,sz=%zx,dir=%x)\n", __dmabounce_sync_for_device()
410 __func__, addr, sz, dir); __dmabounce_sync_for_device()
418 BUG_ON(buf->direction != dir); __dmabounce_sync_for_device()
426 if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) { __dmabounce_sync_for_device()
435 dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_device()
437 if (!__dmabounce_sync_for_device(dev, handle, size, dir)) dmabounce_sync_for_device()
440 arm_dma_ops.sync_single_for_device(dev, handle, size, dir); dmabounce_sync_for_device()
107 alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, size_t size, enum dma_data_direction dir) alloc_safe_buffer() argument
245 map_single(struct device *dev, void *ptr, size_t size, enum dma_data_direction dir) map_single() argument
274 unmap_single(struct device *dev, struct safe_buffer *buf, size_t size, enum dma_data_direction dir) unmap_single() argument
311 dmabounce_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) dmabounce_map_page() argument
346 dmabounce_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) dmabounce_unmap_page() argument
363 __dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr, size_t sz, enum dma_data_direction dir) __dmabounce_sync_for_cpu() argument
394 dmabounce_sync_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_cpu() argument
403 __dmabounce_sync_for_device(struct device *dev, dma_addr_t addr, size_t sz, enum dma_data_direction dir) __dmabounce_sync_for_device() argument
434 dmabounce_sync_for_device(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dmabounce_sync_for_device() argument
/linux-4.4.14/drivers/net/ethernet/ibm/ehea/
H A Dehea_qmr.c561 int dir) ehea_init_top_bmap()
563 if (!ehea_top_bmap->dir[dir]) { ehea_init_top_bmap()
564 ehea_top_bmap->dir[dir] = ehea_init_top_bmap()
566 if (!ehea_top_bmap->dir[dir]) ehea_init_top_bmap()
572 static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) ehea_init_bmap() argument
580 return ehea_init_top_bmap(ehea_bmap->top[top], dir); ehea_init_bmap()
592 int top, dir, idx; ehea_rebuild_busmap() local
601 for (dir = 0; dir < EHEA_MAP_ENTRIES; dir++) { ehea_rebuild_busmap()
605 if (!ehea_top->dir[dir]) ehea_rebuild_busmap()
608 ehea_dir = ehea_top->dir[dir]; ehea_rebuild_busmap()
617 ehea_top->dir[dir] = NULL; ehea_rebuild_busmap()
647 int dir = ehea_calc_index(i, EHEA_DIR_INDEX_SHIFT); ehea_update_busmap() local
651 int ret = ehea_init_bmap(ehea_bmap, top, dir); ehea_update_busmap()
659 if (!ehea_bmap->top[top]->dir[dir]) ehea_update_busmap()
665 ehea_bmap->top[top]->dir[dir]->ent[idx] = flag; ehea_update_busmap()
755 int top, dir; ehea_destroy_busmap() local
764 for (dir = 0; dir < EHEA_MAP_ENTRIES; dir++) { ehea_destroy_busmap()
765 if (!ehea_bmap->top[top]->dir[dir]) ehea_destroy_busmap()
768 kfree(ehea_bmap->top[top]->dir[dir]); ehea_destroy_busmap()
782 int top, dir, idx; ehea_map_vaddr() local
793 dir = (index >> EHEA_DIR_INDEX_SHIFT) & EHEA_INDEX_MASK; ehea_map_vaddr()
794 if (!ehea_bmap->top[top]->dir[dir]) ehea_map_vaddr()
798 if (!ehea_bmap->top[top]->dir[dir]->ent[idx]) ehea_map_vaddr()
802 return ehea_bmap->top[top]->dir[dir]->ent[idx] | offset; ehea_map_vaddr()
805 static inline void *ehea_calc_sectbase(int top, int dir, int idx) ehea_calc_sectbase() argument
808 ret |= dir << EHEA_DIR_INDEX_SHIFT; ehea_calc_sectbase()
813 static u64 ehea_reg_mr_section(int top, int dir, int idx, u64 *pt, ehea_reg_mr_section() argument
822 void *sectbase = ehea_calc_sectbase(top, dir, idx); ehea_reg_mr_section()
844 static u64 ehea_reg_mr_sections(int top, int dir, u64 *pt, ehea_reg_mr_sections() argument
852 if (!ehea_bmap->top[top]->dir[dir]->ent[idx]) ehea_reg_mr_sections()
855 hret = ehea_reg_mr_section(top, dir, idx, pt, adapter, mr); ehea_reg_mr_sections()
867 int dir; ehea_reg_mr_dir_sections() local
869 for (dir = 0; dir < EHEA_MAP_ENTRIES; dir++) { ehea_reg_mr_dir_sections()
870 if (!ehea_bmap->top[top]->dir[dir]) ehea_reg_mr_dir_sections()
873 hret = ehea_reg_mr_sections(top, dir, pt, adapter, mr); ehea_reg_mr_dir_sections()
560 ehea_init_top_bmap(struct ehea_top_bmap *ehea_top_bmap, int dir) ehea_init_top_bmap() argument
/linux-4.4.14/fs/ext4/
H A Dnamei.c252 static unsigned dx_root_limit(struct inode *dir, unsigned infosize);
253 static unsigned dx_node_limit(struct inode *dir);
255 struct inode *dir,
259 static int dx_make_map(struct inode *dir, struct ext4_dir_entry_2 *de,
268 static int ext4_htree_next_block(struct inode *dir, __u32 hash,
272 static struct buffer_head * ext4_dx_find_entry(struct inode *dir,
448 EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D."); ext4_dx_csum_verify()
477 EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D."); ext4_dx_csum_set()
555 static inline unsigned dx_root_limit(struct inode *dir, unsigned infosize) dx_root_limit() argument
557 unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(1) - dx_root_limit()
560 if (ext4_has_metadata_csum(dir->i_sb)) dx_root_limit()
565 static inline unsigned dx_node_limit(struct inode *dir) dx_node_limit() argument
567 unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(0); dx_node_limit()
569 if (ext4_has_metadata_csum(dir->i_sb)) dx_node_limit()
596 static struct stats dx_show_leaf(struct inode *dir, dx_show_leaf() argument
622 res = ext4_get_encryption_info(dir); dx_show_leaf()
685 struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir, dx_show_entries() argument
688 unsigned blocksize = dir->i_sb->s_blocksize; dx_show_entries()
700 bh = ext4_bread(NULL,dir, block, 0); dx_show_entries()
704 dx_show_entries(hinfo, dir, ((struct dx_node *) bh->b_data)->entries, levels - 1): dx_show_entries()
705 dx_show_leaf(dir, hinfo, (struct ext4_dir_entry_2 *) dx_show_entries()
730 dx_probe(struct ext4_filename *fname, struct inode *dir, dx_probe() argument
740 frame->bh = ext4_read_dirblock(dir, 0, INDEX); dx_probe()
748 ext4_warning_inode(dir, "Unrecognised inode hash code %u", dx_probe()
756 hinfo->hash_version += EXT4_SB(dir->i_sb)->s_hash_unsigned; dx_probe()
757 hinfo->seed = EXT4_SB(dir->i_sb)->s_hash_seed; dx_probe()
763 ext4_warning_inode(dir, "Unimplemented hash flags: %#06x", dx_probe()
770 ext4_warning_inode(dir, "Unimplemented hash depth: %#06x", dx_probe()
778 if (dx_get_limit(entries) != dx_root_limit(dir, dx_probe()
780 ext4_warning_inode(dir, "dx entry: limit %u != root limit %u", dx_probe()
782 dx_root_limit(dir, root->info.info_length)); dx_probe()
790 ext4_warning_inode(dir, dx_probe()
830 frame->bh = ext4_read_dirblock(dir, dx_get_block(at), INDEX); dx_probe()
838 if (dx_get_limit(entries) != dx_node_limit(dir)) { dx_probe()
839 ext4_warning_inode(dir, dx_probe()
841 dx_get_limit(entries), dx_node_limit(dir)); dx_probe()
852 ext4_warning_inode(dir, dx_probe()
884 static int ext4_htree_next_block(struct inode *dir, __u32 hash, ext4_htree_next_block() argument
930 bh = ext4_read_dirblock(dir, dx_get_block(p->at), INDEX); ext4_htree_next_block()
948 struct inode *dir, ext4_lblk_t block, htree_dirblock_to_tree()
959 bh = ext4_read_dirblock(dir, block, DIRENT); htree_dirblock_to_tree()
965 dir->i_sb->s_blocksize - htree_dirblock_to_tree()
969 if (ext4_encrypted_inode(dir)) { htree_dirblock_to_tree()
970 err = ext4_get_encryption_info(dir); htree_dirblock_to_tree()
975 err = ext4_fname_crypto_alloc_buffer(dir, EXT4_NAME_LEN, htree_dirblock_to_tree()
983 for (; de < top; de = ext4_next_entry(de, dir->i_sb->s_blocksize)) { htree_dirblock_to_tree()
984 if (ext4_check_dir_entry(dir, NULL, de, bh, htree_dirblock_to_tree()
986 (block<<EXT4_BLOCK_SIZE_BITS(dir->i_sb)) htree_dirblock_to_tree()
998 if (!ext4_encrypted_inode(dir)) { htree_dirblock_to_tree()
1008 err = ext4_fname_disk_to_usr(dir, hinfo, de, htree_dirblock_to_tree()
1048 struct inode *dir; ext4_htree_fill_tree() local
1057 dir = file_inode(dir_file); ext4_htree_fill_tree()
1058 if (!(ext4_test_inode_flag(dir, EXT4_INODE_INDEX))) { ext4_htree_fill_tree()
1059 hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; ext4_htree_fill_tree()
1062 EXT4_SB(dir->i_sb)->s_hash_unsigned; ext4_htree_fill_tree()
1063 hinfo.seed = EXT4_SB(dir->i_sb)->s_hash_seed; ext4_htree_fill_tree()
1064 if (ext4_has_inline_data(dir)) { ext4_htree_fill_tree()
1066 count = htree_inlinedir_to_tree(dir_file, dir, 0, ext4_htree_fill_tree()
1075 count = htree_dirblock_to_tree(dir_file, dir, 0, &hinfo, ext4_htree_fill_tree()
1082 frame = dx_probe(NULL, dir, &hinfo, frames); ext4_htree_fill_tree()
1099 de = ext4_next_entry(de, dir->i_sb->s_blocksize); ext4_htree_fill_tree()
1111 ret = htree_dirblock_to_tree(dir_file, dir, block, &hinfo, ext4_htree_fill_tree()
1119 ret = ext4_htree_next_block(dir, HASH_NB_ALWAYS, ext4_htree_fill_tree()
1145 struct inode *dir, search_dirblock()
1151 return ext4_search_dir(bh, bh->b_data, dir->i_sb->s_blocksize, dir, search_dirblock()
1163 static int dx_make_map(struct inode *dir, struct ext4_dir_entry_2 *de, dx_make_map() argument
1266 struct inode *dir, struct ext4_filename *fname, ext4_search_dir()
1289 if (ext4_check_dir_entry(dir, NULL, de, bh, ext4_search_dir()
1303 dir->i_sb->s_blocksize); ext4_search_dir()
1317 static int is_dx_internal_node(struct inode *dir, ext4_lblk_t block, is_dx_internal_node() argument
1320 struct super_block *sb = dir->i_sb; is_dx_internal_node()
1322 if (!is_dx(dir)) is_dx_internal_node()
1344 static struct buffer_head * ext4_find_entry (struct inode *dir, ext4_find_entry() argument
1364 sb = dir->i_sb; ext4_find_entry()
1369 retval = ext4_fname_setup_filename(dir, d_name, 1, &fname); ext4_find_entry()
1373 if (ext4_has_inline_data(dir)) { ext4_find_entry()
1375 ret = ext4_find_inline_entry(dir, &fname, d_name, res_dir, ext4_find_entry()
1394 if (is_dx(dir)) { ext4_find_entry()
1395 ret = ext4_dx_find_entry(dir, &fname, res_dir); ext4_find_entry()
1406 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); ext4_find_entry()
1407 start = EXT4_I(dir)->i_dir_start_lookup; ext4_find_entry()
1431 bh = ext4_getblk(NULL, dir, b++, 0); ext4_find_entry()
1450 EXT4_ERROR_INODE(dir, "reading directory lblock %lu", ext4_find_entry()
1456 !is_dx_internal_node(dir, block, ext4_find_entry()
1458 !ext4_dirent_csum_verify(dir, ext4_find_entry()
1460 EXT4_ERROR_INODE(dir, "checksumming directory " ext4_find_entry()
1466 i = search_dirblock(bh, dir, &fname, d_name, ext4_find_entry()
1469 EXT4_I(dir)->i_dir_start_lookup = block; ext4_find_entry()
1487 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); ext4_find_entry()
1501 static struct buffer_head * ext4_dx_find_entry(struct inode *dir, ext4_dx_find_entry() argument
1505 struct super_block * sb = dir->i_sb; ext4_dx_find_entry()
1515 frame = dx_probe(fname, dir, NULL, frames); ext4_dx_find_entry()
1520 bh = ext4_read_dirblock(dir, block, DIRENT); ext4_dx_find_entry()
1524 retval = search_dirblock(bh, dir, fname, d_name, ext4_dx_find_entry()
1536 retval = ext4_htree_next_block(dir, fname->hinfo.hash, frame, ext4_dx_find_entry()
1539 ext4_warning_inode(dir, ext4_dx_find_entry()
1555 static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) ext4_lookup() argument
1564 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); ext4_lookup()
1571 if (!ext4_valid_inum(dir->i_sb, ino)) { ext4_lookup()
1572 EXT4_ERROR_INODE(dir, "bad inode number: %u", ino); ext4_lookup()
1575 if (unlikely(ino == dir->i_ino)) { ext4_lookup()
1576 EXT4_ERROR_INODE(dir, "'%pd' linked to parent dir", ext4_lookup()
1580 inode = ext4_iget_normal(dir->i_sb, ino); ext4_lookup()
1582 EXT4_ERROR_INODE(dir, ext4_lookup()
1587 if (!IS_ERR(inode) && ext4_encrypted_inode(dir) && ext4_lookup()
1590 !ext4_is_child_context_consistent_with_parent(dir, ext4_lookup()
1595 (unsigned long) dir->i_ino, ext4_lookup()
1653 * Compact each dir entry in the range to the minimal rec_len.
1678 * Split a full leaf block to make room for a new dir entry.
1682 static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, do_split() argument
1686 unsigned blocksize = dir->i_sb->s_blocksize; do_split()
1699 if (ext4_has_metadata_csum(dir->i_sb)) do_split()
1702 bh2 = ext4_append(handle, dir, &newblock); do_split()
1723 count = dx_make_map(dir, (struct ext4_dir_entry_2 *) data1, do_split()
1763 dxtrace(dx_show_leaf(dir, hinfo, (struct ext4_dir_entry_2 *) data1, do_split()
1765 dxtrace(dx_show_leaf(dir, hinfo, (struct ext4_dir_entry_2 *) data2, do_split()
1774 err = ext4_handle_dirty_dirent_node(handle, dir, bh2); do_split()
1777 err = ext4_handle_dirty_dx_node(handle, dir, frame->bh); do_split()
1788 ext4_std_error(dir->i_sb, err); do_split()
1792 int ext4_find_dest_de(struct inode *dir, struct inode *inode, ext4_find_dest_de() argument
1808 if (ext4_check_dir_entry(dir, NULL, de, bh, ext4_find_dest_de()
1839 int ext4_insert_dentry(struct inode *dir, ext4_insert_dentry() argument
1874 struct inode *dir, add_dirent_to_buf()
1878 unsigned int blocksize = dir->i_sb->s_blocksize; add_dirent_to_buf()
1886 err = ext4_find_dest_de(dir, inode, bh, bh->b_data, add_dirent_to_buf()
1894 ext4_std_error(dir->i_sb, err); add_dirent_to_buf()
1900 err = ext4_insert_dentry(dir, inode, de, blocksize, fname); add_dirent_to_buf()
1915 dir->i_mtime = dir->i_ctime = ext4_current_time(dir); add_dirent_to_buf()
1916 ext4_update_dx_flag(dir); add_dirent_to_buf()
1917 dir->i_version++; add_dirent_to_buf()
1918 ext4_mark_inode_dirty(handle, dir); add_dirent_to_buf()
1920 err = ext4_handle_dirty_dirent_node(handle, dir, bh); add_dirent_to_buf()
1922 ext4_std_error(dir->i_sb, err); add_dirent_to_buf()
1934 struct inode *dir = d_inode(dentry->d_parent); make_indexed_dir() local
1952 blocksize = dir->i_sb->s_blocksize; make_indexed_dir()
1953 dxtrace(printk(KERN_DEBUG "Creating index: inode %lu\n", dir->i_ino)); make_indexed_dir()
1957 ext4_std_error(dir->i_sb, retval); make_indexed_dir()
1968 EXT4_ERROR_INODE(dir, "invalid rec_len for '..'"); make_indexed_dir()
1975 bh2 = ext4_append(handle, dir, &block); make_indexed_dir()
1980 ext4_set_inode_flag(dir, EXT4_INODE_INDEX); make_indexed_dir()
2003 root->info.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; make_indexed_dir()
2007 dx_set_limit(entries, dx_root_limit(dir, sizeof(root->info))); make_indexed_dir()
2012 fname->hinfo.hash_version += EXT4_SB(dir->i_sb)->s_hash_unsigned; make_indexed_dir()
2013 fname->hinfo.seed = EXT4_SB(dir->i_sb)->s_hash_seed; make_indexed_dir()
2023 retval = ext4_handle_dirty_dx_node(handle, dir, frame->bh); make_indexed_dir()
2026 retval = ext4_handle_dirty_dirent_node(handle, dir, bh); make_indexed_dir()
2030 de = do_split(handle,dir, &bh, frame, &fname->hinfo); make_indexed_dir()
2037 retval = add_dirent_to_buf(handle, fname, dir, inode, de, bh); make_indexed_dir()
2046 ext4_mark_inode_dirty(handle, dir); make_indexed_dir()
2064 struct inode *dir = d_inode(dentry->d_parent); ext4_add_entry() local
2079 sb = dir->i_sb; ext4_add_entry()
2084 retval = ext4_fname_setup_filename(dir, &dentry->d_name, 0, &fname); ext4_add_entry()
2088 if (ext4_has_inline_data(dir)) { ext4_add_entry()
2099 if (is_dx(dir)) { ext4_add_entry()
2103 ext4_clear_inode_flag(dir, EXT4_INODE_INDEX); ext4_add_entry()
2105 ext4_mark_inode_dirty(handle, dir); ext4_add_entry()
2107 blocks = dir->i_size >> sb->s_blocksize_bits; ext4_add_entry()
2109 bh = ext4_read_dirblock(dir, block, DIRENT); ext4_add_entry()
2115 retval = add_dirent_to_buf(handle, &fname, dir, inode, ext4_add_entry()
2129 bh = ext4_append(handle, dir, &block); ext4_add_entry()
2144 retval = add_dirent_to_buf(handle, &fname, dir, inode, de, bh); ext4_add_entry()
2162 struct inode *dir = d_inode(dentry->d_parent); ext4_dx_add_entry() local
2163 struct super_block *sb = dir->i_sb; ext4_dx_add_entry()
2167 frame = dx_probe(fname, dir, NULL, frames); ext4_dx_add_entry()
2172 bh = ext4_read_dirblock(dir, dx_get_block(frame->at), DIRENT); ext4_dx_add_entry()
2184 err = add_dirent_to_buf(handle, fname, dir, inode, NULL, bh); ext4_dx_add_entry()
2202 ext4_warning_inode(dir, "Directory index full!"); ext4_dx_add_entry()
2206 bh2 = ext4_append(handle, dir, &newblock); ext4_dx_add_entry()
2236 dx_set_limit(entries2, dx_node_limit(dir)); ext4_dx_add_entry()
2248 err = ext4_handle_dirty_dx_node(handle, dir, bh2); ext4_dx_add_entry()
2257 dx_set_limit(entries2, dx_node_limit(dir)); ext4_dx_add_entry()
2274 err = ext4_handle_dirty_dx_node(handle, dir, frames[0].bh); ext4_dx_add_entry()
2280 de = do_split(handle, dir, &bh, frame, &fname->hinfo); ext4_dx_add_entry()
2285 err = add_dirent_to_buf(handle, fname, dir, inode, de, bh); ext4_dx_add_entry()
2289 ext4_std_error(dir->i_sb, err); ext4_dx_add_entry()
2301 struct inode *dir, ext4_generic_delete_entry()
2309 unsigned int blocksize = dir->i_sb->s_blocksize; ext4_generic_delete_entry()
2316 if (ext4_check_dir_entry(dir, NULL, de, bh, ext4_generic_delete_entry()
2329 dir->i_version++; ext4_generic_delete_entry()
2340 struct inode *dir, ext4_delete_entry()
2346 if (ext4_has_inline_data(dir)) { ext4_delete_entry()
2348 err = ext4_delete_inline_entry(handle, dir, de_del, bh, ext4_delete_entry()
2354 if (ext4_has_metadata_csum(dir->i_sb)) ext4_delete_entry()
2362 err = ext4_generic_delete_entry(handle, dir, de_del, ext4_delete_entry()
2364 dir->i_sb->s_blocksize, csum_size); ext4_delete_entry()
2369 err = ext4_handle_dirty_dirent_node(handle, dir, bh); ext4_delete_entry()
2376 ext4_std_error(dir->i_sb, err); ext4_delete_entry()
2431 static int ext4_create(struct inode *dir, struct dentry *dentry, umode_t mode, ext4_create() argument
2438 err = dquot_initialize(dir); ext4_create()
2442 credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_create()
2445 inode = ext4_new_inode_start_handle(dir, mode, &dentry->d_name, 0, ext4_create()
2454 if (!err && IS_DIRSYNC(dir)) ext4_create()
2459 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_create()
2464 static int ext4_mknod(struct inode *dir, struct dentry *dentry, ext4_mknod() argument
2471 err = dquot_initialize(dir); ext4_mknod()
2475 credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_mknod()
2478 inode = ext4_new_inode_start_handle(dir, mode, &dentry->d_name, 0, ext4_mknod()
2486 if (!err && IS_DIRSYNC(dir)) ext4_mknod()
2491 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_mknod()
2496 static int ext4_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ext4_tmpfile() argument
2502 err = dquot_initialize(dir); ext4_tmpfile()
2507 inode = ext4_new_inode_start_handle(dir, mode, ext4_tmpfile()
2510 EXT4_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) + ext4_tmpfile()
2527 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_tmpfile()
2564 static int ext4_init_new_dir(handle_t *handle, struct inode *dir, ext4_init_new_dir() argument
2571 unsigned int blocksize = dir->i_sb->s_blocksize; ext4_init_new_dir()
2575 if (ext4_has_metadata_csum(dir->i_sb)) ext4_init_new_dir()
2579 err = ext4_try_create_inline_dir(handle, dir, inode); ext4_init_new_dir()
2591 ext4_init_dot_dotdot(inode, de, blocksize, csum_size, dir->i_ino, 0); ext4_init_new_dir()
2608 static int ext4_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ext4_mkdir() argument
2614 if (EXT4_DIR_LINK_MAX(dir)) ext4_mkdir()
2617 err = dquot_initialize(dir); ext4_mkdir()
2621 credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_mkdir()
2624 inode = ext4_new_inode_start_handle(dir, S_IFDIR | mode, ext4_mkdir()
2634 err = ext4_init_new_dir(handle, dir, inode); ext4_mkdir()
2648 ext4_inc_count(handle, dir); ext4_mkdir()
2649 ext4_update_dx_flag(dir); ext4_mkdir()
2650 err = ext4_mark_inode_dirty(handle, dir); ext4_mkdir()
2655 if (IS_DIRSYNC(dir)) ext4_mkdir()
2661 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_mkdir()
2907 static int ext4_rmdir(struct inode *dir, struct dentry *dentry) ext4_rmdir() argument
2917 retval = dquot_initialize(dir); ext4_rmdir()
2925 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); ext4_rmdir()
2941 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_rmdir()
2942 EXT4_DATA_TRANS_BLOCKS(dir->i_sb)); ext4_rmdir()
2949 if (IS_DIRSYNC(dir)) ext4_rmdir()
2952 retval = ext4_delete_entry(handle, dir, de, bh); ext4_rmdir()
2967 inode->i_ctime = dir->i_ctime = dir->i_mtime = ext4_current_time(inode); ext4_rmdir()
2969 ext4_dec_count(handle, dir); ext4_rmdir()
2970 ext4_update_dx_flag(dir); ext4_rmdir()
2971 ext4_mark_inode_dirty(handle, dir); ext4_rmdir()
2980 static int ext4_unlink(struct inode *dir, struct dentry *dentry) ext4_unlink() argument
2988 trace_ext4_unlink_enter(dir, dentry); ext4_unlink()
2991 retval = dquot_initialize(dir); ext4_unlink()
2999 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); ext4_unlink()
3011 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_unlink()
3012 EXT4_DATA_TRANS_BLOCKS(dir->i_sb)); ext4_unlink()
3019 if (IS_DIRSYNC(dir)) ext4_unlink()
3027 retval = ext4_delete_entry(handle, dir, de, bh); ext4_unlink()
3030 dir->i_ctime = dir->i_mtime = ext4_current_time(dir); ext4_unlink()
3031 ext4_update_dx_flag(dir); ext4_unlink()
3032 ext4_mark_inode_dirty(handle, dir); ext4_unlink()
3047 static int ext4_symlink(struct inode *dir, ext4_symlink() argument
3061 encryption_required = (ext4_encrypted_inode(dir) || ext4_symlink()
3062 DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))); ext4_symlink()
3064 err = ext4_get_encryption_info(dir); ext4_symlink()
3067 if (ext4_encryption_info(dir) == NULL) ext4_symlink()
3069 disk_link.len = (ext4_fname_encrypted_size(dir, len) + ext4_symlink()
3076 if (disk_link.len > dir->i_sb->s_blocksize) { ext4_symlink()
3081 err = dquot_initialize(dir); ext4_symlink()
3092 credits = 4 + EXT4_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) + ext4_symlink()
3101 credits = EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_symlink()
3105 inode = ext4_new_inode_start_handle(dir, S_IFLNK|S_IRWXUGO, ext4_symlink()
3156 * Now inode is being linked into dir (EXT4_DATA_TRANS_BLOCKS ext4_symlink()
3159 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_symlink()
3160 EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_symlink()
3184 if (!err && IS_DIRSYNC(dir)) ext4_symlink()
3203 struct inode *dir, struct dentry *dentry) ext4_link()
3211 if (ext4_encrypted_inode(dir) && ext4_link()
3212 !ext4_is_child_context_consistent_with_parent(dir, inode)) ext4_link()
3214 err = dquot_initialize(dir); ext4_link()
3219 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_link()
3220 (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_link()
3225 if (IS_DIRSYNC(dir)) ext4_link()
3246 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_link()
3255 * if it is a normal dir.
3282 struct inode *dir; member in struct:ext4_renament
3308 if (le32_to_cpu(ent->parent_de->inode) != ent->dir->i_ino) ext4_rename_dir_prepare()
3335 ext4_std_error(ent->dir->i_sb, retval); ext4_rename_dir_finish()
3351 if (ext4_has_feature_filetype(ent->dir->i_sb)) ext4_setent()
3353 ent->dir->i_version++; ext4_setent()
3354 ent->dir->i_ctime = ent->dir->i_mtime = ext4_setent()
3355 ext4_current_time(ent->dir); ext4_setent()
3356 ext4_mark_inode_dirty(handle, ent->dir); ext4_setent()
3360 ent->dir, ent->bh); ext4_setent()
3362 ext4_std_error(ent->dir->i_sb, retval); ext4_setent()
3372 static int ext4_find_delete_entry(handle_t *handle, struct inode *dir, ext4_find_delete_entry() argument
3379 bh = ext4_find_entry(dir, d_name, &de, NULL); ext4_find_delete_entry()
3383 retval = ext4_delete_entry(handle, dir, de, bh); ext4_find_delete_entry()
3404 retval = ext4_find_delete_entry(handle, ent->dir, ext4_rename_delete()
3407 retval = ext4_delete_entry(handle, ent->dir, ent->de, ent->bh); ext4_rename_delete()
3409 retval = ext4_find_delete_entry(handle, ent->dir, ext4_rename_delete()
3415 ext4_warning_inode(ent->dir, ext4_rename_delete()
3417 ent->dir->i_nlink, retval); ext4_rename_delete()
3425 ext4_dec_count(handle, ent->dir); ext4_update_dir_count()
3427 ext4_inc_count(handle, ent->dir); ext4_update_dir_count()
3428 ext4_mark_inode_dirty(handle, ent->dir); ext4_update_dir_count()
3443 credits += (EXT4_MAXQUOTAS_TRANS_BLOCKS(ent->dir->i_sb) + ext4_whiteout_for_rename()
3446 wh = ext4_new_inode_start_handle(ent->dir, S_IFCHR | WHITEOUT_MODE, ext4_whiteout_for_rename()
3455 ext4_should_retry_alloc(ent->dir->i_sb, &retries)) ext4_whiteout_for_rename()
3479 .dir = old_dir, ext4_rename()
3484 .dir = new_dir, ext4_rename()
3494 retval = dquot_initialize(old.dir); ext4_rename()
3497 retval = dquot_initialize(new.dir); ext4_rename()
3509 old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de, NULL); ext4_rename()
3522 if ((old.dir != new.dir) && ext4_rename()
3523 ext4_encrypted_inode(new.dir) && ext4_rename()
3524 !ext4_is_child_context_consistent_with_parent(new.dir, ext4_rename()
3530 new.bh = ext4_find_entry(new.dir, &new.dentry->d_name, ext4_rename()
3543 if (new.inode && !test_opt(new.dir->i_sb, NO_AUTO_DA_ALLOC)) ext4_rename()
3546 credits = (2 * EXT4_DATA_TRANS_BLOCKS(old.dir->i_sb) + ext4_rename()
3549 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits); ext4_rename()
3564 if (IS_DIRSYNC(old.dir) || IS_DIRSYNC(new.dir)) ext4_rename()
3574 if (new.dir != old.dir && EXT4_DIR_LINK_MAX(new.dir)) ext4_rename()
3582 * If we're renaming a file within an inline_data dir and adding or ext4_rename()
3588 force_reread = (new.dir->i_ino == old.dir->i_ino && ext4_rename()
3589 ext4_test_inode_flag(new.dir, EXT4_INODE_INLINE_DATA)); ext4_rename()
3614 force_reread = !ext4_test_inode_flag(new.dir, ext4_rename()
3635 old.dir->i_ctime = old.dir->i_mtime = ext4_current_time(old.dir); ext4_rename()
3636 ext4_update_dx_flag(old.dir); ext4_rename()
3638 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); ext4_rename()
3642 ext4_dec_count(handle, old.dir); ext4_rename()
3649 ext4_inc_count(handle, new.dir); ext4_rename()
3650 ext4_update_dx_flag(new.dir); ext4_rename()
3651 ext4_mark_inode_dirty(handle, new.dir); ext4_rename()
3654 ext4_mark_inode_dirty(handle, old.dir); ext4_rename()
3682 .dir = old_dir, ext4_cross_rename()
3687 .dir = new_dir, ext4_cross_rename()
3703 retval = dquot_initialize(old.dir); ext4_cross_rename()
3706 retval = dquot_initialize(new.dir); ext4_cross_rename()
3710 old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, ext4_cross_rename()
3724 new.bh = ext4_find_entry(new.dir, &new.dentry->d_name, ext4_cross_rename()
3736 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, ext4_cross_rename()
3737 (2 * EXT4_DATA_TRANS_BLOCKS(old.dir->i_sb) + ext4_cross_rename()
3745 if (IS_DIRSYNC(old.dir) || IS_DIRSYNC(new.dir)) ext4_cross_rename()
3765 if (old.dir != new.dir && old.is_dir != new.is_dir) { ext4_cross_rename()
3769 if ((old.dir_nlink_delta > 0 && EXT4_DIR_LINK_MAX(old.dir)) || ext4_cross_rename()
3770 (new.dir_nlink_delta > 0 && EXT4_DIR_LINK_MAX(new.dir))) ext4_cross_rename()
3793 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); ext4_cross_rename()
3798 retval = ext4_rename_dir_finish(handle, &new, old.dir->i_ino); ext4_cross_rename()
947 htree_dirblock_to_tree(struct file *dir_file, struct inode *dir, ext4_lblk_t block, struct dx_hash_info *hinfo, __u32 start_hash, __u32 start_minor_hash) htree_dirblock_to_tree() argument
1144 search_dirblock(struct buffer_head *bh, struct inode *dir, struct ext4_filename *fname, const struct qstr *d_name, unsigned int offset, struct ext4_dir_entry_2 **res_dir) search_dirblock() argument
1265 ext4_search_dir(struct buffer_head *bh, char *search_buf, int buf_size, struct inode *dir, struct ext4_filename *fname, const struct qstr *d_name, unsigned int offset, struct ext4_dir_entry_2 **res_dir) ext4_search_dir() argument
1873 add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, struct inode *dir, struct inode *inode, struct ext4_dir_entry_2 *de, struct buffer_head *bh) add_dirent_to_buf() argument
2300 ext4_generic_delete_entry(handle_t *handle, struct inode *dir, struct ext4_dir_entry_2 *de_del, struct buffer_head *bh, void *entry_buf, int buf_size, int csum_size) ext4_generic_delete_entry() argument
2339 ext4_delete_entry(handle_t *handle, struct inode *dir, struct ext4_dir_entry_2 *de_del, struct buffer_head *bh) ext4_delete_entry() argument
3202 ext4_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) ext4_link() argument
H A Dinline.c964 void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh, ext4_show_inline_dir() argument
972 trace_printk("inode %lu\n", dir->i_ino); ext4_show_inline_dir()
979 if (ext4_check_dir_entry(dir, NULL, de, bh, ext4_show_inline_dir()
988 #define ext4_show_inline_dir(dir, bh, inline_start, inline_size)
992 * Add a new entry into a inline dir.
1003 struct inode *dir = d_inode(dentry->d_parent); ext4_add_dirent_to_inline() local
1007 err = ext4_find_dest_de(dir, inode, iloc->bh, inline_start, ext4_add_dirent_to_inline()
1016 ext4_insert_dentry(dir, inode, de, inline_size, fname); ext4_add_dirent_to_inline()
1018 ext4_show_inline_dir(dir, iloc->bh, inline_start, inline_size); ext4_add_dirent_to_inline()
1031 dir->i_mtime = dir->i_ctime = ext4_current_time(dir); ext4_add_dirent_to_inline()
1032 ext4_update_dx_flag(dir); ext4_add_dirent_to_inline()
1033 dir->i_version++; ext4_add_dirent_to_inline()
1034 ext4_mark_inode_dirty(handle, dir); ext4_add_dirent_to_inline()
1079 static int ext4_update_inline_dir(handle_t *handle, struct inode *dir, ext4_update_inline_dir() argument
1083 int old_size = EXT4_I(dir)->i_inline_size - EXT4_MIN_INLINE_DATA_SIZE; ext4_update_inline_dir()
1084 int new_size = get_max_inline_xattr_value_size(dir, iloc); ext4_update_inline_dir()
1089 ret = ext4_update_inline_data(handle, dir, ext4_update_inline_dir()
1094 ext4_update_final_de(ext4_get_inline_xattr_pos(dir, iloc), old_size, ext4_update_inline_dir()
1095 EXT4_I(dir)->i_inline_size - ext4_update_inline_dir()
1097 dir->i_size = EXT4_I(dir)->i_disksize = EXT4_I(dir)->i_inline_size; ext4_update_inline_dir()
1122 * First create "." and ".." and then copy the dir information ext4_finish_convert_inline_dir()
1244 * If succeeds, return 0. If not, extended the inline dir and copied data to
1253 struct inode *dir = d_inode(dentry->d_parent); ext4_try_add_inline_entry() local
1255 ret = ext4_get_inode_loc(dir, &iloc); ext4_try_add_inline_entry()
1259 down_write(&EXT4_I(dir)->xattr_sem); ext4_try_add_inline_entry()
1260 if (!ext4_has_inline_data(dir)) ext4_try_add_inline_entry()
1273 inline_size = EXT4_I(dir)->i_inline_size - ext4_try_add_inline_entry()
1277 ret = ext4_update_inline_dir(handle, dir, &iloc); ext4_try_add_inline_entry()
1281 inline_size = EXT4_I(dir)->i_inline_size - ext4_try_add_inline_entry()
1286 inline_start = ext4_get_inline_xattr_pos(dir, &iloc); ext4_try_add_inline_entry()
1299 * dir first. ext4_try_add_inline_entry()
1301 ret = ext4_convert_inline_data_nolock(handle, dir, &iloc); ext4_try_add_inline_entry()
1304 ext4_mark_inode_dirty(handle, dir); ext4_try_add_inline_entry()
1305 up_write(&EXT4_I(dir)->xattr_sem); ext4_try_add_inline_entry()
1312 * inlined dir. It returns the number directory entries loaded
1316 struct inode *dir, ext4_lblk_t block, htree_inlinedir_to_tree()
1360 * As inlined dir doesn't store any information about '.' and htree_inlinedir_to_tree()
1422 * after we convert from an inlined dir to a blocked based,
1423 * we just pretend that we are a normal dir and return the
1472 * size for ".." and "." if the dir is block based while ext4_read_inline_dir()
1475 * during the inline dir iteration. ext4_read_inline_dir()
1486 * dir to make sure. ext4_read_inline_dir()
1573 * Try to create the inline data for the new dir.
1575 * In case of ENOSPC, the caller should create the normal disk layout dir.
1593 * For inline dir, we only save the inode information for the ".." ext4_try_create_inline_dir()
1610 struct buffer_head *ext4_find_inline_entry(struct inode *dir, ext4_find_inline_entry() argument
1621 if (ext4_get_inode_loc(dir, &iloc)) ext4_find_inline_entry()
1624 down_read(&EXT4_I(dir)->xattr_sem); ext4_find_inline_entry()
1625 if (!ext4_has_inline_data(dir)) { ext4_find_inline_entry()
1634 dir, fname, d_name, 0, res_dir); ext4_find_inline_entry()
1640 if (ext4_get_inline_size(dir) == EXT4_MIN_INLINE_DATA_SIZE) ext4_find_inline_entry()
1643 inline_start = ext4_get_inline_xattr_pos(dir, &iloc); ext4_find_inline_entry()
1644 inline_size = ext4_get_inline_size(dir) - EXT4_MIN_INLINE_DATA_SIZE; ext4_find_inline_entry()
1647 dir, fname, d_name, 0, res_dir); ext4_find_inline_entry()
1655 up_read(&EXT4_I(dir)->xattr_sem); ext4_find_inline_entry()
1660 struct inode *dir, ext4_delete_inline_entry()
1669 err = ext4_get_inode_loc(dir, &iloc); ext4_delete_inline_entry()
1673 down_write(&EXT4_I(dir)->xattr_sem); ext4_delete_inline_entry()
1674 if (!ext4_has_inline_data(dir)) { ext4_delete_inline_entry()
1686 inline_start = ext4_get_inline_xattr_pos(dir, &iloc); ext4_delete_inline_entry()
1687 inline_size = ext4_get_inline_size(dir) - ext4_delete_inline_entry()
1696 err = ext4_generic_delete_entry(handle, dir, de_del, bh, ext4_delete_inline_entry()
1702 err = ext4_mark_inode_dirty(handle, dir); ext4_delete_inline_entry()
1706 ext4_show_inline_dir(dir, iloc.bh, inline_start, inline_size); ext4_delete_inline_entry()
1708 up_write(&EXT4_I(dir)->xattr_sem); ext4_delete_inline_entry()
1711 ext4_std_error(dir->i_sb, err); ext4_delete_inline_entry()
1744 int empty_inline_dir(struct inode *dir, int *has_inline_data) empty_inline_dir() argument
1753 err = ext4_get_inode_loc(dir, &iloc); empty_inline_dir()
1755 EXT4_ERROR_INODE(dir, "error %d getting inode %lu block", empty_inline_dir()
1756 err, dir->i_ino); empty_inline_dir()
1760 down_read(&EXT4_I(dir)->xattr_sem); empty_inline_dir()
1761 if (!ext4_has_inline_data(dir)) { empty_inline_dir()
1768 ext4_warning(dir->i_sb, empty_inline_dir()
1769 "bad inline directory (dir #%lu) - no `..'", empty_inline_dir()
1770 dir->i_ino); empty_inline_dir()
1776 while (offset < dir->i_size) { empty_inline_dir()
1777 de = ext4_get_inline_entry(dir, &iloc, offset, empty_inline_dir()
1779 if (ext4_check_dir_entry(dir, NULL, de, empty_inline_dir()
1782 ext4_warning(dir->i_sb, empty_inline_dir()
1783 "bad inline directory (dir #%lu) - " empty_inline_dir()
1786 dir->i_ino, le32_to_cpu(de->inode), empty_inline_dir()
1800 up_read(&EXT4_I(dir)->xattr_sem); empty_inline_dir()
1315 htree_inlinedir_to_tree(struct file *dir_file, struct inode *dir, ext4_lblk_t block, struct dx_hash_info *hinfo, __u32 start_hash, __u32 start_minor_hash, int *has_inline_data) htree_inlinedir_to_tree() argument
1659 ext4_delete_inline_entry(handle_t *handle, struct inode *dir, struct ext4_dir_entry_2 *de_del, struct buffer_head *bh, int *has_inline_data) ext4_delete_inline_entry() argument
H A DMakefile7 ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o page-io.o \
/linux-4.4.14/Documentation/mic/mpssd/
H A Dsysfs.c26 readsysfs(char *dir, char *entry) readsysfs() argument
34 if (dir == NULL) readsysfs()
38 "%s/%s/%s", MICSYSFSDIR, dir, entry); readsysfs()
68 setsysfs(char *dir, char *entry, char *value) setsysfs() argument
74 if (dir == NULL) setsysfs()
78 MICSYSFSDIR, dir, entry); setsysfs()
80 oldvalue = readsysfs(dir, entry); setsysfs()
/linux-4.4.14/arch/sh/boot/compressed/
H A DMakefile46 lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib
48 lib1funcs-dir := $(addsuffix $(BITS), $(lib1funcs-dir))
51 KBUILD_CFLAGS += -I$(lib1funcs-dir)
53 $(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
/linux-4.4.14/arch/mips/mm/
H A Dsc-debugfs.c65 struct dentry *dir, *file; sc_debugfs_init() local
70 dir = debugfs_create_dir("l2cache", mips_debugfs_dir); sc_debugfs_init()
71 if (IS_ERR(dir)) sc_debugfs_init()
72 return PTR_ERR(dir); sc_debugfs_init()
74 file = debugfs_create_file("prefetch", S_IRUGO | S_IWUSR, dir, sc_debugfs_init()
/linux-4.4.14/fs/cachefiles/
H A Dnamei.c268 struct dentry *dir, cachefiles_bury_object()
278 _enter(",'%pd','%pd'", dir, rep); cachefiles_bury_object()
280 _debug("remove %p from %p", rep, dir); cachefiles_bury_object()
287 path.dentry = dir; cachefiles_bury_object()
292 ret = vfs_unlink(d_inode(dir), rep, NULL); cachefiles_bury_object()
298 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_bury_object()
309 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_bury_object()
318 trap = lock_rename(cache->graveyard, dir); cachefiles_bury_object()
321 if (rep->d_parent != dir) { cachefiles_bury_object()
322 /* the entry was probably culled when we dropped the parent dir cachefiles_bury_object()
324 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
330 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
336 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
342 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
349 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
362 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
370 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
378 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
386 path.dentry = dir; cachefiles_bury_object()
393 ret = vfs_rename(d_inode(dir), rep, cachefiles_bury_object()
403 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
415 struct dentry *dir; cachefiles_delete_object() local
424 dir = dget_parent(object->dentry); cachefiles_delete_object()
426 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); cachefiles_delete_object()
432 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_delete_object()
437 if (dir == object->dentry->d_parent) { cachefiles_delete_object()
438 ret = cachefiles_bury_object(cache, dir, cachefiles_delete_object()
445 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_delete_object()
450 dput(dir); cachefiles_delete_object()
465 struct dentry *dir, *next = NULL; cachefiles_walk_to_object() local
483 // TODO: convert file to dir cachefiles_walk_to_object()
488 dir = dget(parent->dentry); cachefiles_walk_to_object()
504 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); cachefiles_walk_to_object()
507 next = lookup_one_len(name, dir, nlen); cachefiles_walk_to_object()
531 path.dentry = dir; cachefiles_walk_to_object()
536 ret = vfs_mkdir(d_inode(dir), next, 0); cachefiles_walk_to_object()
560 path.dentry = dir; cachefiles_walk_to_object()
565 ret = vfs_create(d_inode(dir), next, S_IFREG, true); cachefiles_walk_to_object()
588 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_walk_to_object()
589 dput(dir); cachefiles_walk_to_object()
590 dir = next; cachefiles_walk_to_object()
609 ret = cachefiles_bury_object(cache, dir, next, true, cachefiles_walk_to_object()
626 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_walk_to_object()
627 dput(dir); cachefiles_walk_to_object()
628 dir = NULL; cachefiles_walk_to_object()
708 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_walk_to_object()
711 dput(dir); cachefiles_walk_to_object()
721 struct dentry *dir, cachefiles_get_directory()
732 mutex_lock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
735 subdir = lookup_one_len(dirname, dir, strlen(dirname)); cachefiles_get_directory()
755 path.dentry = dir; cachefiles_get_directory()
759 ret = vfs_mkdir(d_inode(dir), subdir, 0700); cachefiles_get_directory()
771 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
803 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
809 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
815 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
827 struct dentry *dir, cachefiles_check_active()
837 // dir, filename); cachefiles_check_active()
840 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); cachefiles_check_active()
843 victim = lookup_one_len(filename, dir, strlen(filename)); cachefiles_check_active()
855 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_active()
884 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_active()
890 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_active()
893 /* file or dir now absent - probably retired by netfs */ cachefiles_check_active()
913 int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir, cachefiles_cull() argument
919 _enter(",%pd/,%s", dir, filename); cachefiles_cull()
921 victim = cachefiles_check_active(cache, dir, filename); cachefiles_cull()
937 /* actually remove the victim (drops the dir mutex) */ cachefiles_cull()
940 ret = cachefiles_bury_object(cache, dir, victim, false, cachefiles_cull()
950 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_cull()
954 /* file or dir now absent - probably retired by netfs */ cachefiles_cull()
973 int cachefiles_check_in_use(struct cachefiles_cache *cache, struct dentry *dir, cachefiles_check_in_use() argument
979 // dir, filename); cachefiles_check_in_use()
981 victim = cachefiles_check_active(cache, dir, filename); cachefiles_check_in_use()
985 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_in_use()
267 cachefiles_bury_object(struct cachefiles_cache *cache, struct dentry *dir, struct dentry *rep, bool preemptive, enum fscache_why_object_killed why) cachefiles_bury_object() argument
720 cachefiles_get_directory(struct cachefiles_cache *cache, struct dentry *dir, const char *dirname) cachefiles_get_directory() argument
826 cachefiles_check_active(struct cachefiles_cache *cache, struct dentry *dir, char *filename) cachefiles_check_active() argument
/linux-4.4.14/net/netfilter/
H A Dnf_conntrack_seqadj.c12 enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); nf_ct_seqadj_init() local
22 this_way = &seqadj->seq[dir]; nf_ct_seqadj_init()
33 enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); nf_ct_seqadj_set() local
47 this_way = &seqadj->seq[dir]; nf_ct_seqadj_set()
122 unsigned int dir, optoff, optend; nf_ct_sack_adjust() local
131 dir = CTINFO2DIR(ctinfo); nf_ct_sack_adjust()
154 &seqadj->seq[!dir]); nf_ct_sack_adjust()
166 enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); nf_ct_seq_adjust() local
174 this_way = &seqadj->seq[dir]; nf_ct_seq_adjust()
175 other_way = &seqadj->seq[!dir]; nf_ct_seq_adjust()
215 enum ip_conntrack_dir dir, nf_ct_seq_offset()
224 this_way = &seqadj->seq[dir]; nf_ct_seq_offset()
214 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir dir, u32 seq) nf_ct_seq_offset() argument
H A Dnf_nat_sip.c98 enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); map_addr() local
105 if (nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.src.u3, addr) && map_addr()
106 ct->tuplehash[dir].tuple.src.u.udp.port == port) { map_addr()
107 newaddr = ct->tuplehash[!dir].tuple.dst.u3; map_addr()
108 newport = ct->tuplehash[!dir].tuple.dst.u.udp.port; map_addr()
109 } else if (nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.dst.u3, addr) && map_addr()
110 ct->tuplehash[dir].tuple.dst.u.udp.port == port) { map_addr()
111 newaddr = ct->tuplehash[!dir].tuple.src.u3; map_addr()
113 ct->tuplehash[!dir].tuple.src.u.udp.port; map_addr()
149 enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); nf_nat_sip() local
187 &ct->tuplehash[dir].tuple.src.u3) || nf_nat_sip()
188 port != ct->tuplehash[dir].tuple.src.u.udp.port) nf_nat_sip()
192 &ct->tuplehash[dir].tuple.dst.u3) || nf_nat_sip()
193 port != ct->tuplehash[dir].tuple.dst.u.udp.port) nf_nat_sip()
211 nf_inet_addr_cmp(&addr, &ct->tuplehash[dir].tuple.src.u3) && nf_nat_sip()
212 !nf_inet_addr_cmp(&addr, &ct->tuplehash[!dir].tuple.dst.u3)) { nf_nat_sip()
214 &ct->tuplehash[!dir].tuple.dst.u3, nf_nat_sip()
228 nf_inet_addr_cmp(&addr, &ct->tuplehash[dir].tuple.dst.u3) && nf_nat_sip()
229 !nf_inet_addr_cmp(&addr, &ct->tuplehash[!dir].tuple.src.u3)) { nf_nat_sip()
231 &ct->tuplehash[!dir].tuple.src.u3, nf_nat_sip()
245 htons(n) == ct->tuplehash[dir].tuple.dst.u.udp.port && nf_nat_sip()
246 htons(n) != ct->tuplehash[!dir].tuple.src.u.udp.port) { nf_nat_sip()
247 __be16 p = ct->tuplehash[!dir].tuple.src.u.udp.port; nf_nat_sip()
280 if (dir == IP_CT_DIR_REPLY && ct_sip_info->forced_dport) { nf_nat_sip()
333 &ct->master->tuplehash[exp->dir].tuple.src.u3)) { nf_nat_sip_expected()
336 = ct->master->tuplehash[!exp->dir].tuple.dst.u3; nf_nat_sip_expected()
350 enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); nf_nat_sip_expect() local
359 if (nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.src.u3, nf_nat_sip_expect()
360 &ct->tuplehash[!dir].tuple.dst.u3)) nf_nat_sip_expect()
363 newaddr = ct->tuplehash[!dir].tuple.dst.u3; nf_nat_sip_expect()
369 ct->tuplehash[dir].tuple.src.u.udp.port; nf_nat_sip_expect()
371 port = ntohs(ct->tuplehash[!dir].tuple.dst.u.udp.port); nf_nat_sip_expect()
378 exp->dir = !dir; nf_nat_sip_expect()
550 enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); nf_nat_sdp_media() local
554 if (nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.src.u3, nf_nat_sdp_media()
555 &ct->tuplehash[!dir].tuple.dst.u3)) nf_nat_sdp_media()
558 *rtp_addr = ct->tuplehash[!dir].tuple.dst.u3; nf_nat_sdp_media()
563 rtp_exp->dir = !dir; nf_nat_sdp_media()
569 rtcp_exp->dir = !dir; nf_nat_sdp_media()
H A Dnf_conntrack_ftp.c349 static int find_nl_seq(u32 seq, const struct nf_ct_ftp_master *info, int dir) find_nl_seq() argument
353 for (i = 0; i < info->seq_aft_nl_num[dir]; i++) find_nl_seq()
354 if (info->seq_aft_nl[dir][i] == seq) find_nl_seq()
361 struct nf_ct_ftp_master *info, int dir, update_nl_seq()
367 for (i = 0; i < info->seq_aft_nl_num[dir]; i++) { update_nl_seq()
368 if (info->seq_aft_nl[dir][i] == nl_seq) update_nl_seq()
372 if (info->seq_aft_nl_num[dir] < NUM_SEQ_TO_REMEMBER) { update_nl_seq()
373 info->seq_aft_nl[dir][info->seq_aft_nl_num[dir]++] = nl_seq; update_nl_seq()
375 if (before(info->seq_aft_nl[dir][0], info->seq_aft_nl[dir][1])) update_nl_seq()
380 if (after(nl_seq, info->seq_aft_nl[dir][oldest])) update_nl_seq()
381 info->seq_aft_nl[dir][oldest] = nl_seq; update_nl_seq()
396 int dir = CTINFO2DIR(ctinfo); help() local
434 if (!find_nl_seq(ntohl(th->seq), ct_ftp_info, dir)) { help()
436 if (unlikely(ct_ftp_info->flags[dir] & NF_CT_FTP_SEQ_PICKUP)) { help()
437 ct_ftp_info->flags[dir] ^= NF_CT_FTP_SEQ_PICKUP; help()
443 ct_ftp_info->seq_aft_nl_num[dir] > 0 ? "" : "(UNSET)", help()
444 ct_ftp_info->seq_aft_nl[dir][0], help()
445 ct_ftp_info->seq_aft_nl_num[dir] > 1 ? "" : "(UNSET)", help()
446 ct_ftp_info->seq_aft_nl[dir][1]); help()
455 memcpy(cmd.u3.all, &ct->tuplehash[dir].tuple.src.u3.all, help()
458 for (i = 0; i < ARRAY_SIZE(search[dir]); i++) { help()
460 search[dir][i].pattern, help()
461 search[dir][i].plen, help()
462 search[dir][i].skip, help()
463 search[dir][i].term, help()
466 search[dir][i].getnum); help()
475 search[dir][i].pattern); help()
494 /* We refer to the reverse direction ("!dir") tuples here, help()
497 daddr = &ct->tuplehash[!dir].tuple.dst.u3; help()
501 memcmp(&cmd.u3.all, &ct->tuplehash[dir].tuple.src.u3.all, help()
510 &ct->tuplehash[dir].tuple.src.u3.ip); help()
514 ct->tuplehash[dir].tuple.src.u3.ip6); help()
529 &ct->tuplehash[!dir].tuple.src.u3, daddr, help()
536 ret = nf_nat_ftp(skb, ctinfo, search[dir][i].ftptype, help()
554 update_nl_seq(ct, seq, ct_ftp_info, dir, skb); help()
360 update_nl_seq(struct nf_conn *ct, u32 nl_seq, struct nf_ct_ftp_master *info, int dir, struct sk_buff *skb) update_nl_seq() argument
H A Dnf_conntrack_h323_main.c124 int dir = CTINFO2DIR(ctinfo); get_tpkt_data() local
155 if (info->tpkt_len[dir] > 0) { get_tpkt_data()
158 "bytes\n", info->tpkt_len[dir]); get_tpkt_data()
159 if (info->tpkt_len[dir] <= tcpdatalen) { get_tpkt_data()
163 *datalen = info->tpkt_len[dir]; get_tpkt_data()
199 info->tpkt_len[dir] = tpktlen - 4; get_tpkt_data()
214 info->tpkt_len[dir] = 0; get_tpkt_data()
218 info->tpkt_len[dir] = 0; get_tpkt_data()
264 int dir = CTINFO2DIR(ctinfo); expect_rtp_rtcp() local
275 memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) || expect_rtp_rtcp()
287 &ct->tuplehash[!dir].tuple.src.u3, expect_rtp_rtcp()
288 &ct->tuplehash[!dir].tuple.dst.u3, expect_rtp_rtcp()
297 &ct->tuplehash[!dir].tuple.src.u3, expect_rtp_rtcp()
298 &ct->tuplehash[!dir].tuple.dst.u3, expect_rtp_rtcp()
301 if (memcmp(&ct->tuplehash[dir].tuple.src.u3, expect_rtp_rtcp()
302 &ct->tuplehash[!dir].tuple.dst.u3, expect_rtp_rtcp()
303 sizeof(ct->tuplehash[dir].tuple.src.u3)) && expect_rtp_rtcp()
339 int dir = CTINFO2DIR(ctinfo); expect_t120() local
348 memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) || expect_t120()
356 &ct->tuplehash[!dir].tuple.src.u3, expect_t120()
357 &ct->tuplehash[!dir].tuple.dst.u3, expect_t120()
361 if (memcmp(&ct->tuplehash[dir].tuple.src.u3, expect_t120()
362 &ct->tuplehash[!dir].tuple.dst.u3, expect_t120()
363 sizeof(ct->tuplehash[dir].tuple.src.u3)) && expect_t120()
685 int dir = CTINFO2DIR(ctinfo); expect_h245() local
694 memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) || expect_h245()
702 &ct->tuplehash[!dir].tuple.src.u3, expect_h245()
703 &ct->tuplehash[!dir].tuple.dst.u3, expect_h245()
707 if (memcmp(&ct->tuplehash[dir].tuple.src.u3, expect_h245()
708 &ct->tuplehash[!dir].tuple.dst.u3, expect_h245()
709 sizeof(ct->tuplehash[dir].tuple.src.u3)) && expect_h245()
806 int dir = CTINFO2DIR(ctinfo); expect_callforwarding() local
821 callforward_do_filter(net, &addr, &ct->tuplehash[!dir].tuple.src.u3, expect_callforwarding()
831 &ct->tuplehash[!dir].tuple.src.u3, &addr, expect_callforwarding()
835 if (memcmp(&ct->tuplehash[dir].tuple.src.u3, expect_callforwarding()
836 &ct->tuplehash[!dir].tuple.dst.u3, expect_callforwarding()
837 sizeof(ct->tuplehash[dir].tuple.src.u3)) && expect_callforwarding()
865 int dir = CTINFO2DIR(ctinfo); process_setup() local
887 memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) { process_setup()
889 &addr, ntohs(port), &ct->tuplehash[!dir].tuple.src.u3, process_setup()
890 ntohs(ct->tuplehash[!dir].tuple.src.u.tcp.port)); process_setup()
893 &ct->tuplehash[!dir].tuple.src.u3, process_setup()
894 ct->tuplehash[!dir].tuple.src.u.tcp.port); process_setup()
904 memcmp(&addr, &ct->tuplehash[!dir].tuple.dst.u3, sizeof(addr))) { process_setup()
906 &addr, ntohs(port), &ct->tuplehash[!dir].tuple.dst.u3, process_setup()
907 ntohs(ct->tuplehash[!dir].tuple.dst.u.tcp.port)); process_setup()
910 &ct->tuplehash[!dir].tuple.dst.u3, process_setup()
911 ct->tuplehash[!dir].tuple.dst.u.tcp.port); process_setup()
1295 int dir = CTINFO2DIR(ctinfo); expect_q931() local
1306 memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, expect_q931()
1319 &ct->tuplehash[!dir].tuple.src.u3 : NULL, expect_q931()
1320 &ct->tuplehash[!dir].tuple.dst.u3, expect_q931()
1336 info->sig_port[dir] = port; expect_q931()
1370 int dir = CTINFO2DIR(ctinfo); process_gcf() local
1382 if (!memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) && process_gcf()
1383 port == ct->tuplehash[dir].tuple.src.u.udp.port) process_gcf()
1394 &ct->tuplehash[!dir].tuple.src.u3, &addr, process_gcf()
1453 int dir = CTINFO2DIR(ctinfo); process_rcf() local
1482 exp = find_expect(ct, &ct->tuplehash[dir].tuple.dst.u3, process_rcf()
1483 info->sig_port[!dir]); process_rcf()
1504 int dir = CTINFO2DIR(ctinfo); process_urq() local
1522 info->sig_port[dir] = 0; process_urq()
1523 info->sig_port[!dir] = 0; process_urq()
1538 int dir = CTINFO2DIR(ctinfo); process_arq() local
1549 !memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) && process_arq()
1550 port == info->sig_port[dir] && process_arq()
1556 &ct->tuplehash[!dir].tuple.dst.u3, process_arq()
1557 info->sig_port[!dir]); process_arq()
1563 !memcmp(&addr, &ct->tuplehash[dir].tuple.src.u3, sizeof(addr)) && process_arq()
1569 &ct->tuplehash[!dir].tuple.dst.u3, process_arq()
1582 int dir = CTINFO2DIR(ctinfo); process_acf() local
1595 if (!memcmp(&addr, &ct->tuplehash[dir].tuple.dst.u3, sizeof(addr))) { process_acf()
1609 &ct->tuplehash[!dir].tuple.src.u3, &addr, process_acf()
1649 int dir = CTINFO2DIR(ctinfo); process_lcf() local
1665 &ct->tuplehash[!dir].tuple.src.u3, &addr, process_lcf()
/linux-4.4.14/tools/lib/api/
H A DMakefile5 srctree := $(patsubst %/,%,$(dir $(shell pwd)))
6 srctree := $(patsubst %/,%,$(dir $(srctree)))
7 srctree := $(patsubst %/,%,$(dir $(srctree)))
/linux-4.4.14/drivers/gpio/
H A Dgpio-clps711x.c21 void __iomem *dat, *dir; clps711x_gpio_probe() local
39 dir = devm_ioremap_resource(&pdev->dev, res); clps711x_gpio_probe()
40 if (IS_ERR(dir)) clps711x_gpio_probe()
41 return PTR_ERR(dir); clps711x_gpio_probe()
47 NULL, dir, 0); clps711x_gpio_probe()
51 dir, NULL, 0); clps711x_gpio_probe()
/linux-4.4.14/drivers/net/wireless/brcm80211/brcmfmac/
H A Dtracepoint.h124 TP_PROTO(u8 dir, void *data),
125 TP_ARGS(dir, data),
127 __field(u8, dir)
129 __dynamic_array(u8, hdr, dir == SDPCM_GLOM ? 20 : 12)
132 memcpy(__get_dynamic_array(hdr), data, dir == SDPCM_GLOM ? 20 : 12);
134 __entry->dir = dir;
137 __entry->dir == SDPCM_RX ? "RX" : "TX",
/linux-4.4.14/include/uapi/drm/
H A Darmada_drm.h16 #define ARMADA_IOCTL(dir, name, str) \
17 DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
/linux-4.4.14/arch/mips/loongson64/common/
H A Ddma-swiotlb.c51 enum dma_data_direction dir, loongson_dma_map_page()
55 dir, attrs); loongson_dma_map_page()
61 int nents, enum dma_data_direction dir, loongson_dma_map_sg()
64 int r = swiotlb_map_sg_attrs(dev, sg, nents, dir, NULL); loongson_dma_map_sg()
72 enum dma_data_direction dir) loongson_dma_sync_single_for_device()
74 swiotlb_sync_single_for_device(dev, dma_handle, size, dir); loongson_dma_sync_single_for_device()
80 enum dma_data_direction dir) loongson_dma_sync_sg_for_device()
82 swiotlb_sync_sg_for_device(dev, sg, nents, dir); loongson_dma_sync_sg_for_device()
49 loongson_dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) loongson_dma_map_page() argument
60 loongson_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) loongson_dma_map_sg() argument
70 loongson_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) loongson_dma_sync_single_for_device() argument
78 loongson_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) loongson_dma_sync_sg_for_device() argument
/linux-4.4.14/sound/firewire/
H A Dfcp.h18 enum avc_general_plug_dir dir,
21 enum avc_general_plug_dir dir,
/linux-4.4.14/sound/firewire/oxfw/
H A Doxfw.h81 int avc_stream_set_format(struct fw_unit *unit, enum avc_general_plug_dir dir,
84 enum avc_general_plug_dir dir, unsigned int pid,
88 enum avc_general_plug_dir dir, unsigned int pid, avc_stream_get_format_single()
91 return avc_stream_get_format(unit, dir, pid, buf, len, 0xff); avc_stream_get_format_single()
95 enum avc_general_plug_dir dir, unsigned int pid, avc_stream_get_format_list()
99 return avc_stream_get_format(unit, dir, pid, buf, len, eid); avc_stream_get_format_list()
107 enum avc_general_plug_dir dir,
130 enum avc_general_plug_dir dir,
87 avc_stream_get_format_single(struct fw_unit *unit, enum avc_general_plug_dir dir, unsigned int pid, u8 *buf, unsigned int *len) avc_stream_get_format_single() argument
94 avc_stream_get_format_list(struct fw_unit *unit, enum avc_general_plug_dir dir, unsigned int pid, u8 *buf, unsigned int *len, unsigned int eid) avc_stream_get_format_list() argument
/linux-4.4.14/sound/pci/hda/
H A Dlocal.h32 #define get_amp_caps(codec, nid, dir) \
33 hdac_read_parm(codec, nid, (dir) == HDA_OUTPUT ? \
/linux-4.4.14/drivers/net/ethernet/freescale/fs_enet/
H A Dmii-bitbang.c32 __be32 __iomem *dir; member in struct:bb_info
58 static inline void mdio_dir(struct mdiobb_ctrl *ctrl, int dir) mdio_dir() argument
62 if (dir) mdio_dir()
63 bb_set(bitbang->dir, bitbang->mdio_msk); mdio_dir()
65 bb_clr(bitbang->dir, bitbang->mdio_msk); mdio_dir()
68 in_be32(bitbang->dir); mdio_dir()
141 bitbang->dir = ioremap(res.start, resource_size(&res)); fs_mii_bitbang_init()
142 if (!bitbang->dir) fs_mii_bitbang_init()
145 bitbang->dat = bitbang->dir + 4; fs_mii_bitbang_init()
193 iounmap(bitbang->dir); fs_enet_mdio_probe()
210 iounmap(bitbang->dir); fs_enet_mdio_remove()
/linux-4.4.14/fs/ramfs/
H A Dinode.c54 const struct inode *dir, umode_t mode, dev_t dev) ramfs_get_inode()
60 inode_init_owner(inode, dir, mode); ramfs_get_inode()
93 ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) ramfs_mknod() argument
95 struct inode * inode = ramfs_get_inode(dir->i_sb, dir, mode, dev); ramfs_mknod()
102 dir->i_mtime = dir->i_ctime = CURRENT_TIME; ramfs_mknod()
107 static int ramfs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) ramfs_mkdir() argument
109 int retval = ramfs_mknod(dir, dentry, mode | S_IFDIR, 0); ramfs_mkdir()
111 inc_nlink(dir); ramfs_mkdir()
115 static int ramfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) ramfs_create() argument
117 return ramfs_mknod(dir, dentry, mode | S_IFREG, 0); ramfs_create()
120 static int ramfs_symlink(struct inode * dir, struct dentry *dentry, const char * symname) ramfs_symlink() argument
125 inode = ramfs_get_inode(dir->i_sb, dir, S_IFLNK|S_IRWXUGO, 0); ramfs_symlink()
132 dir->i_mtime = dir->i_ctime = CURRENT_TIME; ramfs_symlink()
53 ramfs_get_inode(struct super_block *sb, const struct inode *dir, umode_t mode, dev_t dev) ramfs_get_inode() argument
/linux-4.4.14/sound/soc/fsl/
H A Dfsl_asrc_dma.c63 u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN; fsl_asrc_dma_prepare_and_submit() local
75 pair->desc[!dir] = dmaengine_prep_dma_cyclic( fsl_asrc_dma_prepare_and_submit()
76 pair->dma_chan[!dir], runtime->dma_addr, fsl_asrc_dma_prepare_and_submit()
79 dir == OUT ? DMA_TO_DEVICE : DMA_FROM_DEVICE, flags); fsl_asrc_dma_prepare_and_submit()
80 if (!pair->desc[!dir]) { fsl_asrc_dma_prepare_and_submit()
85 pair->desc[!dir]->callback = fsl_asrc_dma_complete; fsl_asrc_dma_prepare_and_submit()
86 pair->desc[!dir]->callback_param = substream; fsl_asrc_dma_prepare_and_submit()
88 dmaengine_submit(pair->desc[!dir]); fsl_asrc_dma_prepare_and_submit()
91 pair->desc[dir] = dmaengine_prep_dma_cyclic( fsl_asrc_dma_prepare_and_submit()
92 pair->dma_chan[dir], 0xffff, 64, 64, DMA_DEV_TO_DEV, 0); fsl_asrc_dma_prepare_and_submit()
93 if (!pair->desc[dir]) { fsl_asrc_dma_prepare_and_submit()
98 dmaengine_submit(pair->desc[dir]); fsl_asrc_dma_prepare_and_submit()
151 u8 dir = tx ? OUT : IN; fsl_asrc_dma_hw_params() local
177 dma_params_fe->addr = asrc_priv->paddr + REG_ASRDx(!dir, index); fsl_asrc_dma_hw_params()
180 pair->dma_chan[!dir] = fsl_asrc_get_dma_channel(pair, !dir); fsl_asrc_dma_hw_params()
181 if (!pair->dma_chan[!dir]) { fsl_asrc_dma_hw_params()
193 ret = dmaengine_slave_config(pair->dma_chan[!dir], &config_fe); fsl_asrc_dma_hw_params()
211 tmp_chan = fsl_asrc_get_dma_channel(pair, dir); fsl_asrc_dma_hw_params()
218 pair->dma_chan[dir] = dma_request_channel(mask, filter, &pair->dma_data); fsl_asrc_dma_hw_params()
219 if (!pair->dma_chan[dir]) { fsl_asrc_dma_hw_params()
243 ret = dmaengine_slave_config(pair->dma_chan[dir], &config_be); fsl_asrc_dma_hw_params()
/linux-4.4.14/drivers/nubus/
H A Dnubus.c207 struct nubus_dir* dir) nubus_get_root_dir()
209 dir->ptr = dir->base = board->directory; nubus_get_root_dir()
210 dir->done = 0; nubus_get_root_dir()
211 dir->mask = board->lanes; nubus_get_root_dir()
218 struct nubus_dir* dir) nubus_get_func_dir()
220 dir->ptr = dir->base = dev->directory; nubus_get_func_dir()
221 dir->done = 0; nubus_get_func_dir()
222 dir->mask = dev->board->lanes; nubus_get_func_dir()
228 struct nubus_dir* dir) nubus_get_board_dir()
232 dir->ptr = dir->base = board->directory; nubus_get_board_dir()
233 dir->done = 0; nubus_get_board_dir()
234 dir->mask = board->lanes; nubus_get_board_dir()
238 if (nubus_readdir(dir, &ent) == -1) nubus_get_board_dir()
240 if (nubus_get_subdir(&ent, dir) == -1) nubus_get_board_dir()
247 struct nubus_dir *dir) nubus_get_subdir()
249 dir->ptr = dir->base = nubus_dirptr(ent); nubus_get_subdir()
250 dir->done = 0; nubus_get_subdir()
251 dir->mask = ent->mask; nubus_get_subdir()
285 int nubus_rewinddir(struct nubus_dir* dir) nubus_rewinddir() argument
287 dir->ptr = dir->base; nubus_rewinddir()
351 nubus_find_rsrc(struct nubus_dir* dir, unsigned char rsrc_type, nubus_find_rsrc() argument
354 while (nubus_readdir(dir, ent) != -1) { nubus_find_rsrc()
465 struct nubus_dir dir; nubus_get_functional_resource() local
470 nubus_get_subdir(parent, &dir); nubus_get_functional_resource()
473 if (slot == 0 && (unsigned long)dir.base % 2) nubus_get_functional_resource()
474 dir.base += 1; nubus_get_functional_resource()
477 printk(KERN_DEBUG "nubus_get_functional_resource: parent is 0x%p, dir is 0x%p\n", nubus_get_functional_resource()
478 parent->base, dir.base); nubus_get_functional_resource()
484 dev->directory = dir.base; nubus_get_functional_resource()
487 while (nubus_readdir(&dir, &ent) != -1) nubus_get_functional_resource()
558 struct nubus_dir dir; nubus_get_vidnames() local
570 nubus_get_subdir(parent, &dir); nubus_get_vidnames()
572 printk(KERN_DEBUG "nubus_get_vidnames: parent is 0x%p, dir is 0x%p\n", nubus_get_vidnames()
573 parent->base, dir.base); nubus_get_vidnames()
575 while(nubus_readdir(&dir, &ent) != -1) nubus_get_vidnames()
625 struct nubus_dir dir; nubus_get_vendorinfo() local
631 nubus_get_subdir(parent, &dir); nubus_get_vendorinfo()
633 printk(KERN_DEBUG "nubus_get_vendorinfo: parent is 0x%p, dir is 0x%p\n", nubus_get_vendorinfo()
634 parent->base, dir.base); nubus_get_vendorinfo()
636 while(nubus_readdir(&dir, &ent) != -1) nubus_get_vendorinfo()
653 struct nubus_dir dir; nubus_get_board_resource() local
656 nubus_get_subdir(parent, &dir); nubus_get_board_resource()
658 printk(KERN_DEBUG "nubus_get_board_resource: parent is 0x%p, dir is 0x%p\n", nubus_get_board_resource()
659 parent->base, dir.base); nubus_get_board_resource()
661 while(nubus_readdir(&dir, &ent) != -1) nubus_get_board_resource()
727 struct nubus_dir dir; nubus_find_rom_dir() local
748 dir.base = dir.ptr = romdir; nubus_find_rom_dir()
749 dir.done = 0; nubus_find_rom_dir()
750 dir.mask = board->lanes; nubus_find_rom_dir()
753 if (nubus_readdir(&dir, &ent) == -1) nubus_find_rom_dir()
759 if (nubus_readdir(&dir, &ent) == -1) nubus_find_rom_dir()
763 nubus_get_subdir(&ent, &dir); nubus_find_rom_dir()
766 if (nubus_readdir(&dir, &ent) == -1) nubus_find_rom_dir()
781 if (nubus_readdir(&dir, &ent) == -1) nubus_find_rom_dir()
787 nubus_get_subdir(&ent, &dir); nubus_find_rom_dir()
788 board->directory = dir.base; nubus_find_rom_dir()
806 struct nubus_dir dir; nubus_add_board() local
865 nubus_get_root_dir(board, &dir); nubus_add_board()
875 if (nubus_readdir(&dir, &ent) == -1) { nubus_add_board()
887 while (nubus_readdir(&dir, &ent) != -1) { nubus_add_board()
206 nubus_get_root_dir(const struct nubus_board* board, struct nubus_dir* dir) nubus_get_root_dir() argument
217 nubus_get_func_dir(const struct nubus_dev* dev, struct nubus_dir* dir) nubus_get_func_dir() argument
227 nubus_get_board_dir(const struct nubus_board* board, struct nubus_dir* dir) nubus_get_board_dir() argument
246 nubus_get_subdir(const struct nubus_dirent *ent, struct nubus_dir *dir) nubus_get_subdir() argument
/linux-4.4.14/drivers/gpu/drm/udl/
H A Dudl_dmabuf.c27 enum dma_data_direction dir; member in struct:udl_drm_dmabuf_attachment
44 udl_attach->dir = DMA_NONE; udl_attach_dma_buf()
64 if (udl_attach->dir != DMA_NONE) udl_detach_dma_buf()
66 udl_attach->dir); udl_detach_dma_buf()
74 enum dma_data_direction dir) udl_map_dma_buf()
85 DRM_DEBUG_PRIME("[DEV:%s] size:%zd dir=%d\n", dev_name(attach->dev), udl_map_dma_buf()
86 attach->dmabuf->size, dir); udl_map_dma_buf()
89 if (udl_attach->dir == dir && udl_attach->is_mapped) udl_map_dma_buf()
125 if (dir != DMA_NONE) { udl_map_dma_buf()
126 nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); udl_map_dma_buf()
136 udl_attach->dir = dir; udl_map_dma_buf()
146 enum dma_data_direction dir) udl_unmap_dma_buf()
149 DRM_DEBUG_PRIME("[DEV:%s] size:%zd dir:%d\n", dev_name(attach->dev), udl_unmap_dma_buf()
150 attach->dmabuf->size, dir); udl_unmap_dma_buf()
73 udl_map_dma_buf(struct dma_buf_attachment *attach, enum dma_data_direction dir) udl_map_dma_buf() argument
144 udl_unmap_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sgt, enum dma_data_direction dir) udl_unmap_dma_buf() argument
/linux-4.4.14/arch/x86/include/asm/
H A Dpgtable_32.h49 #define pte_offset_map(dir, address) \ check_pgt_cache()
50 ((pte_t *)kmap_atomic(pmd_page(*(dir))) + \ check_pgt_cache()
54 #define pte_offset_map(dir, address) \ check_pgt_cache()
55 ((pte_t *)page_address(pmd_page(*(dir))) + pte_index((address))) check_pgt_cache()
/linux-4.4.14/fs/ncpfs/
H A DMakefile7 ncpfs-y := dir.o file.o inode.o ioctl.o mmap.o ncplib_kernel.o sock.o \
H A Ddir.c2 * dir.c
40 static int ncp_mknod(struct inode * dir, struct dentry *dentry,
217 ncp_force_unlink(struct inode *dir, struct dentry* dentry) ncp_force_unlink() argument
236 res = ncp_del_file_or_subdir2(NCP_SERVER(dir), dentry); ncp_force_unlink()
315 struct inode *dir; ncp_lookup_validate() local
327 dir = d_inode(parent); ncp_lookup_validate()
332 server = NCP_SERVER(dir); ncp_lookup_validate()
348 if (ncp_is_server_root(dir)) { ncp_lookup_validate()
358 dentry->d_name.len, !ncp_preserve_case(dir)); ncp_lookup_validate()
360 res = ncp_obtain_info(server, dir, __name, &(finfo.i)); ncp_lookup_validate()
583 struct inode *dir = d_inode(dentry); ncp_fill_cache() local
592 if (ncp_vol2io(NCP_SERVER(dir), __name, &qname.len, ncp_fill_cache()
594 !ncp_preserve_entry_case(dir, entry->i.NSCreator))) ncp_fill_cache()
618 * server. Parent dir's i_mutex is locked because we're in ncp_fill_cache()
628 entry->ino = iunique(dir->i_sb, 2); ncp_fill_cache()
629 inode = ncp_iget(dir->i_sb, entry); ncp_fill_cache()
636 NCP_FINFO(dir)->flags &= ~NCPI_DIR_CACHE; ncp_fill_cache()
657 ctl.page = grab_cache_page(&dir->i_data, ctl.ofs); ncp_fill_cache()
676 ino = iunique(dir->i_sb, 2); ncp_fill_cache()
727 struct inode *dir = file_inode(file); ncp_do_readdir() local
728 struct ncp_server *server = NCP_SERVER(dir); ncp_do_readdir()
738 file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum); ncp_do_readdir()
740 err = ncp_initialize_search(server, dir, &seq); ncp_do_readdir()
830 static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) ncp_lookup() argument
832 struct ncp_server *server = NCP_SERVER(dir); ncp_lookup()
845 if (ncp_is_server_root(dir)) { ncp_lookup()
854 dentry->d_name.len, !ncp_preserve_case(dir)); ncp_lookup()
856 res = ncp_obtain_info(server, dir, __name, &(finfo.i)); ncp_lookup()
869 finfo.ino = iunique(dir->i_sb, 2); ncp_lookup()
872 inode = ncp_iget(dir->i_sb, &finfo); ncp_lookup()
889 static int ncp_instantiate(struct inode *dir, struct dentry *dentry, ncp_instantiate() argument
895 finfo->ino = iunique(dir->i_sb, 2); ncp_instantiate()
896 inode = ncp_iget(dir->i_sb, finfo); ncp_instantiate()
906 ncp_close_file(NCP_SERVER(dir), finfo->file_handle); ncp_instantiate()
910 int ncp_create_new(struct inode *dir, struct dentry *dentry, umode_t mode, ncp_create_new() argument
913 struct ncp_server *server = NCP_SERVER(dir); ncp_create_new()
924 dentry->d_name.len, !ncp_preserve_case(dir)); ncp_create_new()
935 result = ncp_open_create_file_or_subdir(server, dir, __name, ncp_create_new()
940 result = ncp_open_create_file_or_subdir(server, dir, __name, ncp_create_new()
963 error = ncp_instantiate(dir, dentry, &finfo); ncp_create_new()
968 static int ncp_create(struct inode *dir, struct dentry *dentry, umode_t mode, ncp_create() argument
971 return ncp_create_new(dir, dentry, mode, 0, 0); ncp_create()
974 static int ncp_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ncp_mkdir() argument
977 struct ncp_server *server = NCP_SERVER(dir); ncp_mkdir()
986 dentry->d_name.len, !ncp_preserve_case(dir)); ncp_mkdir()
990 error = ncp_open_create_file_or_subdir(server, dir, __name, ncp_mkdir()
1004 error = ncp_instantiate(dir, dentry, &finfo); ncp_mkdir()
1012 static int ncp_rmdir(struct inode *dir, struct dentry *dentry) ncp_rmdir() argument
1014 struct ncp_server *server = NCP_SERVER(dir); ncp_rmdir()
1022 dentry->d_name.len, !ncp_preserve_case(dir)); ncp_rmdir()
1026 result = ncp_del_file_or_subdir(server, dir, __name); ncp_rmdir()
1056 static int ncp_unlink(struct inode *dir, struct dentry *dentry) ncp_unlink() argument
1062 server = NCP_SERVER(dir); ncp_unlink()
1078 error = ncp_force_unlink(dir, dentry); ncp_unlink()
1165 static int ncp_mknod(struct inode * dir, struct dentry *dentry, ncp_mknod() argument
1168 if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) { ncp_mknod()
1170 return ncp_create_new(dir, dentry, mode, rdev, 0); ncp_mknod()
H A Dsymlink.c106 int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) { ncp_symlink() argument
115 ncp_dbg(1, "dir=%p, dentry=%p, symname=%s\n", dir, dentry, symname); ncp_symlink()
117 if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) ncp_symlink()
121 if (NCP_SERVER(dir)->m.flags & NCP_MOUNT_SYMLINKS) ncp_symlink()
148 err = ncp_io2vol(NCP_SERVER(dir), rawlink + hdr, &outlen, symname, length, 0); ncp_symlink()
155 if (ncp_create_new(dir,dentry,mode,0,attr)) { ncp_symlink()
/linux-4.4.14/fs/cifs/
H A DMakefile6 cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
/linux-4.4.14/kernel/bpf/
H A Dinode.c82 const struct inode *dir, bpf_get_inode()
104 inode_init_owner(inode, dir, mode); bpf_get_inode()
127 static int bpf_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) bpf_mkdir() argument
134 inode = bpf_get_inode(dir->i_sb, dir, mode | S_IFDIR); bpf_mkdir()
142 inc_nlink(dir); bpf_mkdir()
150 static int bpf_mkobj_ops(struct inode *dir, struct dentry *dentry, bpf_mkobj_ops() argument
158 inode = bpf_get_inode(dir->i_sb, dir, mode | S_IFREG); bpf_mkobj_ops()
171 static int bpf_mkobj(struct inode *dir, struct dentry *dentry, umode_t mode, bpf_mkobj() argument
182 return bpf_mkobj_ops(dir, dentry, mode, &bpf_prog_iops); bpf_mkobj()
184 return bpf_mkobj_ops(dir, dentry, mode, &bpf_map_iops); bpf_mkobj()
202 struct inode *dir; bpf_obj_do_pin() local
219 dir = d_inode(path.dentry); bpf_obj_do_pin()
220 if (dir->i_op != &bpf_dir_iops) { bpf_obj_do_pin()
226 ret = vfs_mknod(dir, dentry, mode, devt); bpf_obj_do_pin()
81 bpf_get_inode(struct super_block *sb, const struct inode *dir, umode_t mode) bpf_get_inode() argument
/linux-4.4.14/fs/ntfs/
H A DMakefile5 ntfs-y := aops.o attrib.o collate.o compress.o debug.o dir.o file.o \
/linux-4.4.14/arch/mips/kernel/
H A Dgpio_txx9.c52 __raw_writel(__raw_readl(&txx9_pioptr->dir) & ~(1 << offset), txx9_gpio_dir_in()
53 &txx9_pioptr->dir); txx9_gpio_dir_in()
65 __raw_writel(__raw_readl(&txx9_pioptr->dir) | (1 << offset), txx9_gpio_dir_out()
66 &txx9_pioptr->dir); txx9_gpio_dir_out()
/linux-4.4.14/arch/s390/hypfs/
H A Dhypfs_vm.c112 #define ATTRIBUTE(dir, name, member) \
115 rc = hypfs_create_u64(dir, name, member); \
130 /* guest dir */ hpyfs_vm_create_guest()
180 struct dentry *dir, *file; hypfs_vm_create_files() local
190 dir = hypfs_mkdir(root, "hyp"); hypfs_vm_create_files()
191 if (IS_ERR(dir)) { hypfs_vm_create_files()
192 rc = PTR_ERR(dir); hypfs_vm_create_files()
195 file = hypfs_create_str(dir, "type", "z/VM Hypervisor"); hypfs_vm_create_files()
202 dir = hypfs_mkdir(root, "cpus"); hypfs_vm_create_files()
203 if (IS_ERR(dir)) { hypfs_vm_create_files()
204 rc = PTR_ERR(dir); hypfs_vm_create_files()
207 file = hypfs_create_u64(dir, "count", data->lcpus); hypfs_vm_create_files()
214 dir = hypfs_mkdir(root, "systems"); hypfs_vm_create_files()
215 if (IS_ERR(dir)) { hypfs_vm_create_files()
216 rc = PTR_ERR(dir); hypfs_vm_create_files()
221 rc = hpyfs_vm_create_guest(dir, &(data[i])); hypfs_vm_create_files()
/linux-4.4.14/arch/m68k/include/asm/
H A Datari_joystick.h16 char dir; member in struct:joystick_status
H A Ddma-mapping.h50 enum dma_data_direction dir) dma_cache_sync()
58 size_t size, enum dma_data_direction dir) dma_unmap_single()
66 size_t size, enum dma_data_direction dir) dma_unmap_page()
73 int nhwentries, enum dma_data_direction dir) dma_unmap_sg()
91 size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu()
96 int nents, enum dma_data_direction dir) dma_sync_sg_for_cpu()
49 dma_cache_sync(struct device *dev, void *vaddr, size_t size, enum dma_data_direction dir) dma_cache_sync() argument
57 dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
65 dma_unmap_page(struct device *dev, dma_addr_t address, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
72 dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, enum dma_data_direction dir) dma_unmap_sg() argument
90 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu() argument
95 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) dma_sync_sg_for_cpu() argument
/linux-4.4.14/tools/build/tests/ex/
H A DMakefile14 make -f $(srctree)/tools/build/Makefile.build dir=. $@
/linux-4.4.14/drivers/staging/iio/cdc/
H A Dad7150.c128 enum iio_event_direction dir) ad7150_read_event_config()
144 if (dir == IIO_EV_DIR_RISING) ad7150_read_event_config()
148 if (dir == IIO_EV_DIR_RISING) ad7150_read_event_config()
152 if (dir == IIO_EV_DIR_RISING) ad7150_read_event_config()
164 enum iio_event_direction dir) ad7150_write_event_params()
170 int rising = (dir == IIO_EV_DIR_RISING); ad7150_write_event_params()
173 event_code = IIO_UNMOD_EVENT_CODE(IIO_CAPACITANCE, chan, type, dir); ad7150_write_event_params()
213 enum iio_event_direction dir, int state) ad7150_write_event_config()
218 int rising = (dir == IIO_EV_DIR_RISING); ad7150_write_event_config()
225 event_code = IIO_UNMOD_EVENT_CODE(chan->type, chan->channel, type, dir); ad7150_write_event_config()
271 ret = ad7150_write_event_params(indio_dev, chan->channel, type, dir); ad7150_write_event_config()
281 enum iio_event_direction dir, ad7150_read_event_value()
286 int rising = (dir == IIO_EV_DIR_RISING); ad7150_read_event_value()
307 enum iio_event_direction dir, ad7150_write_event_value()
313 int rising = (dir == IIO_EV_DIR_RISING); ad7150_write_event_value()
332 ret = ad7150_write_event_params(indio_dev, chan->channel, type, dir); ad7150_write_event_value()
376 enum iio_event_direction dir; ad7150_store_timeout() local
383 dir = IIO_EVENT_CODE_EXTRACT_DIR(this_attr->address); ad7150_store_timeout()
384 rising = (dir == IIO_EV_DIR_RISING); ad7150_store_timeout()
403 ret = ad7150_write_event_params(indio_dev, chan, type, dir); ad7150_store_timeout()
413 #define AD7150_TIMEOUT(chan, type, dir, ev_type, ev_dir) \
414 IIO_DEVICE_ATTR(in_capacitance##chan##_##type##_##dir##_timeout, \
434 .dir = IIO_EV_DIR_RISING,
439 .dir = IIO_EV_DIR_FALLING,
444 .dir = IIO_EV_DIR_RISING,
449 .dir = IIO_EV_DIR_FALLING,
454 .dir = IIO_EV_DIR_RISING,
459 .dir = IIO_EV_DIR_FALLING,
126 ad7150_read_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir) ad7150_read_event_config() argument
162 ad7150_write_event_params(struct iio_dev *indio_dev, unsigned int chan, enum iio_event_type type, enum iio_event_direction dir) ad7150_write_event_params() argument
211 ad7150_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, int state) ad7150_write_event_config() argument
278 ad7150_read_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, enum iio_event_info info, int *val, int *val2) ad7150_read_event_value() argument
304 ad7150_write_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, enum iio_event_info info, int val, int val2) ad7150_write_event_value() argument
/linux-4.4.14/arch/hexagon/kernel/
H A Ddma.c107 int nents, enum dma_data_direction dir, hexagon_map_sg()
133 enum dma_data_direction dir) dma_sync()
135 switch (dir) { dma_sync()
159 * @dir: transfer direction
174 enum dma_data_direction dir, hexagon_map_page()
183 dma_sync(dma_addr_to_virt(bus), size, dir); hexagon_map_page()
190 enum dma_data_direction dir) hexagon_sync_single_for_cpu()
192 dma_sync(dma_addr_to_virt(dma_handle), size, dir); hexagon_sync_single_for_cpu() local
197 enum dma_data_direction dir) hexagon_sync_single_for_device()
199 dma_sync(dma_addr_to_virt(dma_handle), size, dir); hexagon_sync_single_for_device() local
106 hexagon_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) hexagon_map_sg() argument
132 dma_sync(void *addr, size_t size, enum dma_data_direction dir) dma_sync() argument
172 hexagon_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) hexagon_map_page() argument
188 hexagon_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) hexagon_sync_single_for_cpu() argument
195 hexagon_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) hexagon_sync_single_for_device() argument
/linux-4.4.14/net/xfrm/
H A Dxfrm_policy.c58 static void __xfrm_policy_link(struct xfrm_policy *pol, int dir);
60 int dir);
184 int dir; xfrm_policy_timer() local
191 dir = xfrm_policy_id2dir(xp->index); xfrm_policy_timer()
231 km_policy_expired(xp, dir, 0, 0); xfrm_policy_timer()
243 if (!xfrm_policy_delete(xp, dir)) xfrm_policy_timer()
244 km_policy_expired(xp, dir, 1, 0); xfrm_policy_timer()
356 unsigned short family, int dir, __get_hash_thresh()
361 *dbits = net->xfrm.policy_bydst[dir].dbits4; __get_hash_thresh()
362 *sbits = net->xfrm.policy_bydst[dir].sbits4; __get_hash_thresh()
366 *dbits = net->xfrm.policy_bydst[dir].dbits6; __get_hash_thresh()
367 *sbits = net->xfrm.policy_bydst[dir].sbits6; __get_hash_thresh()
378 unsigned short family, int dir) policy_hash_bysel()
380 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; policy_hash_bysel()
385 __get_hash_thresh(net, family, dir, &dbits, &sbits); policy_hash_bysel()
389 &net->xfrm.policy_inexact[dir] : policy_hash_bysel()
390 net->xfrm.policy_bydst[dir].table + hash); policy_hash_bysel()
396 unsigned short family, int dir) policy_hash_direct()
398 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; policy_hash_direct()
403 __get_hash_thresh(net, family, dir, &dbits, &sbits); policy_hash_direct()
406 return net->xfrm.policy_bydst[dir].table + hash; policy_hash_direct()
413 int dir) xfrm_dst_hash_transfer()
425 __get_hash_thresh(net, pol->family, dir, &dbits, &sbits); hlist_for_each_entry_safe()
466 static void xfrm_bydst_resize(struct net *net, int dir) xfrm_bydst_resize() argument
468 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; xfrm_bydst_resize()
471 struct hlist_head *odst = net->xfrm.policy_bydst[dir].table; xfrm_bydst_resize()
481 xfrm_dst_hash_transfer(net, odst + i, ndst, nhashmask, dir); xfrm_bydst_resize()
483 net->xfrm.policy_bydst[dir].table = ndst; xfrm_bydst_resize()
484 net->xfrm.policy_bydst[dir].hmask = nhashmask; xfrm_bydst_resize()
516 static inline int xfrm_bydst_should_resize(struct net *net, int dir, int *total) xfrm_bydst_should_resize() argument
518 unsigned int cnt = net->xfrm.policy_count[dir]; xfrm_bydst_should_resize()
519 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; xfrm_bydst_should_resize()
561 int dir, total; xfrm_hash_resize() local
566 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_hash_resize()
567 if (xfrm_bydst_should_resize(net, dir, &total)) xfrm_hash_resize()
568 xfrm_bydst_resize(net, dir); xfrm_hash_resize()
587 int dir; xfrm_hash_rebuild() local
606 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_hash_rebuild()
607 INIT_HLIST_HEAD(&net->xfrm.policy_inexact[dir]); xfrm_hash_rebuild()
608 hmask = net->xfrm.policy_bydst[dir].hmask; xfrm_hash_rebuild()
609 odst = net->xfrm.policy_bydst[dir].table; xfrm_hash_rebuild()
612 if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) { xfrm_hash_rebuild()
613 /* dir out => dst = remote, src = local */ xfrm_hash_rebuild()
614 net->xfrm.policy_bydst[dir].dbits4 = rbits4; xfrm_hash_rebuild()
615 net->xfrm.policy_bydst[dir].sbits4 = lbits4; xfrm_hash_rebuild()
616 net->xfrm.policy_bydst[dir].dbits6 = rbits6; xfrm_hash_rebuild()
617 net->xfrm.policy_bydst[dir].sbits6 = lbits6; xfrm_hash_rebuild()
619 /* dir in/fwd => dst = local, src = remote */ xfrm_hash_rebuild()
620 net->xfrm.policy_bydst[dir].dbits4 = lbits4; xfrm_hash_rebuild()
621 net->xfrm.policy_bydst[dir].sbits4 = rbits4; xfrm_hash_rebuild()
622 net->xfrm.policy_bydst[dir].dbits6 = lbits6; xfrm_hash_rebuild()
623 net->xfrm.policy_bydst[dir].sbits6 = rbits6; xfrm_hash_rebuild()
658 static u32 xfrm_gen_index(struct net *net, int dir, u32 index) xfrm_gen_index() argument
669 idx = (idx_generator | dir); xfrm_gen_index()
748 int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) xfrm_policy_insert() argument
757 chain = policy_hash_bysel(net, &policy->selector, policy->family, dir); xfrm_policy_insert()
784 __xfrm_policy_link(policy, dir);
795 __xfrm_policy_unlink(delpol, dir);
797 policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir, policy->index);
807 else if (xfrm_bydst_should_resize(net, dir, NULL))
815 int dir, struct xfrm_selector *sel, xfrm_policy_bysel_ctx()
824 chain = policy_hash_bysel(net, sel, sel->family, dir); xfrm_policy_bysel_ctx()
839 __xfrm_policy_unlink(pol, dir); hlist_for_each_entry()
854 int dir, u32 id, int delete, int *err) xfrm_policy_byid()
860 if (xfrm_policy_id2dir(id) != dir) xfrm_policy_byid()
878 __xfrm_policy_unlink(pol, dir); hlist_for_each_entry()
896 int dir, err = 0; xfrm_policy_flush_secctx_check() local
898 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_flush_secctx_check()
903 &net->xfrm.policy_inexact[dir], bydst) { xfrm_policy_flush_secctx_check()
912 for (i = net->xfrm.policy_bydst[dir].hmask; i >= 0; i--) { xfrm_policy_flush_secctx_check()
914 net->xfrm.policy_bydst[dir].table + i, xfrm_policy_flush_secctx_check()
940 int dir, err = 0, cnt = 0; xfrm_policy_flush() local
948 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_flush()
954 &net->xfrm.policy_inexact[dir], bydst) { xfrm_policy_flush()
957 __xfrm_policy_unlink(pol, dir); xfrm_policy_flush()
969 for (i = net->xfrm.policy_bydst[dir].hmask; i >= 0; i--) { xfrm_policy_flush()
972 net->xfrm.policy_bydst[dir].table + i, xfrm_policy_flush()
976 __xfrm_policy_unlink(pol, dir); xfrm_policy_flush()
1072 u8 type, u16 family, int dir) xfrm_policy_match()
1086 dir); xfrm_policy_match()
1093 u16 family, u8 dir) xfrm_policy_lookup_bytype()
1107 chain = policy_hash_direct(net, daddr, saddr, family, dir); xfrm_policy_lookup_bytype()
1110 err = xfrm_policy_match(pol, fl, type, family, dir); hlist_for_each_entry()
1124 chain = &net->xfrm.policy_inexact[dir]; hlist_for_each_entry()
1129 err = xfrm_policy_match(pol, fl, type, family, dir); hlist_for_each_entry()
1151 __xfrm_policy_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir) __xfrm_policy_lookup() argument
1156 pol = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_SUB, fl, family, dir); __xfrm_policy_lookup()
1160 return xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, fl, family, dir); __xfrm_policy_lookup()
1163 static int flow_to_policy_dir(int dir) flow_to_policy_dir() argument
1168 return dir; flow_to_policy_dir()
1170 switch (dir) { flow_to_policy_dir()
1183 u8 dir, struct flow_cache_object *old_obj, void *ctx) xfrm_policy_lookup()
1190 pol = __xfrm_policy_lookup(net, fl, family, flow_to_policy_dir(dir)); xfrm_policy_lookup()
1201 static inline int policy_to_flow_dir(int dir) policy_to_flow_dir() argument
1206 return dir; policy_to_flow_dir()
1207 switch (dir) { policy_to_flow_dir()
1218 static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir, xfrm_sk_policy_lookup() argument
1226 pol = rcu_dereference(sk->sk_policy[dir]); xfrm_sk_policy_lookup()
1239 policy_to_flow_dir(dir)); xfrm_sk_policy_lookup()
1255 static void __xfrm_policy_link(struct xfrm_policy *pol, int dir) __xfrm_policy_link() argument
1260 net->xfrm.policy_count[dir]++; __xfrm_policy_link()
1265 int dir) __xfrm_policy_unlink()
1279 net->xfrm.policy_count[dir]--; __xfrm_policy_unlink()
1284 static void xfrm_sk_policy_link(struct xfrm_policy *pol, int dir) xfrm_sk_policy_link() argument
1286 __xfrm_policy_link(pol, XFRM_POLICY_MAX + dir); xfrm_sk_policy_link()
1289 static void xfrm_sk_policy_unlink(struct xfrm_policy *pol, int dir) xfrm_sk_policy_unlink() argument
1291 __xfrm_policy_unlink(pol, XFRM_POLICY_MAX + dir); xfrm_sk_policy_unlink()
1294 int xfrm_policy_delete(struct xfrm_policy *pol, int dir) xfrm_policy_delete() argument
1299 pol = __xfrm_policy_unlink(pol, dir); xfrm_policy_delete()
1309 int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol) xfrm_sk_policy_insert() argument
1320 old_pol = rcu_dereference_protected(sk->sk_policy[dir], xfrm_sk_policy_insert()
1324 pol->index = xfrm_gen_index(net, XFRM_POLICY_MAX+dir, 0); xfrm_sk_policy_insert()
1325 xfrm_sk_policy_link(pol, dir); xfrm_sk_policy_insert()
1327 rcu_assign_pointer(sk->sk_policy[dir], pol); xfrm_sk_policy_insert()
1335 xfrm_sk_policy_unlink(old_pol, dir); xfrm_sk_policy_insert()
1345 static struct xfrm_policy *clone_policy(const struct xfrm_policy *old, int dir) clone_policy() argument
1368 xfrm_sk_policy_link(newp, dir); clone_policy()
2082 xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir, xfrm_bundle_lookup() argument
2115 flow_to_policy_dir(dir)); xfrm_bundle_lookup()
2214 u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); xfrm_lookup() local
2266 flo = flow_cache_lookup(net, fl, family, dir, xfrm_lookup()
2462 int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, __xfrm_policy_check() argument
2476 reverse = dir & ~XFRM_POLICY_MASK; __xfrm_policy_check()
2477 dir &= XFRM_POLICY_MASK; __xfrm_policy_check()
2478 fl_dir = policy_to_flow_dir(dir); __xfrm_policy_check()
2502 if (sk && sk->sk_policy[dir]) { __xfrm_policy_check()
2503 pol = xfrm_sk_policy_lookup(sk, dir, &fl); __xfrm_policy_check()
2941 int dir; xfrm_policy_init() local
2957 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_init()
2960 net->xfrm.policy_count[dir] = 0; xfrm_policy_init()
2961 net->xfrm.policy_count[XFRM_POLICY_MAX + dir] = 0; xfrm_policy_init()
2962 INIT_HLIST_HEAD(&net->xfrm.policy_inexact[dir]); xfrm_policy_init()
2964 htab = &net->xfrm.policy_bydst[dir]; xfrm_policy_init()
2989 for (dir--; dir >= 0; dir--) { xfrm_policy_init()
2992 htab = &net->xfrm.policy_bydst[dir]; xfrm_policy_init()
3003 int dir; xfrm_policy_fini() local
3013 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_fini()
3016 WARN_ON(!hlist_empty(&net->xfrm.policy_inexact[dir])); xfrm_policy_fini()
3018 htab = &net->xfrm.policy_bydst[dir]; xfrm_policy_fini()
3176 u8 dir, u8 type, struct net *net) xfrm_migrate_policy_find()
3183 chain = policy_hash_direct(net, &sel->daddr, &sel->saddr, sel->family, dir); hlist_for_each_entry()
3192 chain = &net->xfrm.policy_inexact[dir]; hlist_for_each_entry()
3315 int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, xfrm_migrate() argument
3330 if ((pol = xfrm_migrate_policy_find(sel, dir, type, net)) == NULL) { xfrm_migrate()
3361 km_migrate(sel, dir, type, m, num_migrate, k); xfrm_migrate()
355 __get_hash_thresh(struct net *net, unsigned short family, int dir, u8 *dbits, u8 *sbits) __get_hash_thresh() argument
376 policy_hash_bysel(struct net *net, const struct xfrm_selector *sel, unsigned short family, int dir) policy_hash_bysel() argument
393 policy_hash_direct(struct net *net, const xfrm_address_t *daddr, const xfrm_address_t *saddr, unsigned short family, int dir) policy_hash_direct() argument
409 xfrm_dst_hash_transfer(struct net *net, struct hlist_head *list, struct hlist_head *ndsttable, unsigned int nhashmask, int dir) xfrm_dst_hash_transfer() argument
814 xfrm_policy_bysel_ctx(struct net *net, u32 mark, u8 type, int dir, struct xfrm_selector *sel, struct xfrm_sec_ctx *ctx, int delete, int *err) xfrm_policy_bysel_ctx() argument
853 xfrm_policy_byid(struct net *net, u32 mark, u8 type, int dir, u32 id, int delete, int *err) xfrm_policy_byid() argument
1070 xfrm_policy_match(const struct xfrm_policy *pol, const struct flowi *fl, u8 type, u16 family, int dir) xfrm_policy_match() argument
1091 xfrm_policy_lookup_bytype(struct net *net, u8 type, const struct flowi *fl, u16 family, u8 dir) xfrm_policy_lookup_bytype() argument
1182 xfrm_policy_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir, struct flow_cache_object *old_obj, void *ctx) xfrm_policy_lookup() argument
1264 __xfrm_policy_unlink(struct xfrm_policy *pol, int dir) __xfrm_policy_unlink() argument
3175 xfrm_migrate_policy_find(const struct xfrm_selector *sel, u8 dir, u8 type, struct net *net) xfrm_migrate_policy_find() argument
/linux-4.4.14/arch/s390/oprofile/
H A Dinit.c367 struct dentry *dir; oprofile_create_hwsampling_files() local
369 dir = oprofilefs_mkdir(root, "timer"); oprofile_create_hwsampling_files()
370 if (!dir) oprofile_create_hwsampling_files()
373 oprofilefs_create_file(dir, "enabled", &timer_enabled_fops); oprofile_create_hwsampling_files()
394 dir = oprofilefs_mkdir(root, "0"); oprofile_create_hwsampling_files()
395 if (!dir) oprofile_create_hwsampling_files()
398 oprofilefs_create_file(dir, "enabled", &hwsampler_fops); oprofile_create_hwsampling_files()
399 oprofilefs_create_file(dir, "event", &zero_fops); oprofile_create_hwsampling_files()
400 oprofilefs_create_file(dir, "count", &hw_interval_fops); oprofile_create_hwsampling_files()
401 oprofilefs_create_file(dir, "unit_mask", &zero_fops); oprofile_create_hwsampling_files()
402 oprofilefs_create_file(dir, "kernel", &kernel_fops); oprofile_create_hwsampling_files()
403 oprofilefs_create_file(dir, "user", &user_fops); oprofile_create_hwsampling_files()
404 oprofilefs_create_ulong(dir, "hw_sdbt_blocks", oprofile_create_hwsampling_files()
414 dir = oprofilefs_mkdir(root, "hwsampling"); oprofile_create_hwsampling_files()
415 if (!dir) oprofile_create_hwsampling_files()
418 oprofilefs_create_file(dir, "hwsampler", oprofile_create_hwsampling_files()
420 oprofilefs_create_file(dir, "hw_interval", oprofile_create_hwsampling_files()
422 oprofilefs_create_ro_ulong(dir, "hw_min_interval", oprofile_create_hwsampling_files()
424 oprofilefs_create_ro_ulong(dir, "hw_max_interval", oprofile_create_hwsampling_files()
426 oprofilefs_create_ulong(dir, "hw_sdbt_blocks", oprofile_create_hwsampling_files()
/linux-4.4.14/net/sunrpc/
H A Drpc_pipe.c492 static int __rpc_create_common(struct inode *dir, struct dentry *dentry, __rpc_create_common() argument
500 inode = rpc_get_inode(dir->i_sb, mode); __rpc_create_common()
503 inode->i_ino = iunique(dir->i_sb, 100); __rpc_create_common()
517 static int __rpc_create(struct inode *dir, struct dentry *dentry, __rpc_create() argument
524 err = __rpc_create_common(dir, dentry, S_IFREG | mode, i_fop, private); __rpc_create()
527 fsnotify_create(dir, dentry); __rpc_create()
531 static int __rpc_mkdir(struct inode *dir, struct dentry *dentry, __rpc_mkdir() argument
538 err = __rpc_create_common(dir, dentry, S_IFDIR | mode, i_fop, private); __rpc_mkdir()
541 inc_nlink(dir); __rpc_mkdir()
542 fsnotify_mkdir(dir, dentry); __rpc_mkdir()
582 static int __rpc_mkpipe_dentry(struct inode *dir, struct dentry *dentry, __rpc_mkpipe_dentry() argument
591 err = __rpc_create_common(dir, dentry, S_IFIFO | mode, i_fop, private); __rpc_mkpipe_dentry()
597 fsnotify_create(dir, dentry); __rpc_mkpipe_dentry()
601 static int __rpc_rmdir(struct inode *dir, struct dentry *dentry) __rpc_rmdir() argument
606 ret = simple_rmdir(dir, dentry); __rpc_rmdir()
615 struct inode *dir; rpc_rmdir() local
619 dir = d_inode(parent); rpc_rmdir()
620 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); rpc_rmdir()
621 error = __rpc_rmdir(dir, dentry); rpc_rmdir()
622 mutex_unlock(&dir->i_mutex); rpc_rmdir()
628 static int __rpc_unlink(struct inode *dir, struct dentry *dentry) __rpc_unlink() argument
633 ret = simple_unlink(dir, dentry); __rpc_unlink()
639 static int __rpc_rmpipe(struct inode *dir, struct dentry *dentry) __rpc_rmpipe() argument
644 return __rpc_unlink(dir, dentry); __rpc_rmpipe()
670 struct inode *dir = d_inode(parent); __rpc_depopulate() local
688 __rpc_unlink(dir, dentry); __rpc_depopulate()
691 __rpc_rmdir(dir, dentry); __rpc_depopulate()
702 struct inode *dir = d_inode(parent); rpc_depopulate() local
704 mutex_lock_nested(&dir->i_mutex, I_MUTEX_CHILD); rpc_depopulate()
706 mutex_unlock(&dir->i_mutex); rpc_depopulate()
714 struct inode *dir = d_inode(parent); rpc_populate() local
718 mutex_lock(&dir->i_mutex); rpc_populate()
728 err = __rpc_create(dir, dentry, rpc_populate()
734 err = __rpc_mkdir(dir, dentry, rpc_populate()
742 mutex_unlock(&dir->i_mutex); rpc_populate()
746 mutex_unlock(&dir->i_mutex); rpc_populate()
757 struct inode *dir = d_inode(parent); rpc_mkdir_populate() local
760 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); rpc_mkdir_populate()
764 error = __rpc_mkdir(dir, dentry, mode, NULL, private); rpc_mkdir_populate()
773 mutex_unlock(&dir->i_mutex); rpc_mkdir_populate()
776 __rpc_rmdir(dir, dentry); rpc_mkdir_populate()
786 struct inode *dir; rpc_rmdir_depopulate() local
790 dir = d_inode(parent); rpc_rmdir_depopulate()
791 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); rpc_rmdir_depopulate()
794 error = __rpc_rmdir(dir, dentry); rpc_rmdir_depopulate()
795 mutex_unlock(&dir->i_mutex); rpc_rmdir_depopulate()
822 struct inode *dir = d_inode(parent); rpc_mkpipe_dentry() local
831 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); rpc_mkpipe_dentry()
835 err = __rpc_mkpipe_dentry(dir, dentry, umode, &rpc_pipe_fops, rpc_mkpipe_dentry()
840 mutex_unlock(&dir->i_mutex); rpc_mkpipe_dentry()
863 struct inode *dir; rpc_unlink() local
867 dir = d_inode(parent); rpc_unlink()
868 mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT); rpc_unlink()
869 error = __rpc_rmpipe(dir, dentry); rpc_unlink()
870 mutex_unlock(&dir->i_mutex); rpc_unlink()
1013 struct dentry *dir = pdh->pdh_dentry; rpc_create_pipe_dir_objects() local
1016 pdo->pdo_ops->create(dir, pdo); rpc_create_pipe_dir_objects()
1023 struct dentry *dir = pdh->pdh_dentry; rpc_destroy_pipe_dir_objects() local
1026 pdo->pdo_ops->destroy(dir, pdo); rpc_destroy_pipe_dir_objects()
1209 struct qstr dir = QSTR_INIT(dir_name, strlen(dir_name)); rpc_d_lookup_sb() local
1210 return d_hash_and_lookup(sb->s_root, &dir); rpc_d_lookup_sb()
/linux-4.4.14/fs/squashfs/
H A Dnamei.c139 static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry, squashfs_lookup() argument
145 struct squashfs_sb_info *msblk = dir->i_sb->s_fs_info; squashfs_lookup()
148 u64 block = squashfs_i(dir)->start + msblk->directory_table; squashfs_lookup()
149 int offset = squashfs_i(dir)->offset; squashfs_lookup()
166 length = get_dir_index_using_name(dir->i_sb, &block, &offset, squashfs_lookup()
167 squashfs_i(dir)->dir_idx_start, squashfs_lookup()
168 squashfs_i(dir)->dir_idx_offset, squashfs_lookup()
169 squashfs_i(dir)->dir_idx_cnt, name, len); squashfs_lookup()
171 while (length < i_size_read(dir)) { squashfs_lookup()
175 err = squashfs_read_metadata(dir->i_sb, &dirh, &block, squashfs_lookup()
191 err = squashfs_read_metadata(dir->i_sb, dire, &block, squashfs_lookup()
202 err = squashfs_read_metadata(dir->i_sb, dire->name, squashfs_lookup()
225 inode = squashfs_iget(dir->i_sb, ino, ino_num); squashfs_lookup()
240 squashfs_i(dir)->start + msblk->directory_table, squashfs_lookup()
241 squashfs_i(dir)->offset); squashfs_lookup()
/linux-4.4.14/drivers/xen/
H A Dswiotlb-xen.c380 enum dma_data_direction dir, xen_swiotlb_map_page()
386 BUG_ON(dir == DMA_NONE); xen_swiotlb_map_page()
399 xen_dma_map_page(dev, page, dev_addr, offset, size, dir, attrs); xen_swiotlb_map_page()
408 map = swiotlb_tbl_map_single(dev, start_dma_addr, phys, size, dir); xen_swiotlb_map_page()
413 dev_addr, map & ~PAGE_MASK, size, dir, attrs); xen_swiotlb_map_page()
420 swiotlb_tbl_unmap_single(dev, map, size, dir); xen_swiotlb_map_page()
436 size_t size, enum dma_data_direction dir, xen_unmap_single()
441 BUG_ON(dir == DMA_NONE); xen_unmap_single()
443 xen_dma_unmap_page(hwdev, dev_addr, size, dir, attrs); xen_unmap_single()
447 swiotlb_tbl_unmap_single(hwdev, paddr, size, dir); xen_unmap_single()
451 if (dir != DMA_FROM_DEVICE) xen_unmap_single()
464 size_t size, enum dma_data_direction dir, xen_swiotlb_unmap_page()
467 xen_unmap_single(hwdev, dev_addr, size, dir, attrs); xen_swiotlb_unmap_page()
483 size_t size, enum dma_data_direction dir, xen_swiotlb_sync_single()
488 BUG_ON(dir == DMA_NONE); xen_swiotlb_sync_single()
491 xen_dma_sync_single_for_cpu(hwdev, dev_addr, size, dir); xen_swiotlb_sync_single()
495 swiotlb_tbl_sync_single(hwdev, paddr, size, dir, target); xen_swiotlb_sync_single()
498 xen_dma_sync_single_for_device(hwdev, dev_addr, size, dir); xen_swiotlb_sync_single()
500 if (dir != DMA_FROM_DEVICE) xen_swiotlb_sync_single()
508 size_t size, enum dma_data_direction dir) xen_swiotlb_sync_single_for_cpu()
510 xen_swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_CPU); xen_swiotlb_sync_single_for_cpu()
516 size_t size, enum dma_data_direction dir) xen_swiotlb_sync_single_for_device()
518 xen_swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_DEVICE); xen_swiotlb_sync_single_for_device()
540 int nelems, enum dma_data_direction dir, xen_swiotlb_map_sg_attrs()
546 BUG_ON(dir == DMA_NONE); xen_swiotlb_map_sg_attrs()
560 dir); for_each_sg()
565 xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir, for_each_sg()
574 dir, for_each_sg()
585 dir, for_each_sg()
601 int nelems, enum dma_data_direction dir, xen_swiotlb_unmap_sg_attrs()
607 BUG_ON(dir == DMA_NONE); xen_swiotlb_unmap_sg_attrs()
610 xen_unmap_single(hwdev, sg->dma_address, sg_dma_len(sg), dir, attrs); xen_swiotlb_unmap_sg_attrs()
624 int nelems, enum dma_data_direction dir, xen_swiotlb_sync_sg()
632 sg_dma_len(sg), dir, target); xen_swiotlb_sync_sg()
637 int nelems, enum dma_data_direction dir) xen_swiotlb_sync_sg_for_cpu()
639 xen_swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_CPU); xen_swiotlb_sync_sg_for_cpu()
645 int nelems, enum dma_data_direction dir) xen_swiotlb_sync_sg_for_device()
647 xen_swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_DEVICE); xen_swiotlb_sync_sg_for_device()
378 xen_swiotlb_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_swiotlb_map_page() argument
435 xen_unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_unmap_single() argument
463 xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) xen_swiotlb_unmap_page() argument
482 xen_swiotlb_sync_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, enum dma_sync_target target) xen_swiotlb_sync_single() argument
507 xen_swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) xen_swiotlb_sync_single_for_cpu() argument
515 xen_swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) xen_swiotlb_sync_single_for_device() argument
539 xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) xen_swiotlb_map_sg_attrs() argument
600 xen_swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) xen_swiotlb_unmap_sg_attrs() argument
623 xen_swiotlb_sync_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, enum dma_sync_target target) xen_swiotlb_sync_sg() argument
636 xen_swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) xen_swiotlb_sync_sg_for_cpu() argument
644 xen_swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) xen_swiotlb_sync_sg_for_device() argument
/linux-4.4.14/drivers/infiniband/hw/qib/
H A Dqib_fs.c50 static int qibfs_mknod(struct inode *dir, struct dentry *dentry, qibfs_mknod() argument
55 struct inode *inode = new_inode(dir->i_sb); qibfs_mknod()
74 inc_nlink(dir); qibfs_mknod()
377 struct dentry *dir, *tmp; add_cntr_files() local
383 ret = create_file(unit, S_IFDIR|S_IRUGO|S_IXUGO, sb->s_root, &dir, add_cntr_files()
391 ret = create_file("counters", S_IFREG|S_IRUGO, dir, &tmp, add_cntr_files()
398 ret = create_file("counter_names", S_IFREG|S_IRUGO, dir, &tmp, add_cntr_files()
405 ret = create_file("portcounter_names", S_IFREG|S_IRUGO, dir, &tmp, add_cntr_files()
417 ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp, add_cntr_files()
427 ret = create_file(fname, S_IFREG|S_IRUGO, dir, &tmp, add_cntr_files()
436 ret = create_file("flash", S_IFREG|S_IWUSR|S_IRUGO, dir, &tmp, add_cntr_files()
479 struct dentry *dir, *root; remove_device_files() local
486 dir = lookup_one_len(unit, root, strlen(unit)); remove_device_files()
488 if (IS_ERR(dir)) { remove_device_files()
489 ret = PTR_ERR(dir); remove_device_files()
494 mutex_lock(&d_inode(dir)->i_mutex); remove_device_files()
495 remove_file(dir, "counters"); remove_device_files()
496 remove_file(dir, "counter_names"); remove_device_files()
497 remove_file(dir, "portcounter_names"); remove_device_files()
502 remove_file(dir, fname); remove_device_files()
505 remove_file(dir, fname); remove_device_files()
508 remove_file(dir, "flash"); remove_device_files()
509 mutex_unlock(&d_inode(dir)->i_mutex); remove_device_files()
510 ret = simple_rmdir(d_inode(root), dir); remove_device_files()
511 d_delete(dir); remove_device_files()
512 dput(dir); remove_device_files()
/linux-4.4.14/kernel/irq/
H A Dproc.c310 if (!desc->dir || action->dir || !action->name || register_handler_proc()
318 action->dir = proc_mkdir(name, desc->dir); register_handler_proc()
340 if (desc->dir) register_irq_proc()
347 desc->dir = proc_mkdir(name, root_irq_dir); register_irq_proc()
348 if (!desc->dir) register_irq_proc()
353 proc_create_data("smp_affinity", 0644, desc->dir, register_irq_proc()
357 proc_create_data("affinity_hint", 0444, desc->dir, register_irq_proc()
361 proc_create_data("smp_affinity_list", 0644, desc->dir, register_irq_proc()
364 proc_create_data("node", 0444, desc->dir, register_irq_proc()
368 proc_create_data("spurious", 0444, desc->dir, register_irq_proc()
379 if (!root_irq_dir || !desc->dir) unregister_irq_proc()
382 remove_proc_entry("smp_affinity", desc->dir); unregister_irq_proc()
383 remove_proc_entry("affinity_hint", desc->dir); unregister_irq_proc()
384 remove_proc_entry("smp_affinity_list", desc->dir); unregister_irq_proc()
385 remove_proc_entry("node", desc->dir); unregister_irq_proc()
387 remove_proc_entry("spurious", desc->dir); unregister_irq_proc()
398 proc_remove(action->dir); unregister_handler_proc()
/linux-4.4.14/arch/powerpc/platforms/cell/spufs/
H A Dinode.c162 static void spufs_prune_dir(struct dentry *dir) spufs_prune_dir() argument
166 mutex_lock(&d_inode(dir)->i_mutex); spufs_prune_dir()
167 list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { spufs_prune_dir()
173 simple_unlink(d_inode(dir), dentry); spufs_prune_dir()
182 shrink_dcache_parent(dir); spufs_prune_dir()
183 mutex_unlock(&d_inode(dir)->i_mutex); spufs_prune_dir()
187 static int spufs_rmdir(struct inode *parent, struct dentry *dir) spufs_rmdir() argument
191 spufs_prune_dir(dir); spufs_rmdir()
192 d_drop(dir); spufs_rmdir()
193 res = simple_rmdir(parent, dir); spufs_rmdir()
195 spu_forget(SPUFS_I(d_inode(dir))->i_ctx); spufs_rmdir()
199 static int spufs_fill_dir(struct dentry *dir, spufs_fill_dir() argument
205 struct dentry *dentry = d_alloc_name(dir, files->name); spufs_fill_dir()
208 ret = spufs_new_file(dir->d_sb, dentry, files->ops, spufs_fill_dir()
221 struct dentry *dir; spufs_dir_close() local
224 dir = file->f_path.dentry; spufs_dir_close()
225 parent = d_inode(dir->d_parent); spufs_dir_close()
226 ctx = SPUFS_I(d_inode(dir))->i_ctx; spufs_dir_close()
229 ret = spufs_rmdir(parent, dir); spufs_dir_close()
247 spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, spufs_mkdir() argument
254 inode = spufs_new_inode(dir->i_sb, mode | S_IFDIR); spufs_mkdir()
258 if (dir->i_mode & S_ISGID) { spufs_mkdir()
259 inode->i_gid = dir->i_gid; spufs_mkdir()
262 ctx = alloc_spu_context(SPUFS_I(dir)->i_gang); /* XXX gang */ spufs_mkdir()
276 inc_nlink(dir); spufs_mkdir()
287 if (!ret && spufs_get_sb_info(dir->i_sb)->debug) spufs_mkdir()
292 spufs_rmdir(dir, dentry); spufs_mkdir()
480 spufs_mkgang(struct inode *dir, struct dentry *dentry, umode_t mode) spufs_mkgang() argument
487 inode = spufs_new_inode(dir->i_sb, mode | S_IFDIR); spufs_mkgang()
492 if (dir->i_mode & S_ISGID) { spufs_mkgang()
493 inode->i_gid = dir->i_gid; spufs_mkgang()
506 inc_nlink(dir); spufs_mkgang()
564 struct inode *dir = d_inode(path->dentry); spufs_create() local
577 if ((flags & SPU_CREATE_GANG) || !SPUFS_I(dir)->i_gang) spufs_create()
583 ret = spufs_create_gang(dir, dentry, path->mnt, mode); spufs_create()
585 ret = spufs_create_context(dir, dentry, path->mnt, flags, mode, spufs_create()
588 fsnotify_mkdir(dir, dentry); spufs_create()
/linux-4.4.14/drivers/net/wireless/mediatek/mt7601u/
H A Ddebugfs.c157 struct dentry *dir; mt7601u_init_debugfs() local
159 dir = debugfs_create_dir("mt7601u", dev->hw->wiphy->debugfsdir); mt7601u_init_debugfs()
160 if (!dir) mt7601u_init_debugfs()
163 debugfs_create_u8("temperature", S_IRUSR, dir, &dev->raw_temp); mt7601u_init_debugfs()
164 debugfs_create_u32("temp_mode", S_IRUSR, dir, &dev->temp_mode); mt7601u_init_debugfs()
166 debugfs_create_u32("regidx", S_IRUSR | S_IWUSR, dir, &dev->debugfs_reg); mt7601u_init_debugfs()
167 debugfs_create_file("regval", S_IRUSR | S_IWUSR, dir, dev, mt7601u_init_debugfs()
169 debugfs_create_file("ampdu_stat", S_IRUSR, dir, dev, &fops_ampdu_stat); mt7601u_init_debugfs()
170 debugfs_create_file("eeprom_param", S_IRUSR, dir, dev, mt7601u_init_debugfs()
/linux-4.4.14/sound/pci/lola/
H A Dlola_mixer.c32 int dir, int nid) lola_init_pin()
46 else if (val == 0x0040000a && dir == CAPT) /* Dig=0, InAmp/ovrd */ lola_init_pin()
48 else if (val == 0x0040000c && dir == PLAY) /* Dig=0, OutAmp/ovrd */ lola_init_pin()
60 if (dir == PLAY) lola_init_pin()
94 int lola_init_pins(struct lola *chip, int dir, int *nidp) lola_init_pins() argument
98 for (i = 0; i < chip->pin[dir].num_pins; i++, nid++) { lola_init_pins()
99 err = lola_init_pin(chip, &chip->pin[dir].pins[i], dir, nid); lola_init_pins()
102 if (chip->pin[dir].pins[i].is_analog) lola_init_pins()
103 chip->pin[dir].num_analog_pins++; lola_init_pins()
329 static int set_analog_volume(struct lola *chip, int dir,
333 int lola_setup_all_analog_gains(struct lola *chip, int dir, bool mute) lola_setup_all_analog_gains() argument
338 pin = chip->pin[dir].pins; lola_setup_all_analog_gains()
339 max_idx = chip->pin[dir].num_pins; lola_setup_all_analog_gains()
344 set_analog_volume(chip, dir, idx, val, false); lola_setup_all_analog_gains()
396 static int set_analog_volume(struct lola *chip, int dir, set_analog_volume() argument
403 if (idx >= chip->pin[dir].num_pins) set_analog_volume()
405 pin = &chip->pin[dir].pins[idx]; set_analog_volume()
413 "set_analog_volume (dir=%d idx=%d, volume=%d)\n", set_analog_volume()
414 dir, idx, val); set_analog_volume()
516 int dir = kcontrol->private_value; lola_analog_vol_info() local
519 uinfo->count = chip->pin[dir].num_pins; lola_analog_vol_info()
521 uinfo->value.integer.max = chip->pin[dir].pins[0].amp_num_steps; lola_analog_vol_info()
529 int dir = kcontrol->private_value; lola_analog_vol_get() local
532 for (i = 0; i < chip->pin[dir].num_pins; i++) lola_analog_vol_get()
534 chip->pin[dir].pins[i].cur_gain_step; lola_analog_vol_get()
542 int dir = kcontrol->private_value; lola_analog_vol_put() local
545 for (i = 0; i < chip->pin[dir].num_pins; i++) { lola_analog_vol_put()
546 err = set_analog_volume(chip, dir, i, lola_analog_vol_put()
559 int dir = kcontrol->private_value; lola_analog_vol_tlv() local
565 pin = &chip->pin[dir].pins[0]; lola_analog_vol_tlv()
594 static int create_analog_mixer(struct lola *chip, int dir, char *name) create_analog_mixer() argument
596 if (!chip->pin[dir].num_pins) create_analog_mixer()
599 if (chip->pin[dir].num_pins != chip->pin[dir].num_analog_pins) create_analog_mixer()
602 lola_analog_mixer.private_value = dir; create_analog_mixer()
31 lola_init_pin(struct lola *chip, struct lola_pin *pin, int dir, int nid) lola_init_pin() argument
/linux-4.4.14/fs/9p/
H A Dvfs_inode.c580 * @dir: directory inode that is being deleted
586 static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags) v9fs_remove() argument
594 dir, dentry, flags); v9fs_remove()
596 v9ses = v9fs_inode2v9ses(dir); v9fs_remove()
621 drop_nlink(dir); v9fs_remove()
626 v9fs_invalidate_inode_attr(dir); v9fs_remove()
634 * @dir: directory that dentry is being created in
642 v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, v9fs_create() argument
690 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); v9fs_create()
717 * @dir: directory inode that is being created
724 v9fs_vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, v9fs_vfs_create() argument
727 struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_create()
732 fid = v9fs_create(v9ses, dir, dentry, NULL, perm, P9_ORDWR); v9fs_vfs_create()
736 v9fs_invalidate_inode_attr(dir); v9fs_vfs_create()
744 * @dir: inode that is being unlinked
750 static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) v9fs_vfs_mkdir() argument
759 v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_mkdir()
761 fid = v9fs_create(v9ses, dir, dentry, NULL, perm, P9_OREAD); v9fs_vfs_mkdir()
766 inc_nlink(dir); v9fs_vfs_mkdir()
767 v9fs_invalidate_inode_attr(dir); v9fs_vfs_mkdir()
778 * @dir: inode that is being walked from
784 struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, v9fs_vfs_lookup() argument
793 p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%pd) %p flags: %x\n", v9fs_vfs_lookup()
794 dir, dentry, dentry, flags); v9fs_vfs_lookup()
799 v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_lookup()
800 /* We can walk d_parent because we hold the dir->i_mutex */ v9fs_vfs_lookup()
820 inode = v9fs_get_inode_from_fid(v9ses, fid, dir->i_sb); v9fs_vfs_lookup()
822 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); v9fs_vfs_lookup()
845 v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, v9fs_vfs_atomic_open() argument
857 res = v9fs_vfs_lookup(dir, dentry, 0); v9fs_vfs_atomic_open()
871 v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_atomic_open()
873 fid = v9fs_create(v9ses, dir, dentry, NULL, perm, v9fs_vfs_atomic_open()
882 v9fs_invalidate_inode_attr(dir); v9fs_vfs_atomic_open()
949 * @old_dir: old dir inode
951 * @new_dir: new dir inode
1005 p9_debug(P9_DEBUG_ERROR, "old dir and new dir are different\n"); v9fs_vfs_rename()
1267 * @dir: inode to create special file in
1274 static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, v9fs_vfs_mkspecial() argument
1280 v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_mkspecial()
1286 fid = v9fs_create(v9ses, dir, dentry, (char *) extension, perm, v9fs_vfs_mkspecial()
1291 v9fs_invalidate_inode_attr(dir); v9fs_vfs_mkspecial()
1298 * @dir: directory inode containing symlink
1307 v9fs_vfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) v9fs_vfs_symlink() argument
1310 dir->i_ino, dentry, symname); v9fs_vfs_symlink()
1312 return v9fs_vfs_mkspecial(dir, dentry, P9_DMSYMLINK, symname); v9fs_vfs_symlink()
1320 * @dir: inode destination for new link
1326 v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, v9fs_vfs_link() argument
1334 dir->i_ino, dentry, old_dentry); v9fs_vfs_link()
1341 retval = v9fs_vfs_mkspecial(dir, dentry, P9_DMLINK, name); v9fs_vfs_link()
1344 v9fs_invalidate_inode_attr(dir); v9fs_vfs_link()
1352 * @dir: inode destination for new link
1360 v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) v9fs_vfs_mknod() argument
1362 struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_mknod()
1368 dir->i_ino, dentry, mode, v9fs_vfs_mknod()
1380 retval = v9fs_vfs_mkspecial(dir, dentry, perm, name); v9fs_vfs_mknod()
/linux-4.4.14/include/sound/
H A Dhda_regmap.h39 * @dir: direction (#HDA_INPUT, #HDA_OUTPUT)
44 #define snd_hdac_regmap_encode_amp(nid, ch, dir, idx) \
47 ((dir) == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT) | \
53 * @dir: direction (#HDA_INPUT, #HDA_OUTPUT)
58 #define snd_hdac_regmap_encode_amp_stereo(nid, dir, idx) \
61 ((dir) == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT) | \
131 int ch, int dir, int idx) snd_hdac_regmap_get_amp()
133 unsigned int cmd = snd_hdac_regmap_encode_amp(nid, ch, dir, idx); snd_hdac_regmap_get_amp()
155 int ch, int dir, int idx, int mask, int val) snd_hdac_regmap_update_amp()
157 unsigned int cmd = snd_hdac_regmap_encode_amp(nid, ch, dir, idx); snd_hdac_regmap_update_amp()
176 int dir, int idx) snd_hdac_regmap_get_amp_stereo()
178 unsigned int cmd = snd_hdac_regmap_encode_amp_stereo(nid, dir, idx); snd_hdac_regmap_get_amp_stereo()
200 int dir, int idx, int mask, int val) snd_hdac_regmap_update_amp_stereo()
202 unsigned int cmd = snd_hdac_regmap_encode_amp_stereo(nid, dir, idx); snd_hdac_regmap_update_amp_stereo()
130 snd_hdac_regmap_get_amp(struct hdac_device *codec, hda_nid_t nid, int ch, int dir, int idx) snd_hdac_regmap_get_amp() argument
154 snd_hdac_regmap_update_amp(struct hdac_device *codec, hda_nid_t nid, int ch, int dir, int idx, int mask, int val) snd_hdac_regmap_update_amp() argument
175 snd_hdac_regmap_get_amp_stereo(struct hdac_device *codec, hda_nid_t nid, int dir, int idx) snd_hdac_regmap_get_amp_stereo() argument
199 snd_hdac_regmap_update_amp_stereo(struct hdac_device *codec, hda_nid_t nid, int dir, int idx, int mask, int val) snd_hdac_regmap_update_amp_stereo() argument
/linux-4.4.14/fs/proc/
H A Dproc_sysctl.c33 static void set_empty_dir(struct ctl_dir *dir) set_empty_dir() argument
35 dir->header.ctl_table[0].child = sysctl_mount_point; set_empty_dir()
38 static void clear_empty_dir(struct ctl_dir *dir) clear_empty_dir() argument
41 dir->header.ctl_table[0].child = NULL; clear_empty_dir()
61 .default_set.dir.header = {
79 static void sysctl_print_dir(struct ctl_dir *dir) sysctl_print_dir() argument
81 if (dir->header.parent) sysctl_print_dir()
82 sysctl_print_dir(dir->header.parent); sysctl_print_dir()
83 pr_cont("%s/", dir->header.ctl_table[0].procname); sysctl_print_dir()
103 struct ctl_dir *dir, const char *name, int namelen) find_entry()
107 struct rb_node *node = dir->root.rb_node; find_entry()
207 static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header) insert_header() argument
213 if (is_empty_dir(&dir->header)) insert_header()
218 if (!RB_EMPTY_ROOT(&dir->root)) insert_header()
220 set_empty_dir(dir); insert_header()
223 dir->header.nreg++; insert_header()
224 header->parent = dir; insert_header()
239 clear_empty_dir(dir); insert_header()
241 drop_sysctl_table(&dir->header); insert_header()
331 struct ctl_dir *dir, lookup_entry()
338 entry = find_entry(&head, dir, name, namelen); lookup_entry()
359 static void first_entry(struct ctl_dir *dir, first_entry() argument
367 ctl_node = first_usable_entry(rb_first(&dir->root)); first_entry()
468 head = &sysctl_table_root.default_set.dir.header; grab_header()
472 static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, proc_sys_lookup() argument
475 struct ctl_table_header *head = grab_header(dir); proc_sys_lookup()
501 inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); proc_sys_lookup()
618 struct dentry *child, *dir = file->f_path.dentry; proc_sys_fill_cache() local
628 child = d_lookup(dir, &qname); proc_sys_fill_cache()
630 child = d_alloc(dir, &qname); proc_sys_fill_cache()
632 inode = proc_sys_make_inode(dir->d_sb, head, table); proc_sys_fill_cache()
862 static struct ctl_dir *find_subdir(struct ctl_dir *dir, find_subdir() argument
868 entry = find_entry(&head, dir, name, namelen); find_subdir()
897 init_header(&new->header, set->dir.header.root, set, node, table); new_dir()
904 * @dir: Directory to create the subdirectory in
910 * the reference is moved from @dir to the returned subdirectory.
911 * Upon error an error code is returned and the reference on @dir is
914 static struct ctl_dir *get_subdir(struct ctl_dir *dir, get_subdir() argument
917 struct ctl_table_set *set = dir->header.set; get_subdir()
922 subdir = find_subdir(dir, name, namelen); get_subdir()
936 subdir = find_subdir(dir, name, namelen); get_subdir()
943 err = insert_header(dir, &new->header); get_subdir()
953 sysctl_print_dir(dir); get_subdir()
957 drop_sysctl_table(&dir->header); get_subdir()
964 static struct ctl_dir *xlate_dir(struct ctl_table_set *set, struct ctl_dir *dir) xlate_dir() argument
968 if (!dir->header.parent) xlate_dir()
969 return &set->dir; xlate_dir()
970 parent = xlate_dir(set, dir->header.parent); xlate_dir()
973 procname = dir->header.ctl_table[0].procname; xlate_dir()
984 struct ctl_dir *dir; sysctl_follow_link() local
991 dir = xlate_dir(set, (*phead)->parent); sysctl_follow_link()
992 if (IS_ERR(dir)) sysctl_follow_link()
993 ret = PTR_ERR(dir); sysctl_follow_link()
997 entry = find_entry(&head, dir, procname, strlen(procname)); sysctl_follow_link()
1057 static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table, new_links() argument
1094 init_header(links, dir->header.root, dir->header.set, node, link_table); new_links()
1100 static bool get_links(struct ctl_dir *dir, get_links() argument
1109 link = find_entry(&head, dir, procname, strlen(procname)); get_links()
1122 link = find_entry(&head, dir, procname, strlen(procname)); get_links()
1215 struct ctl_table_root *root = set->dir.header.root; __register_sysctl_table()
1218 struct ctl_dir *dir; __register_sysctl_table() local
1237 dir = &set->dir; __register_sysctl_table()
1239 dir->header.nreg++; __register_sysctl_table()
1255 dir = get_subdir(dir, name, namelen); __register_sysctl_table()
1256 if (IS_ERR(dir)) __register_sysctl_table()
1261 if (insert_header(dir, header)) __register_sysctl_table()
1264 drop_sysctl_table(&dir->header); __register_sysctl_table()
1270 drop_sysctl_table(&dir->header); __register_sysctl_table()
1601 init_header(&set->dir.header, root, set, NULL, root_table); setup_sysctl_set()
1606 WARN_ON(!RB_EMPTY_ROOT(&set->dir.root)); retire_sysctl_set()
102 find_entry(struct ctl_table_header **phead, struct ctl_dir *dir, const char *name, int namelen) find_entry() argument
330 lookup_entry(struct ctl_table_header **phead, struct ctl_dir *dir, const char *name, int namelen) lookup_entry() argument
/linux-4.4.14/drivers/crypto/
H A Dixp4xx_crypto.c111 enum dma_data_direction dir; member in struct:buffer_desc
337 dma_unmap_single(dev, buf->phys_next, buf->buf_len, buf->dir); free_buf_chain()
542 static void reset_sa_dir(struct ix_sa_dir *dir) reset_sa_dir() argument
544 memset(dir->npe_ctx, 0, NPE_CTX_LEN); reset_sa_dir()
545 dir->npe_ctx_idx = 0; reset_sa_dir()
546 dir->npe_mode = 0; reset_sa_dir()
549 static int init_sa_dir(struct ix_sa_dir *dir) init_sa_dir() argument
551 dir->npe_ctx = dma_pool_alloc(ctx_pool, GFP_KERNEL, &dir->npe_ctx_phys); init_sa_dir()
552 if (!dir->npe_ctx) { init_sa_dir()
555 reset_sa_dir(dir); init_sa_dir()
559 static void free_sa_dir(struct ix_sa_dir *dir) free_sa_dir() argument
561 memset(dir->npe_ctx, 0, NPE_CTX_LEN); free_sa_dir()
562 dma_pool_free(ctx_pool, dir->npe_ctx, dir->npe_ctx_phys); free_sa_dir()
668 struct ix_sa_dir *dir; setup_auth() local
672 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; setup_auth()
673 cinfo = dir->npe_ctx + dir->npe_ctx_idx; setup_auth()
688 itarget = dir->npe_ctx_phys + dir->npe_ctx_idx setup_auth()
691 init_len = cinfo - (dir->npe_ctx + dir->npe_ctx_idx); setup_auth()
692 npe_ctx_addr = dir->npe_ctx_phys + dir->npe_ctx_idx; setup_auth()
694 dir->npe_ctx_idx += init_len; setup_auth()
695 dir->npe_mode |= NPE_OP_HASH_ENABLE; setup_auth()
698 dir->npe_mode |= NPE_OP_HASH_VERIFY; setup_auth()
712 struct ix_sa_dir *dir = &ctx->decrypt; gen_rev_aes_key() local
718 *(u32*)dir->npe_ctx |= cpu_to_be32(CIPH_ENCR); gen_rev_aes_key()
724 crypt->crypto_ctx = dir->npe_ctx_phys; gen_rev_aes_key()
725 crypt->icv_rev_aes = dir->npe_ctx_phys + sizeof(u32); gen_rev_aes_key()
727 crypt->init_len = dir->npe_ctx_idx; gen_rev_aes_key()
742 struct ix_sa_dir *dir; setup_cipher() local
746 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; setup_cipher()
747 cinfo = dir->npe_ctx; setup_cipher()
751 dir->npe_mode |= NPE_OP_CRYPT_ENCRYPT; setup_cipher()
790 dir->npe_ctx_idx = sizeof(cipher_cfg) + key_len; setup_cipher()
791 dir->npe_mode |= NPE_OP_CRYPT_ENABLE; setup_cipher()
801 enum dma_data_direction dir) chainup_buffers()
816 sg_dma_address(sg) = dma_map_single(dev, ptr, len, dir); chainup_buffers()
823 buf->dir = dir; chainup_buffers()
887 struct ix_sa_dir *dir; ablk_perform() local
902 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; ablk_perform()
909 crypt->crypto_ctx = dir->npe_ctx_phys; ablk_perform()
910 crypt->mode = dir->npe_mode; ablk_perform()
911 crypt->init_len = dir->npe_ctx_idx; ablk_perform()
994 struct ix_sa_dir *dir; aead_perform() local
1011 dir = &ctx->encrypt; aead_perform()
1014 dir = &ctx->decrypt; aead_perform()
1024 crypt->crypto_ctx = dir->npe_ctx_phys; aead_perform()
1025 crypt->mode = dir->npe_mode; aead_perform()
1026 crypt->init_len = dir->npe_ctx_idx; aead_perform()
798 chainup_buffers(struct device *dev, struct scatterlist *sg, unsigned nbytes, struct buffer_desc *buf, gfp_t flags, enum dma_data_direction dir) chainup_buffers() argument
/linux-4.4.14/drivers/scsi/
H A Djazz_esp.c42 size_t sz, int dir) jazz_esp_map_single()
44 return dma_map_single(esp->dev, buf, sz, dir); jazz_esp_map_single()
48 int num_sg, int dir) jazz_esp_map_sg()
50 return dma_map_sg(esp->dev, sg, num_sg, dir); jazz_esp_map_sg()
54 size_t sz, int dir) jazz_esp_unmap_single()
56 dma_unmap_single(esp->dev, addr, sz, dir); jazz_esp_unmap_single()
60 int num_sg, int dir) jazz_esp_unmap_sg()
62 dma_unmap_sg(esp->dev, sg, num_sg, dir); jazz_esp_unmap_sg()
41 jazz_esp_map_single(struct esp *esp, void *buf, size_t sz, int dir) jazz_esp_map_single() argument
47 jazz_esp_map_sg(struct esp *esp, struct scatterlist *sg, int num_sg, int dir) jazz_esp_map_sg() argument
53 jazz_esp_unmap_single(struct esp *esp, dma_addr_t addr, size_t sz, int dir) jazz_esp_unmap_single() argument
59 jazz_esp_unmap_sg(struct esp *esp, struct scatterlist *sg, int num_sg, int dir) jazz_esp_unmap_sg() argument
/linux-4.4.14/drivers/iio/adc/
H A Dxilinx-xadc-events.c72 enum iio_event_direction dir) xadc_get_threshold_offset()
85 if (dir == IIO_EV_DIR_FALLING) xadc_get_threshold_offset()
118 enum iio_event_direction dir) xadc_read_event_config()
127 enum iio_event_direction dir, int state) xadc_write_event_config()
166 enum iio_event_direction dir, enum iio_event_info info, xadc_read_event_value()
169 unsigned int offset = xadc_get_threshold_offset(chan, dir); xadc_read_event_value()
190 enum iio_event_direction dir, enum iio_event_info info, xadc_write_event_value()
193 unsigned int offset = xadc_get_threshold_offset(chan, dir); xadc_write_event_value()
71 xadc_get_threshold_offset(const struct iio_chan_spec *chan, enum iio_event_direction dir) xadc_get_threshold_offset() argument
116 xadc_read_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir) xadc_read_event_config() argument
125 xadc_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, int state) xadc_write_event_config() argument
164 xadc_read_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, enum iio_event_info info, int *val, int *val2) xadc_read_event_value() argument
188 xadc_write_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, enum iio_event_info info, int val, int val2) xadc_write_event_value() argument
/linux-4.4.14/drivers/misc/mei/
H A Ddebugfs.c201 struct dentry *dir, *f; mei_dbgfs_register() local
203 dir = debugfs_create_dir(name, NULL); mei_dbgfs_register()
204 if (!dir) mei_dbgfs_register()
207 dev->dbgfs_dir = dir; mei_dbgfs_register()
209 f = debugfs_create_file("meclients", S_IRUSR, dir, mei_dbgfs_register()
215 f = debugfs_create_file("active", S_IRUSR, dir, mei_dbgfs_register()
221 f = debugfs_create_file("devstate", S_IRUSR, dir, mei_dbgfs_register()
227 f = debugfs_create_bool("allow_fixed_address", S_IRUSR | S_IWUSR, dir, mei_dbgfs_register()
/linux-4.4.14/arch/alpha/oprofile/
H A Dcommon.c114 struct dentry *dir; op_axp_create_files() local
118 dir = oprofilefs_mkdir(root, buf); op_axp_create_files()
120 oprofilefs_create_ulong(dir, "enabled", &ctr[i].enabled); op_axp_create_files()
121 oprofilefs_create_ulong(dir, "event", &ctr[i].event); op_axp_create_files()
122 oprofilefs_create_ulong(dir, "count", &ctr[i].count); op_axp_create_files()
124 oprofilefs_create_ulong(dir, "kernel", &ctr[i].kernel); op_axp_create_files()
125 oprofilefs_create_ulong(dir, "user", &ctr[i].user); op_axp_create_files()
126 oprofilefs_create_ulong(dir, "unit_mask", &ctr[i].unit_mask); op_axp_create_files()
/linux-4.4.14/fs/
H A Dbad_inode.c28 static int bad_inode_create (struct inode *dir, struct dentry *dentry, bad_inode_create() argument
34 static struct dentry *bad_inode_lookup(struct inode *dir, bad_inode_lookup() argument
40 static int bad_inode_link (struct dentry *old_dentry, struct inode *dir, bad_inode_link() argument
46 static int bad_inode_unlink(struct inode *dir, struct dentry *dentry) bad_inode_unlink() argument
51 static int bad_inode_symlink (struct inode *dir, struct dentry *dentry, bad_inode_symlink() argument
57 static int bad_inode_mkdir(struct inode *dir, struct dentry *dentry, bad_inode_mkdir() argument
63 static int bad_inode_rmdir (struct inode *dir, struct dentry *dentry) bad_inode_rmdir() argument
68 static int bad_inode_mknod (struct inode *dir, struct dentry *dentry, bad_inode_mknod() argument
/linux-4.4.14/include/trace/events/
H A Dasoc.h11 #define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
159 enum snd_soc_dapm_direction dir,
162 TP_ARGS(widget, dir, path),
167 __string( pnname, path->node[dir]->name )
176 __assign_str(pnname, path->node[dir]->name);
178 __entry->path_node = (long)path->node[dir];
179 __entry->path_dir = dir;
/linux-4.4.14/arch/arm64/mm/
H A Ddma-mapping.c204 enum dma_data_direction dir, __swiotlb_map_page()
209 dev_addr = swiotlb_map_page(dev, page, offset, size, dir, attrs); __swiotlb_map_page()
211 __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_map_page()
218 size_t size, enum dma_data_direction dir, __swiotlb_unmap_page()
222 __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_unmap_page()
223 swiotlb_unmap_page(dev, dev_addr, size, dir, attrs); __swiotlb_unmap_page()
227 int nelems, enum dma_data_direction dir, __swiotlb_map_sg_attrs()
233 ret = swiotlb_map_sg_attrs(dev, sgl, nelems, dir, attrs); __swiotlb_map_sg_attrs()
237 sg->length, dir); __swiotlb_map_sg_attrs()
244 enum dma_data_direction dir, __swiotlb_unmap_sg_attrs()
253 sg->length, dir); __swiotlb_unmap_sg_attrs()
254 swiotlb_unmap_sg_attrs(dev, sgl, nelems, dir, attrs); __swiotlb_unmap_sg_attrs()
259 enum dma_data_direction dir) __swiotlb_sync_single_for_cpu()
262 __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_sync_single_for_cpu()
263 swiotlb_sync_single_for_cpu(dev, dev_addr, size, dir); __swiotlb_sync_single_for_cpu()
268 enum dma_data_direction dir) __swiotlb_sync_single_for_device()
270 swiotlb_sync_single_for_device(dev, dev_addr, size, dir); __swiotlb_sync_single_for_device()
272 __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_sync_single_for_device()
277 enum dma_data_direction dir) __swiotlb_sync_sg_for_cpu()
285 sg->length, dir); __swiotlb_sync_sg_for_cpu()
286 swiotlb_sync_sg_for_cpu(dev, sgl, nelems, dir); __swiotlb_sync_sg_for_cpu()
291 enum dma_data_direction dir) __swiotlb_sync_sg_for_device()
296 swiotlb_sync_sg_for_device(dev, sgl, nelems, dir); __swiotlb_sync_sg_for_device()
300 sg->length, dir); __swiotlb_sync_sg_for_device()
449 enum dma_data_direction dir, __dummy_map_page()
456 size_t size, enum dma_data_direction dir, __dummy_unmap_page()
462 int nelems, enum dma_data_direction dir, __dummy_map_sg()
470 enum dma_data_direction dir, __dummy_unmap_sg()
477 enum dma_data_direction dir) __dummy_sync_single()
483 enum dma_data_direction dir) __dummy_sync_sg()
670 enum dma_data_direction dir) __iommu_sync_single_for_cpu()
678 __dma_unmap_area(phys_to_virt(phys), size, dir); __iommu_sync_single_for_cpu() local
683 enum dma_data_direction dir) __iommu_sync_single_for_device()
691 __dma_map_area(phys_to_virt(phys), size, dir); __iommu_sync_single_for_device() local
696 enum dma_data_direction dir, __iommu_map_page()
700 int prot = dma_direction_to_prot(dir, coherent); __iommu_map_page()
705 __iommu_sync_single_for_device(dev, dev_addr, size, dir); __iommu_map_page()
711 size_t size, enum dma_data_direction dir, __iommu_unmap_page()
715 __iommu_sync_single_for_cpu(dev, dev_addr, size, dir); __iommu_unmap_page()
717 iommu_dma_unmap_page(dev, dev_addr, size, dir, attrs); __iommu_unmap_page()
722 enum dma_data_direction dir) __iommu_sync_sg_for_cpu()
731 __dma_unmap_area(sg_virt(sg), sg->length, dir); __iommu_sync_sg_for_cpu()
736 enum dma_data_direction dir) __iommu_sync_sg_for_device()
745 __dma_map_area(sg_virt(sg), sg->length, dir); __iommu_sync_sg_for_device()
749 int nelems, enum dma_data_direction dir, __iommu_map_sg_attrs()
755 __iommu_sync_sg_for_device(dev, sgl, nelems, dir); __iommu_map_sg_attrs()
758 dma_direction_to_prot(dir, coherent)); __iommu_map_sg_attrs()
763 enum dma_data_direction dir, __iommu_unmap_sg_attrs()
767 __iommu_sync_sg_for_cpu(dev, sgl, nelems, dir); __iommu_unmap_sg_attrs()
769 iommu_dma_unmap_sg(dev, sgl, nelems, dir, attrs); __iommu_unmap_sg_attrs()
202 __swiotlb_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __swiotlb_map_page() argument
217 __swiotlb_unmap_page(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __swiotlb_unmap_page() argument
226 __swiotlb_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) __swiotlb_map_sg_attrs() argument
242 __swiotlb_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) __swiotlb_unmap_sg_attrs() argument
257 __swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) __swiotlb_sync_single_for_cpu() argument
266 __swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) __swiotlb_sync_single_for_device() argument
275 __swiotlb_sync_sg_for_cpu(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) __swiotlb_sync_sg_for_cpu() argument
289 __swiotlb_sync_sg_for_device(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) __swiotlb_sync_sg_for_device() argument
447 __dummy_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __dummy_map_page() argument
455 __dummy_unmap_page(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __dummy_unmap_page() argument
461 __dummy_map_sg(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) __dummy_map_sg() argument
468 __dummy_unmap_sg(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) __dummy_unmap_sg() argument
475 __dummy_sync_single(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) __dummy_sync_single() argument
481 __dummy_sync_sg(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) __dummy_sync_sg() argument
668 __iommu_sync_single_for_cpu(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) __iommu_sync_single_for_cpu() argument
681 __iommu_sync_single_for_device(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) __iommu_sync_single_for_device() argument
694 __iommu_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __iommu_map_page() argument
710 __iommu_unmap_page(struct device *dev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) __iommu_unmap_page() argument
720 __iommu_sync_sg_for_cpu(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) __iommu_sync_sg_for_cpu() argument
734 __iommu_sync_sg_for_device(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) __iommu_sync_sg_for_device() argument
748 __iommu_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) __iommu_map_sg_attrs() argument
761 __iommu_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) __iommu_unmap_sg_attrs() argument
/linux-4.4.14/arch/avr32/oprofile/
H A Dop_model_avr32.c102 struct dentry *dir; avr32_perf_counter_create_files() local
108 dir = oprofilefs_mkdir(root, filename); avr32_perf_counter_create_files()
110 oprofilefs_create_ulong(dir, "enabled", avr32_perf_counter_create_files()
112 oprofilefs_create_ulong(dir, "event", avr32_perf_counter_create_files()
114 oprofilefs_create_ulong(dir, "count", avr32_perf_counter_create_files()
118 oprofilefs_create_ulong(dir, "kernel", avr32_perf_counter_create_files()
120 oprofilefs_create_ulong(dir, "user", avr32_perf_counter_create_files()
122 oprofilefs_create_ulong(dir, "unit_mask", avr32_perf_counter_create_files()
/linux-4.4.14/drivers/media/usb/uvc/
H A Duvc_debugfs.c120 struct dentry *dir; uvc_debugfs_init() local
122 dir = debugfs_create_dir("uvcvideo", usb_debug_root); uvc_debugfs_init()
123 if (IS_ERR_OR_NULL(dir)) { uvc_debugfs_init()
128 uvc_debugfs_root_dir = dir; uvc_debugfs_init()
/linux-4.4.14/arch/x86/kernel/
H A Dpci-nommu.c30 enum dma_data_direction dir, nommu_map_page()
57 int nents, enum dma_data_direction dir, nommu_map_sg()
78 enum dma_data_direction dir) nommu_sync_single_for_device()
86 enum dma_data_direction dir) nommu_sync_sg_for_device()
28 nommu_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, struct dma_attrs *attrs) nommu_map_page() argument
56 nommu_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) nommu_map_sg() argument
76 nommu_sync_single_for_device(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) nommu_sync_single_for_device() argument
84 nommu_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) nommu_sync_sg_for_device() argument
/linux-4.4.14/fs/jffs2/
H A DMakefile8 jffs2-y := compr.o dir.o file.o ioctl.o nodelist.o malloc.o
/linux-4.4.14/arch/mips/include/asm/
H A Dtxx9pio.h17 __u32 dir; member in struct:txx9_pio_reg

Completed in 4797 milliseconds

123456789