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

12345678

/linux-4.1.27/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.1.27/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.1.27/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.1.27/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.1.27/fs/sysfs/
H A DMakefile5 obj-y := file.o dir.o symlink.o mount.o group.o
/linux-4.1.27/fs/kernfs/
H A DMakefile5 obj-y := mount.o inode.o dir.o file.o symlink.o
/linux-4.1.27/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.1.27/drivers/video/fbdev/msm/
H A Dmdp_hw.h419 #define PPP_CFG_MDP_RGB_565(dir) (PPP_##dir##_C2R_5BIT | \
420 PPP_##dir##_C0G_6BIT | \
421 PPP_##dir##_C1B_5BIT | \
422 PPP_##dir##_BPP_2BYTES | \
423 PPP_##dir##_INTERLVD_3COMPONENTS | \
424 PPP_##dir##_PACK_TIGHT | \
425 PPP_##dir##_PACK_ALIGN_LSB | \
426 PPP_##dir##_PLANE_INTERLVD)
428 #define PPP_CFG_MDP_RGB_888(dir) (PPP_##dir##_C2R_8BIT | \
429 PPP_##dir##_C0G_8BIT | \
430 PPP_##dir##_C1B_8BIT | \
431 PPP_##dir##_BPP_3BYTES | \
432 PPP_##dir##_INTERLVD_3COMPONENTS | \
433 PPP_##dir##_PACK_TIGHT | \
434 PPP_##dir##_PACK_ALIGN_LSB | \
435 PPP_##dir##_PLANE_INTERLVD)
437 #define PPP_CFG_MDP_ARGB_8888(dir) (PPP_##dir##_C2R_8BIT | \
438 PPP_##dir##_C0G_8BIT | \
439 PPP_##dir##_C1B_8BIT | \
440 PPP_##dir##_C3A_8BIT | \
441 PPP_##dir##_C3ALPHA_EN | \
442 PPP_##dir##_BPP_4BYTES | \
443 PPP_##dir##_INTERLVD_4COMPONENTS | \
444 PPP_##dir##_PACK_TIGHT | \
445 PPP_##dir##_PACK_ALIGN_LSB | \
446 PPP_##dir##_PLANE_INTERLVD)
448 #define PPP_CFG_MDP_XRGB_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
449 #define PPP_CFG_MDP_RGBA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
450 #define PPP_CFG_MDP_BGRA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
451 #define PPP_CFG_MDP_RGBX_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
453 #define PPP_CFG_MDP_Y_CBCR_H2V2(dir) (PPP_##dir##_C2R_8BIT | \
454 PPP_##dir##_C0G_8BIT | \
455 PPP_##dir##_C1B_8BIT | \
456 PPP_##dir##_C3A_8BIT | \
457 PPP_##dir##_BPP_2BYTES | \
458 PPP_##dir##_INTERLVD_2COMPONENTS | \
459 PPP_##dir##_PACK_TIGHT | \
460 PPP_##dir##_PACK_ALIGN_LSB | \
461 PPP_##dir##_PLANE_PSEUDOPLNR)
463 #define PPP_CFG_MDP_Y_CRCB_H2V2(dir) PPP_CFG_MDP_Y_CBCR_H2V2(dir)
465 #define PPP_CFG_MDP_YCRYCB_H2V1(dir) (PPP_##dir##_C2R_8BIT | \
466 PPP_##dir##_C0G_8BIT | \
467 PPP_##dir##_C1B_8BIT | \
468 PPP_##dir##_C3A_8BIT | \
469 PPP_##dir##_BPP_2BYTES | \
470 PPP_##dir##_INTERLVD_4COMPONENTS | \
471 PPP_##dir##_PACK_TIGHT | \
472 PPP_##dir##_PACK_ALIGN_LSB |\
473 PPP_##dir##_PLANE_INTERLVD)
475 #define PPP_CFG_MDP_Y_CBCR_H2V1(dir) (PPP_##dir##_C2R_8BIT | \
476 PPP_##dir##_C0G_8BIT | \
477 PPP_##dir##_C1B_8BIT | \
478 PPP_##dir##_C3A_8BIT | \
479 PPP_##dir##_BPP_2BYTES | \
480 PPP_##dir##_INTERLVD_2COMPONENTS | \
481 PPP_##dir##_PACK_TIGHT | \
482 PPP_##dir##_PACK_ALIGN_LSB | \
483 PPP_##dir##_PLANE_PSEUDOPLNR)
485 #define PPP_CFG_MDP_Y_CRCB_H2V1(dir) PPP_CFG_MDP_Y_CBCR_H2V1(dir)
508 #define PPP_CHROMA_SAMP_MDP_RGB_565(dir) PPP_OP_##dir##_CHROMA_RGB
509 #define PPP_CHROMA_SAMP_MDP_RGB_888(dir) PPP_OP_##dir##_CHROMA_RGB
510 #define PPP_CHROMA_SAMP_MDP_XRGB_8888(dir) PPP_OP_##dir##_CHROMA_RGB
511 #define PPP_CHROMA_SAMP_MDP_ARGB_8888(dir) PPP_OP_##dir##_CHROMA_RGB
512 #define PPP_CHROMA_SAMP_MDP_RGBA_8888(dir) PPP_OP_##dir##_CHROMA_RGB
513 #define PPP_CHROMA_SAMP_MDP_BGRA_8888(dir) PPP_OP_##dir##_CHROMA_RGB
514 #define PPP_CHROMA_SAMP_MDP_RGBX_8888(dir) PPP_OP_##dir##_CHROMA_RGB
515 #define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
516 #define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V2(dir) PPP_OP_##dir##_CHROMA_420
517 #define PPP_CHROMA_SAMP_MDP_Y_CRCB_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
518 #define PPP_CHROMA_SAMP_MDP_Y_CRCB_H2V2(dir) PPP_OP_##dir##_CHROMA_420
519 #define PPP_CHROMA_SAMP_MDP_YCRYCB_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
536 #define PPP_ARRAY1(name, dir) \
537 [MDP_RGB_565] = PPP_##name##_MDP_RGB_565(dir),\
538 [MDP_RGB_888] = PPP_##name##_MDP_RGB_888(dir),\
539 [MDP_XRGB_8888] = PPP_##name##_MDP_XRGB_8888(dir),\
540 [MDP_ARGB_8888] = PPP_##name##_MDP_ARGB_8888(dir),\
541 [MDP_RGBA_8888] = PPP_##name##_MDP_RGBA_8888(dir),\
542 [MDP_BGRA_8888] = PPP_##name##_MDP_BGRA_8888(dir),\
543 [MDP_RGBX_8888] = PPP_##name##_MDP_RGBX_8888(dir),\
544 [MDP_Y_CBCR_H2V1] = PPP_##name##_MDP_Y_CBCR_H2V1(dir),\
545 [MDP_Y_CBCR_H2V2] = PPP_##name##_MDP_Y_CBCR_H2V2(dir),\
546 [MDP_Y_CRCB_H2V1] = PPP_##name##_MDP_Y_CRCB_H2V1(dir),\
547 [MDP_Y_CRCB_H2V2] = PPP_##name##_MDP_Y_CRCB_H2V2(dir),\
548 [MDP_YCRYCB_H2V1] = PPP_##name##_MDP_YCRYCB_H2V1(dir)
/linux-4.1.27/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.1.27/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.1.27/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()
700 swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir, swiotlb_full() argument
716 if (dir == DMA_BIDIRECTIONAL) swiotlb_full()
718 if (dir == DMA_FROM_DEVICE) swiotlb_full()
720 if (dir == DMA_TO_DEVICE) swiotlb_full()
733 enum dma_data_direction dir, swiotlb_map_page()
739 BUG_ON(dir == DMA_NONE); swiotlb_map_page()
751 map = map_single(dev, phys, size, dir); swiotlb_map_page()
753 swiotlb_full(dev, size, dir, 1); swiotlb_map_page()
761 swiotlb_tbl_unmap_single(dev, map, size, dir); swiotlb_map_page()
778 size_t size, enum dma_data_direction dir) unmap_single()
782 BUG_ON(dir == DMA_NONE); unmap_single()
785 swiotlb_tbl_unmap_single(hwdev, paddr, size, dir); unmap_single()
789 if (dir != DMA_FROM_DEVICE) unmap_single()
802 size_t size, enum dma_data_direction dir, swiotlb_unmap_page()
805 unmap_single(hwdev, dev_addr, size, dir); swiotlb_unmap_page()
821 size_t size, enum dma_data_direction dir, swiotlb_sync_single()
826 BUG_ON(dir == DMA_NONE); swiotlb_sync_single()
829 swiotlb_tbl_sync_single(hwdev, paddr, size, dir, target); swiotlb_sync_single()
833 if (dir != DMA_FROM_DEVICE) swiotlb_sync_single()
841 size_t size, enum dma_data_direction dir) swiotlb_sync_single_for_cpu()
843 swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_CPU); swiotlb_sync_single_for_cpu()
849 size_t size, enum dma_data_direction dir) swiotlb_sync_single_for_device()
851 swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_DEVICE); swiotlb_sync_single_for_device()
873 enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_map_sg_attrs()
878 BUG_ON(dir == DMA_NONE); swiotlb_map_sg_attrs()
887 sg->length, dir); for_each_sg()
891 swiotlb_full(hwdev, sg->length, dir, 0); for_each_sg()
892 swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir, for_each_sg()
908 enum dma_data_direction dir) swiotlb_map_sg()
910 return swiotlb_map_sg_attrs(hwdev, sgl, nelems, dir, NULL); swiotlb_map_sg()
920 int nelems, enum dma_data_direction dir, struct dma_attrs *attrs) swiotlb_unmap_sg_attrs()
925 BUG_ON(dir == DMA_NONE); swiotlb_unmap_sg_attrs()
928 unmap_single(hwdev, sg->dma_address, sg_dma_len(sg), dir); swiotlb_unmap_sg_attrs()
935 enum dma_data_direction dir) swiotlb_unmap_sg()
937 return swiotlb_unmap_sg_attrs(hwdev, sgl, nelems, dir, NULL); swiotlb_unmap_sg()
950 int nelems, enum dma_data_direction dir, swiotlb_sync_sg()
958 sg_dma_len(sg), dir, target); swiotlb_sync_sg()
963 int nelems, enum dma_data_direction dir) swiotlb_sync_sg_for_cpu()
965 swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_CPU); swiotlb_sync_sg_for_cpu()
971 int nelems, enum dma_data_direction dir) swiotlb_sync_sg_for_device()
973 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
731 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
777 unmap_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir) unmap_single() argument
801 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
820 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
840 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
848 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
872 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
907 swiotlb_map_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) swiotlb_map_sg() argument
919 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
934 swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) swiotlb_unmap_sg() argument
949 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
962 swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) swiotlb_sync_sg_for_cpu() argument
970 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.1.27/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()
232 hpfs_lock(dir->i_sb); hpfs_mknod()
234 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); hpfs_mknod()
242 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); hpfs_mknod()
244 result = new_inode(dir->i_sb); hpfs_mknod()
250 hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_mknod()
251 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()
263 r = hpfs_add_dirent(dir, name, len, &dee); hpfs_mknod()
272 fnode->up = cpu_to_le32(dir->i_ino); hpfs_mknod()
278 hpfs_update_directory_times(dir); hpfs_mknod()
281 hpfs_unlock(dir->i_sb); hpfs_mknod()
287 hpfs_free_sectors(dir->i_sb, fno, 1); hpfs_mknod()
289 hpfs_unlock(dir->i_sb); hpfs_mknod()
293 static int hpfs_symlink(struct inode *dir, struct dentry *dentry, const char *symlink) hpfs_symlink() argument
305 hpfs_lock(dir->i_sb); hpfs_symlink()
306 if (hpfs_sb(dir->i_sb)->sb_eas < 2) { hpfs_symlink()
307 hpfs_unlock(dir->i_sb); hpfs_symlink()
311 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); hpfs_symlink()
318 dee.creation_date = dee.write_date = dee.read_date = cpu_to_le32(gmt_to_local(dir->i_sb, get_seconds())); hpfs_symlink()
320 result = new_inode(dir->i_sb); hpfs_symlink()
325 hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_symlink()
326 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()
340 r = hpfs_add_dirent(dir, name, len, &dee); hpfs_symlink()
349 fnode->up = cpu_to_le32(dir->i_ino); hpfs_symlink()
357 hpfs_update_directory_times(dir); hpfs_symlink()
359 hpfs_unlock(dir->i_sb); hpfs_symlink()
365 hpfs_free_sectors(dir->i_sb, fno, 1); hpfs_symlink()
367 hpfs_unlock(dir->i_sb); hpfs_symlink()
371 static int hpfs_unlink(struct inode *dir, struct dentry *dentry) hpfs_unlink() argument
382 hpfs_lock(dir->i_sb); hpfs_unlink()
386 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); hpfs_unlink()
398 r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); hpfs_unlink()
401 hpfs_error(dir->i_sb, "there was error when removing dirent"); hpfs_unlink()
417 hpfs_update_directory_times(dir); hpfs_unlink()
418 hpfs_unlock(dir->i_sb); hpfs_unlink()
422 static int hpfs_rmdir(struct inode *dir, struct dentry *dentry) hpfs_rmdir() argument
435 hpfs_lock(dir->i_sb); hpfs_rmdir()
437 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, &dno, &qbh); hpfs_rmdir()
449 hpfs_count_dnodes(dir->i_sb, hpfs_i(inode)->i_dno, NULL, NULL, &n_items); hpfs_rmdir()
454 r = hpfs_remove_dirent(dir, dno, de, &qbh, 1); hpfs_rmdir()
457 hpfs_error(dir->i_sb, "there was error when removing dirent"); hpfs_rmdir()
464 drop_nlink(dir); hpfs_rmdir()
473 hpfs_update_directory_times(dir); hpfs_rmdir()
474 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.1.27/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.1.27/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
56 struct inode *dir = mapping->host; dir_commit_chunk() local
60 if (pos+len > dir->i_size) { dir_commit_chunk()
61 i_size_write(dir, pos+len); dir_commit_chunk()
62 mark_inode_dirty(dir); dir_commit_chunk()
64 if (IS_DIRSYNC(dir)) dir_commit_chunk()
71 static struct page * dir_get_page(struct inode *dir, unsigned long n) dir_get_page() argument
73 struct address_space *mapping = dir->i_mapping; dir_get_page()
159 struct inode * dir = d_inode(dentry->d_parent); minix_find_entry() local
160 struct super_block * sb = dir->i_sb; minix_find_entry()
163 unsigned long npages = dir_pages(dir); minix_find_entry()
174 page = dir_get_page(dir, n); minix_find_entry()
179 limit = kaddr + minix_last_byte(dir, n) - sbi->s_dirsize; minix_find_entry()
206 struct inode *dir = d_inode(dentry->d_parent); minix_add_link() local
209 struct super_block * sb = dir->i_sb; minix_add_link()
212 unsigned long npages = dir_pages(dir); minix_add_link()
230 page = dir_get_page(dir, n); minix_add_link()
236 dir_end = kaddr + minix_last_byte(dir, n); minix_add_link()
282 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; minix_add_link()
283 mark_inode_dirty(dir); minix_add_link()
319 int minix_make_empty(struct inode *inode, struct inode *dir) minix_make_empty() argument
343 de3->inode = dir->i_ino; minix_make_empty()
351 de->inode = dir->i_ino; minix_make_empty()
419 struct inode *dir = page->mapping->host; minix_set_link() local
420 struct minix_sb_info *sbi = minix_sb(dir->i_sb); minix_set_link()
438 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; minix_set_link()
439 mark_inode_dirty(dir); minix_set_link()
442 struct minix_dir_entry * minix_dotdot (struct inode *dir, struct page **p) minix_dotdot() argument
444 struct page *page = dir_get_page(dir, 0); minix_dotdot()
445 struct minix_sb_info *sbi = minix_sb(dir->i_sb); minix_dotdot()
/linux-4.1.27/fs/configfs/
H A DMakefile7 configfs-objs := inode.o file.o dir.o symlink.o mount.o item.o
/linux-4.1.27/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.1.27/fs/fuse/
H A DMakefile8 fuse-objs := dev.o dir.o file.o inode.o control.o
/linux-4.1.27/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.1.27/include/asm-generic/
H A Ddma-mapping-common.h12 enum dma_data_direction dir, dma_map_single_attrs()
19 BUG_ON(!valid_dma_direction(dir)); dma_map_single_attrs()
22 dir, attrs); dma_map_single_attrs()
25 dir, addr, true); dma_map_single_attrs()
31 enum dma_data_direction dir, dma_unmap_single_attrs()
36 BUG_ON(!valid_dma_direction(dir)); dma_unmap_single_attrs()
38 ops->unmap_page(dev, addr, size, dir, attrs); dma_unmap_single_attrs()
39 debug_dma_unmap_page(dev, addr, size, dir, true); dma_unmap_single_attrs()
47 int nents, enum dma_data_direction dir, dma_map_sg_attrs()
56 BUG_ON(!valid_dma_direction(dir)); dma_map_sg_attrs()
57 ents = ops->map_sg(dev, sg, nents, dir, attrs); dma_map_sg_attrs()
59 debug_dma_map_sg(dev, sg, nents, ents, dir); dma_map_sg_attrs()
65 int nents, enum dma_data_direction dir,
70 BUG_ON(!valid_dma_direction(dir));
71 debug_dma_unmap_sg(dev, sg, nents, dir);
73 ops->unmap_sg(dev, sg, nents, dir, attrs);
78 enum dma_data_direction dir) dma_map_page()
84 BUG_ON(!valid_dma_direction(dir)); dma_map_page()
85 addr = ops->map_page(dev, page, offset, size, dir, NULL); dma_map_page()
86 debug_dma_map_page(dev, page, offset, size, dir, addr, false); dma_map_page()
92 size_t size, enum dma_data_direction dir) dma_unmap_page()
96 BUG_ON(!valid_dma_direction(dir)); dma_unmap_page()
98 ops->unmap_page(dev, addr, size, dir, NULL); dma_unmap_page()
99 debug_dma_unmap_page(dev, addr, size, dir, false); dma_unmap_page()
104 enum dma_data_direction dir) dma_sync_single_for_cpu()
108 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_for_cpu()
110 ops->sync_single_for_cpu(dev, addr, size, dir); dma_sync_single_for_cpu()
111 debug_dma_sync_single_for_cpu(dev, addr, size, dir); dma_sync_single_for_cpu()
116 enum dma_data_direction dir) dma_sync_single_for_device()
120 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_for_device()
122 ops->sync_single_for_device(dev, addr, size, dir); dma_sync_single_for_device()
123 debug_dma_sync_single_for_device(dev, addr, size, dir); dma_sync_single_for_device()
130 enum dma_data_direction dir) dma_sync_single_range_for_cpu()
134 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_range_for_cpu()
136 ops->sync_single_for_cpu(dev, addr + offset, size, dir); dma_sync_single_range_for_cpu()
137 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); dma_sync_single_range_for_cpu()
144 enum dma_data_direction dir) dma_sync_single_range_for_device()
148 BUG_ON(!valid_dma_direction(dir)); dma_sync_single_range_for_device()
150 ops->sync_single_for_device(dev, addr + offset, size, dir); dma_sync_single_range_for_device()
151 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); dma_sync_single_range_for_device()
156 int nelems, enum dma_data_direction dir) dma_sync_sg_for_cpu()
160 BUG_ON(!valid_dma_direction(dir)); dma_sync_sg_for_cpu()
162 ops->sync_sg_for_cpu(dev, sg, nelems, dir); dma_sync_sg_for_cpu()
163 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); dma_sync_sg_for_cpu()
168 int nelems, enum dma_data_direction dir) dma_sync_sg_for_device()
172 BUG_ON(!valid_dma_direction(dir)); dma_sync_sg_for_device()
174 ops->sync_sg_for_device(dev, sg, nelems, dir); dma_sync_sg_for_device()
175 debug_dma_sync_sg_for_device(dev, sg, nelems, dir); dma_sync_sg_for_device()
10 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
29 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
46 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
76 dma_map_page(struct device *dev, struct page *page, size_t offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
91 dma_unmap_page(struct device *dev, dma_addr_t addr, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
102 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
114 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
126 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
140 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
155 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) dma_sync_sg_for_cpu() argument
167 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.1.27/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()
858 static bool nfs_dir_mapping_need_revalidate(struct inode *dir) nfs_dir_mapping_need_revalidate() argument
860 struct nfs_inode *nfsi = NFS_I(dir); nfs_dir_mapping_need_revalidate()
862 if (nfs_attribute_cache_expired(dir)) nfs_dir_mapping_need_revalidate()
948 dfprintk(FILE, "NFS: llseek dir(%pD2, %lld, %d)\n", nfs_llseek_dir()
981 dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync); nfs_fsync_dir()
991 * @dir - pointer to directory inode
994 * full lookup on all child dentries of 'dir' whenever a change occurs
997 * The caller should be holding dir->i_lock
999 void nfs_force_lookup_revalidate(struct inode *dir) nfs_force_lookup_revalidate() argument
1001 NFS_I(dir)->cache_change_attribute++; nfs_force_lookup_revalidate()
1011 static int nfs_check_verifier(struct inode *dir, struct dentry *dentry, nfs_check_verifier() argument
1018 if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONE) nfs_check_verifier()
1020 if (!nfs_verify_change_attribute(dir, dentry->d_time)) nfs_check_verifier()
1024 ret = nfs_revalidate_inode_rcu(NFS_SERVER(dir), dir); nfs_check_verifier()
1026 ret = nfs_revalidate_inode(NFS_SERVER(dir), dir); nfs_check_verifier()
1029 if (!nfs_verify_change_attribute(dir, dentry->d_time)) nfs_check_verifier()
1038 static int nfs_is_exclusive_create(struct inode *dir, unsigned int flags) nfs_is_exclusive_create() argument
1040 if (NFS_PROTO(dir)->version == 2) nfs_is_exclusive_create()
1090 int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry, nfs_neg_need_reval() argument
1096 if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) nfs_neg_need_reval()
1098 return !nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU); nfs_neg_need_reval()
1114 struct inode *dir; nfs_lookup_revalidate() local
1124 dir = d_inode_rcu(parent); nfs_lookup_revalidate()
1125 if (!dir) nfs_lookup_revalidate()
1129 dir = d_inode(parent); nfs_lookup_revalidate()
1131 nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); nfs_lookup_revalidate()
1135 if (nfs_neg_need_reval(dir, dentry, flags)) { nfs_lookup_revalidate()
1151 if (NFS_PROTO(dir)->have_delegation(inode, FMODE_READ)) nfs_lookup_revalidate()
1155 if (!nfs_is_exclusive_create(dir, flags) && nfs_lookup_revalidate()
1156 nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU)) { nfs_lookup_revalidate()
1182 trace_nfs_lookup_revalidate_enter(dir, dentry, flags); nfs_lookup_revalidate()
1183 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label); nfs_lookup_revalidate()
1184 trace_nfs_lookup_revalidate_exit(dir, dentry, flags, error); nfs_lookup_revalidate()
1199 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_lookup_revalidate()
1202 nfs_advise_use_readdirplus(dir); nfs_lookup_revalidate()
1213 nfs_zap_caches(dir); nfs_lookup_revalidate()
1219 nfs_mark_for_revalidate(dir); nfs_lookup_revalidate()
1251 * parent dir (e.g.: ".", "..", procfs symlinks or mountpoint traversals).
1358 struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned int flags) nfs_lookup() argument
1369 nfs_inc_stats(dir, NFSIOS_VFSLOOKUP); nfs_lookup()
1372 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) nfs_lookup()
1379 if (nfs_is_exclusive_create(dir, flags)) { nfs_lookup()
1391 label = nfs4_label_alloc(NFS_SERVER(dir), GFP_NOWAIT); nfs_lookup()
1397 trace_nfs_lookup_enter(dir, dentry, flags); nfs_lookup()
1399 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, label); nfs_lookup()
1412 nfs_advise_use_readdirplus(dir); nfs_lookup()
1421 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_lookup()
1424 trace_nfs_lookup_exit(dir, dentry, flags, error); nfs_lookup()
1485 int nfs_atomic_open(struct inode *dir, struct dentry *dentry, nfs_atomic_open() argument
1500 dir->i_sb->s_id, dir->i_ino, dentry); nfs_atomic_open()
1520 if (dentry->d_name.len > NFS_SERVER(dir)->namelen) nfs_atomic_open()
1537 trace_nfs_atomic_open_enter(dir, ctx, open_flags); nfs_atomic_open()
1539 inode = NFS_PROTO(dir)->open_context(dir, ctx, open_flags, &attr, opened); nfs_atomic_open()
1543 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); nfs_atomic_open()
1549 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_atomic_open()
1566 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); nfs_atomic_open()
1572 res = nfs_lookup(dir, dentry, lookup_flags); nfs_atomic_open()
1600 struct inode *dir; nfs4_lookup_revalidate() local
1604 dir = d_inode_rcu(parent); nfs4_lookup_revalidate()
1605 if (!dir) nfs4_lookup_revalidate()
1609 dir = d_inode(parent); nfs4_lookup_revalidate()
1611 if (!nfs_neg_need_reval(dir, dentry, flags)) nfs4_lookup_revalidate()
1649 struct inode *dir = d_inode(parent); nfs_instantiate() local
1659 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, NULL); nfs_instantiate()
1663 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_instantiate()
1679 nfs_mark_for_revalidate(dir); nfs_instantiate()
1691 int nfs_create(struct inode *dir, struct dentry *dentry, nfs_create() argument
1699 dir->i_sb->s_id, dir->i_ino, dentry); nfs_create()
1704 trace_nfs_create_enter(dir, dentry, open_flags); nfs_create()
1705 error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags); nfs_create()
1706 trace_nfs_create_exit(dir, dentry, open_flags, error); nfs_create()
1720 nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) nfs_mknod() argument
1726 dir->i_sb->s_id, dir->i_ino, dentry); nfs_mknod()
1734 trace_nfs_mknod_enter(dir, dentry); nfs_mknod()
1735 status = NFS_PROTO(dir)->mknod(dir, dentry, &attr, rdev); nfs_mknod()
1736 trace_nfs_mknod_exit(dir, dentry, status); nfs_mknod()
1749 int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) nfs_mkdir() argument
1755 dir->i_sb->s_id, dir->i_ino, dentry); nfs_mkdir()
1760 trace_nfs_mkdir_enter(dir, dentry); nfs_mkdir()
1761 error = NFS_PROTO(dir)->mkdir(dir, dentry, &attr); nfs_mkdir()
1762 trace_nfs_mkdir_exit(dir, dentry, error); nfs_mkdir()
1778 int nfs_rmdir(struct inode *dir, struct dentry *dentry) nfs_rmdir() argument
1783 dir->i_sb->s_id, dir->i_ino, dentry); nfs_rmdir()
1785 trace_nfs_rmdir_enter(dir, dentry); nfs_rmdir()
1788 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); nfs_rmdir()
1798 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); nfs_rmdir()
1799 trace_nfs_rmdir_exit(dir, dentry, error); nfs_rmdir()
1814 struct inode *dir = d_inode(dentry->d_parent); nfs_safe_remove() local
1826 trace_nfs_remove_enter(dir, dentry); nfs_safe_remove()
1829 error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); nfs_safe_remove()
1833 error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); nfs_safe_remove()
1836 trace_nfs_remove_exit(dir, dentry, error); nfs_safe_remove()
1846 int nfs_unlink(struct inode *dir, struct dentry *dentry) nfs_unlink() argument
1851 dfprintk(VFS, "NFS: unlink(%s/%lu, %pd)\n", dir->i_sb->s_id, nfs_unlink()
1852 dir->i_ino, dentry); nfs_unlink()
1854 trace_nfs_unlink_enter(dir, dentry); nfs_unlink()
1860 error = nfs_sillyrename(dir, dentry); nfs_unlink()
1870 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); nfs_unlink()
1874 trace_nfs_unlink_exit(dir, dentry, error); nfs_unlink()
1894 int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) nfs_symlink() argument
1902 dfprintk(VFS, "NFS: symlink(%s/%lu, %pd, %s)\n", dir->i_sb->s_id, nfs_symlink()
1903 dir->i_ino, dentry, symname); nfs_symlink()
1921 trace_nfs_symlink_enter(dir, dentry); nfs_symlink()
1922 error = NFS_PROTO(dir)->symlink(dir, dentry, page, pathlen, &attr); nfs_symlink()
1923 trace_nfs_symlink_exit(dir, dentry, error); nfs_symlink()
1926 dir->i_sb->s_id, dir->i_ino, nfs_symlink()
1954 nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) nfs_link() argument
1962 trace_nfs_link_enter(inode, dir, dentry); nfs_link()
1966 error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name); nfs_link()
1971 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.1.27/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.1.27/arch/arc/include/asm/
H A Ddma-mapping.h63 enum dma_data_direction dir) __inline_dma_cache_sync()
65 switch (dir) { __inline_dma_cache_sync()
76 pr_err("Invalid DMA dir [%d] for OP @ %lx\n", dir, paddr); __inline_dma_cache_sync()
81 enum dma_data_direction dir);
83 #define _dma_cache_sync(addr, sz, dir) \
85 if (__builtin_constant_p(dir)) \
86 __inline_dma_cache_sync(addr, sz, dir); \
88 __arc_dma_cache_sync(addr, sz, dir); \
94 enum dma_data_direction dir) dma_map_single()
96 _dma_cache_sync((unsigned long)cpu_addr, size, dir); dma_map_single()
102 size_t size, enum dma_data_direction dir) dma_unmap_single()
109 enum dma_data_direction dir) dma_map_page()
112 return dma_map_single(dev, (void *)paddr, size, dir); dma_map_page()
117 size_t size, enum dma_data_direction dir) dma_unmap_page()
123 int nents, enum dma_data_direction dir) dma_map_sg()
130 s->length, dir); dma_map_sg()
137 int nents, enum dma_data_direction dir) dma_unmap_sg()
143 dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir); dma_unmap_sg()
148 size_t size, enum dma_data_direction dir) dma_sync_single_for_cpu()
156 size_t size, enum dma_data_direction dir) dma_sync_single_for_device()
182 enum dma_data_direction dir) dma_sync_sg_for_cpu()
187 _dma_cache_sync((unsigned int)sg_virt(sg), sg->length, dir); dma_sync_sg_for_cpu()
192 enum dma_data_direction dir) dma_sync_sg_for_device()
197 _dma_cache_sync((unsigned int)sg_virt(sg), sg->length, dir); dma_sync_sg_for_device()
62 __inline_dma_cache_sync(unsigned long paddr, size_t size, enum dma_data_direction dir) __inline_dma_cache_sync() argument
93 dma_map_single(struct device *dev, void *cpu_addr, size_t size, enum dma_data_direction dir) dma_map_single() argument
101 dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir) dma_unmap_single() argument
107 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
116 dma_unmap_page(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir) dma_unmap_page() argument
122 dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) dma_map_sg() argument
136 dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) dma_unmap_sg() argument
147 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
155 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
181 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, enum dma_data_direction dir) dma_sync_sg_for_cpu() argument
191 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.1.27/fs/ufs/
H A Dnamei.c51 static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) ufs_lookup() argument
59 lock_ufs(dir->i_sb); ufs_lookup()
60 ino = ufs_inode_by_name(dir, &dentry->d_name); ufs_lookup()
62 inode = ufs_iget(dir->i_sb, ino); ufs_lookup()
63 unlock_ufs(dir->i_sb); ufs_lookup()
75 static int ufs_create (struct inode * dir, struct dentry * dentry, umode_t mode, ufs_create() argument
83 inode = ufs_new_inode(dir, mode); ufs_create()
91 lock_ufs(dir->i_sb); ufs_create()
93 unlock_ufs(dir->i_sb); ufs_create()
99 static int ufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) ufs_mknod() argument
107 inode = ufs_new_inode(dir, mode); ufs_mknod()
113 lock_ufs(dir->i_sb); ufs_mknod()
115 unlock_ufs(dir->i_sb); ufs_mknod()
120 static int ufs_symlink (struct inode * dir, struct dentry * dentry, ufs_symlink() argument
123 struct super_block * sb = dir->i_sb; ufs_symlink()
131 lock_ufs(dir->i_sb); ufs_symlink()
132 inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); ufs_symlink()
154 unlock_ufs(dir->i_sb); ufs_symlink()
165 static int ufs_link (struct dentry * old_dentry, struct inode * dir, ufs_link() argument
171 lock_ufs(dir->i_sb); ufs_link()
183 unlock_ufs(dir->i_sb); ufs_link()
187 static int ufs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) ufs_mkdir() argument
192 lock_ufs(dir->i_sb); ufs_mkdir()
193 inode_inc_link_count(dir); ufs_mkdir()
195 inode = ufs_new_inode(dir, S_IFDIR|mode); ufs_mkdir()
206 err = ufs_make_empty(inode, dir); ufs_mkdir()
213 unlock_ufs(dir->i_sb); ufs_mkdir()
226 inode_dec_link_count(dir); ufs_mkdir()
227 unlock_ufs(dir->i_sb); ufs_mkdir()
231 static int ufs_unlink(struct inode *dir, struct dentry *dentry) ufs_unlink() argument
238 de = ufs_find_entry(dir, &dentry->d_name, &page); ufs_unlink()
242 err = ufs_delete_entry(dir, de, page); ufs_unlink()
246 inode->i_ctime = dir->i_ctime; ufs_unlink()
253 static int ufs_rmdir (struct inode * dir, struct dentry *dentry) ufs_rmdir() argument
258 lock_ufs(dir->i_sb); ufs_rmdir()
260 err = ufs_unlink(dir, dentry); ufs_rmdir()
264 inode_dec_link_count(dir); ufs_rmdir()
267 unlock_ufs(dir->i_sb); ufs_rmdir()
H A DMakefile7 ufs-objs := balloc.o cylinder.o dir.o file.o ialloc.o inode.o \
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()
73 ino_t ufs_inode_by_name(struct inode *dir, const struct qstr *qstr) ufs_inode_by_name() argument
79 de = ufs_find_entry(dir, qstr, &page); ufs_inode_by_name()
81 res = fs32_to_cpu(dir->i_sb, de->d_ino); ufs_inode_by_name()
89 void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, ufs_set_link() argument
94 unsigned len = fs16_to_cpu(dir->i_sb, de->d_reclen); ufs_set_link()
101 de->d_ino = cpu_to_fs32(dir->i_sb, inode->i_ino); ufs_set_link()
102 ufs_set_de_type(dir->i_sb, de, inode->i_mode); ufs_set_link()
106 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ufs_set_link()
107 mark_inode_dirty(dir); ufs_set_link()
113 struct inode *dir = page->mapping->host; ufs_check_page() local
114 struct super_block *sb = dir->i_sb; ufs_check_page()
122 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { ufs_check_page()
123 limit = dir->i_size & ~PAGE_CACHE_MASK; ufs_check_page()
156 dir->i_ino ufs_check_page()
176 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, ufs_check_page()
184 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs); ufs_check_page()
190 static struct page *ufs_get_page(struct inode *dir, unsigned long n) ufs_get_page() argument
192 struct address_space *mapping = dir->i_mapping; ufs_get_page()
230 struct ufs_dir_entry *ufs_dotdot(struct inode *dir, struct page **p) ufs_dotdot() argument
232 struct page *page = ufs_get_page(dir, 0); ufs_dotdot()
236 de = ufs_next_entry(dir->i_sb, ufs_dotdot()
251 struct ufs_dir_entry *ufs_find_entry(struct inode *dir, const struct qstr *qstr, ufs_find_entry() argument
254 struct super_block *sb = dir->i_sb; ufs_find_entry()
259 unsigned long npages = ufs_dir_pages(dir); ufs_find_entry()
261 struct ufs_inode_info *ui = UFS_I(dir); ufs_find_entry()
264 UFSD("ENTER, dir_ino %lu, name %s, namlen %u\n", dir->i_ino, name, namelen); ufs_find_entry()
279 page = ufs_get_page(dir, n); ufs_find_entry()
283 kaddr += ufs_last_byte(dir, n) - reclen; ufs_find_entry()
286 ufs_error(dir->i_sb, __func__, ufs_find_entry()
314 struct inode *dir = d_inode(dentry->d_parent); ufs_add_link() local
317 struct super_block *sb = dir->i_sb; ufs_add_link()
323 unsigned long npages = ufs_dir_pages(dir); ufs_add_link()
339 page = ufs_get_page(dir, n); ufs_add_link()
345 dir_end = kaddr + ufs_last_byte(dir, n); ufs_add_link()
358 ufs_error(dir->i_sb, __func__, ufs_add_link()
401 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ufs_add_link()
403 mark_inode_dirty(dir); ufs_add_link()
511 int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, ufs_delete_entry() argument
516 unsigned from = ((char*)dir - kaddr) & ~(UFS_SB(sb)->s_uspi->s_dirblksize - 1); ufs_delete_entry()
517 unsigned to = ((char*)dir - kaddr) + fs16_to_cpu(sb, dir->d_reclen); ufs_delete_entry()
530 while ((char*)de < (char*)dir) { ufs_delete_entry()
549 dir->d_ino = 0; ufs_delete_entry()
559 int ufs_make_empty(struct inode * inode, struct inode *dir) ufs_make_empty() argument
561 struct super_block * sb = dir->i_sb; ufs_make_empty()
591 de->d_ino = cpu_to_fs32(sb, dir->i_ino); ufs_make_empty()
592 ufs_set_de_type(sb, de, dir->i_mode); ufs_make_empty()
/linux-4.1.27/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.1.27/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.1.27/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
44 struct inode *dir = mapping->host; dir_commit_chunk() local
48 if (pos+len > dir->i_size) { dir_commit_chunk()
49 i_size_write(dir, pos+len); dir_commit_chunk()
50 mark_inode_dirty(dir); dir_commit_chunk()
52 if (IS_DIRSYNC(dir)) dir_commit_chunk()
59 static struct page * dir_get_page(struct inode *dir, unsigned long n) dir_get_page() argument
61 struct address_space *mapping = dir->i_mapping; dir_get_page()
135 struct inode * dir = d_inode(dentry->d_parent); sysv_find_entry() local
137 unsigned long npages = dir_pages(dir); sysv_find_entry()
143 start = SYSV_I(dir)->i_dir_start_lookup; sysv_find_entry()
150 page = dir_get_page(dir, n); sysv_find_entry()
172 SYSV_I(dir)->i_dir_start_lookup = n; sysv_find_entry()
179 struct inode *dir = d_inode(dentry->d_parent); sysv_add_link() local
184 unsigned long npages = dir_pages(dir); sysv_add_link()
192 page = dir_get_page(dir, n); sysv_add_link()
223 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; sysv_add_link()
224 mark_inode_dirty(dir); sysv_add_link()
252 int sysv_make_empty(struct inode *inode, struct inode *dir) sysv_make_empty() argument
275 de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), dir->i_ino); sysv_make_empty()
334 struct inode *dir = page->mapping->host; sysv_set_link() local
345 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; sysv_set_link()
346 mark_inode_dirty(dir); sysv_set_link()
349 struct sysv_dir_entry * sysv_dotdot (struct inode *dir, struct page **p) sysv_dotdot() argument
351 struct page *page = dir_get_page(dir, 0); sysv_dotdot()
/linux-4.1.27/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
141 static struct fileIdentDesc *udf_find_entry(struct inode *dir, udf_find_entry() argument
158 struct udf_inode_info *dinfo = UDF_I(dir); udf_find_entry()
161 struct super_block *sb = dir->i_sb; udf_find_entry()
163 size = udf_ext0_offset(dir) + dir->i_size; udf_find_entry()
164 f_pos = udf_ext0_offset(dir); udf_find_entry()
169 if (inode_bmap(dir, f_pos >> sb->s_blocksize_bits, &epos, udf_find_entry()
191 fi = udf_fileident_read(dir, &f_pos, fibh, cfi, &epos, &eloc, udf_find_entry()
253 static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry, udf_lookup() argument
272 inode = udf_iget(dir->i_sb, lb); udf_lookup()
278 if (udf_find_entry(dir, &dentry->d_name, &fibh, &cfi)) { udf_lookup()
286 inode = udf_iget(dir->i_sb, &loc); udf_lookup()
294 static struct fileIdentDesc *udf_add_entry(struct inode *dir, udf_add_entry() argument
299 struct super_block *sb = dir->i_sb; udf_add_entry()
304 loff_t size = udf_ext0_offset(dir) + dir->i_size; udf_add_entry()
339 f_pos = udf_ext0_offset(dir); udf_add_entry()
341 fibh->soffset = fibh->eoffset = f_pos & (dir->i_sb->s_blocksize - 1); udf_add_entry()
342 dinfo = UDF_I(dir); udf_add_entry()
344 if (inode_bmap(dir, f_pos >> dir->i_sb->s_blocksize_bits, &epos, udf_add_entry()
346 block = udf_get_lb_pblock(dir->i_sb, udf_add_entry()
351 block = udf_get_lb_pblock(dir->i_sb, &eloc, offset); udf_add_entry()
352 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { udf_add_entry()
360 fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block); udf_add_entry()
370 fi = udf_fileident_read(dir, &f_pos, fibh, cfi, &epos, &eloc, udf_add_entry()
389 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, udf_add_entry()
407 fibh->soffset -= udf_ext0_offset(dir); udf_add_entry()
408 fibh->eoffset -= udf_ext0_offset(dir); udf_add_entry()
409 f_pos -= udf_ext0_offset(dir); udf_add_entry()
414 udf_expand_dir_adinicb(dir, &block, err); udf_add_entry()
418 epos.offset = udf_file_entry_alloc_offset(dir); udf_add_entry()
420 udf_current_aext(dir, &epos, &eloc, &elen, 1); udf_add_entry()
437 udf_ext0_offset(dir) + udf_add_entry()
442 dir->i_sb->s_blocksize_bits); udf_add_entry()
453 udf_write_aext(dir, &epos, &eloc, elen, 1); udf_add_entry()
465 dir->i_sb->s_blocksize_bits); udf_add_entry()
466 fibh->ebh = udf_bread(dir, udf_add_entry()
467 f_pos >> dir->i_sb->s_blocksize_bits, 1, err); udf_add_entry()
474 epos.offset = udf_file_entry_alloc_offset(dir); udf_add_entry()
478 while (udf_next_aext(dir, &epos, &eloc, &elen, 1) == udf_add_entry()
482 dir->i_sb->s_blocksize_bits); udf_add_entry()
503 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, name)) { udf_add_entry()
504 dir->i_size += nfidlen; udf_add_entry()
509 while (udf_next_aext(dir, &epos, &eloc, &elen, 1) == udf_add_entry()
512 elen -= dinfo->i_lenExtents - dir->i_size; udf_add_entry()
517 udf_write_aext(dir, &epos, &eloc, elen, 1); udf_add_entry()
518 dinfo->i_lenExtents = dir->i_size; udf_add_entry()
521 mark_inode_dirty(dir); udf_add_entry()
554 struct inode *dir = d_inode(dentry->d_parent); udf_add_nondir() local
559 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); udf_add_nondir()
570 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_add_nondir()
571 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_add_nondir()
572 mark_inode_dirty(dir); udf_add_nondir()
582 static int udf_create(struct inode *dir, struct dentry *dentry, umode_t mode, udf_create() argument
585 struct inode *inode = udf_new_inode(dir, mode); udf_create()
601 static int udf_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) udf_tmpfile() argument
603 struct inode *inode = udf_new_inode(dir, mode); udf_tmpfile()
620 static int udf_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, udf_mknod() argument
628 inode = udf_new_inode(dir, mode); udf_mknod()
636 static int udf_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) udf_mkdir() argument
642 struct udf_inode_info *dinfo = UDF_I(dir); udf_mkdir()
645 inode = udf_new_inode(dir, S_IFDIR | mode); udf_mkdir()
670 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); udf_mkdir()
683 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_mkdir()
684 inc_nlink(dir); udf_mkdir()
685 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_mkdir()
686 mark_inode_dirty(dir); udf_mkdir()
698 static int empty_dir(struct inode *dir) empty_dir() argument
703 loff_t size = udf_ext0_offset(dir) + dir->i_size; empty_dir()
709 struct udf_inode_info *dinfo = UDF_I(dir); empty_dir()
711 f_pos = udf_ext0_offset(dir); empty_dir()
712 fibh.soffset = fibh.eoffset = f_pos & (dir->i_sb->s_blocksize - 1); empty_dir()
716 else if (inode_bmap(dir, f_pos >> dir->i_sb->s_blocksize_bits, empty_dir()
719 block = udf_get_lb_pblock(dir->i_sb, &eloc, offset); empty_dir()
720 if ((++offset << dir->i_sb->s_blocksize_bits) < elen) { empty_dir()
728 fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block); empty_dir()
739 fi = udf_fileident_read(dir, &f_pos, &fibh, &cfi, &epos, &eloc, empty_dir()
767 static int udf_rmdir(struct inode *dir, struct dentry *dentry) udf_rmdir() argument
776 fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); udf_rmdir()
782 if (udf_get_lb_pblock(dir->i_sb, &tloc, 0) != inode->i_ino) udf_rmdir()
787 retval = udf_delete_entry(dir, fi, &fibh, &cfi); udf_rmdir()
795 inode_dec_link_count(dir); udf_rmdir()
796 inode->i_ctime = dir->i_ctime = dir->i_mtime = udf_rmdir()
797 current_fs_time(dir->i_sb); udf_rmdir()
798 mark_inode_dirty(dir); udf_rmdir()
809 static int udf_unlink(struct inode *dir, struct dentry *dentry) udf_unlink() argument
819 fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); udf_unlink()
825 if (udf_get_lb_pblock(dir->i_sb, &tloc, 0) != inode->i_ino) udf_unlink()
833 retval = udf_delete_entry(dir, fi, &fibh, &cfi); udf_unlink()
836 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_unlink()
837 mark_inode_dirty(dir); udf_unlink()
839 inode->i_ctime = dir->i_ctime; udf_unlink()
851 static int udf_symlink(struct inode *dir, struct dentry *dentry, udf_symlink() argument
854 struct inode *inode = udf_new_inode(dir, S_IFLNK | S_IRWXUGO); udf_symlink()
865 struct super_block *sb = dir->i_sb; udf_symlink()
999 static int udf_link(struct dentry *old_dentry, struct inode *dir, udf_link() argument
1007 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); udf_link()
1017 udf_write_fi(dir, &cfi, fi, &fibh, NULL, NULL); udf_link()
1018 if (UDF_I(dir)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) udf_link()
1019 mark_inode_dirty(dir); udf_link()
1027 dir->i_ctime = dir->i_mtime = current_fs_time(dir->i_sb); udf_link()
1028 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.1.27/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
126 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_mknod()
129 inode = nilfs_new_inode(dir, mode); nilfs_mknod()
137 err = nilfs_transaction_commit(dir->i_sb); nilfs_mknod()
139 nilfs_transaction_abort(dir->i_sb); nilfs_mknod()
144 static int nilfs_symlink(struct inode *dir, struct dentry *dentry, nilfs_symlink() argument
148 struct super_block *sb = dir->i_sb; nilfs_symlink()
156 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_symlink()
160 inode = nilfs_new_inode(dir, S_IFLNK | S_IRWXUGO); nilfs_symlink()
178 err = nilfs_transaction_commit(dir->i_sb); nilfs_symlink()
180 nilfs_transaction_abort(dir->i_sb); nilfs_symlink()
192 static int nilfs_link(struct dentry *old_dentry, struct inode *dir, nilfs_link() argument
199 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_link()
210 err = nilfs_transaction_commit(dir->i_sb); nilfs_link()
214 nilfs_transaction_abort(dir->i_sb); nilfs_link()
220 static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) nilfs_mkdir() argument
226 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); nilfs_mkdir()
230 inc_nlink(dir); nilfs_mkdir()
232 inode = nilfs_new_inode(dir, S_IFDIR | mode); nilfs_mkdir()
243 err = nilfs_make_empty(inode, dir); nilfs_mkdir()
256 err = nilfs_transaction_commit(dir->i_sb); nilfs_mkdir()
258 nilfs_transaction_abort(dir->i_sb); nilfs_mkdir()
269 drop_nlink(dir); nilfs_mkdir()
270 nilfs_mark_inode_dirty(dir); nilfs_mkdir()
274 static int nilfs_do_unlink(struct inode *dir, struct dentry *dentry) nilfs_do_unlink() argument
282 de = nilfs_find_entry(dir, &dentry->d_name, &page); nilfs_do_unlink()
301 inode->i_ctime = dir->i_ctime; nilfs_do_unlink()
308 static int nilfs_unlink(struct inode *dir, struct dentry *dentry) nilfs_unlink() argument
313 err = nilfs_transaction_begin(dir->i_sb, &ti, 0); nilfs_unlink()
317 err = nilfs_do_unlink(dir, dentry); nilfs_unlink()
320 nilfs_mark_inode_dirty(dir); nilfs_unlink()
322 err = nilfs_transaction_commit(dir->i_sb); nilfs_unlink()
324 nilfs_transaction_abort(dir->i_sb); nilfs_unlink()
329 static int nilfs_rmdir(struct inode *dir, struct dentry *dentry) nilfs_rmdir() argument
335 err = nilfs_transaction_begin(dir->i_sb, &ti, 0); nilfs_rmdir()
341 err = nilfs_do_unlink(dir, dentry); nilfs_rmdir()
346 drop_nlink(dir); nilfs_rmdir()
347 nilfs_mark_inode_dirty(dir); nilfs_rmdir()
351 err = nilfs_transaction_commit(dir->i_sb); nilfs_rmdir()
353 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
93 struct inode *dir = mapping->host; nilfs_commit_chunk() local
101 if (pos + copied > dir->i_size) nilfs_commit_chunk()
102 i_size_write(dir, pos + copied); nilfs_commit_chunk()
103 if (IS_DIRSYNC(dir)) nilfs_commit_chunk()
105 err = nilfs_set_file_dirty(dir, nr_dirty); nilfs_commit_chunk()
112 struct inode *dir = page->mapping->host; nilfs_check_page() local
113 struct super_block *sb = dir->i_sb; nilfs_check_page()
114 unsigned chunk_size = nilfs_chunk_size(dir); nilfs_check_page()
121 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { nilfs_check_page()
122 limit = dir->i_size & ~PAGE_CACHE_MASK; nilfs_check_page()
152 dir->i_ino nilfs_check_page()
169 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, nilfs_check_page()
178 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, nilfs_check_page()
185 static struct page *nilfs_get_page(struct inode *dir, unsigned long n) nilfs_get_page() argument
187 struct address_space *mapping = dir->i_mapping; nilfs_get_page()
324 nilfs_find_entry(struct inode *dir, const struct qstr *qstr, nilfs_find_entry() argument
331 unsigned long npages = dir_pages(dir); nilfs_find_entry()
333 struct nilfs_inode_info *ei = NILFS_I(dir); nilfs_find_entry()
348 page = nilfs_get_page(dir, n); nilfs_find_entry()
352 kaddr += nilfs_last_byte(dir, n) - reclen; nilfs_find_entry()
355 nilfs_error(dir->i_sb, __func__, nilfs_find_entry()
369 if (unlikely(n > (dir->i_blocks >> (PAGE_CACHE_SHIFT - 9)))) { nilfs_find_entry()
370 nilfs_error(dir->i_sb, __func__, nilfs_find_entry()
371 "dir %lu size %lld exceeds block count %llu", nilfs_find_entry()
372 dir->i_ino, dir->i_size, nilfs_find_entry()
373 (unsigned long long)dir->i_blocks); nilfs_find_entry()
386 struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct page **p) nilfs_dotdot() argument
388 struct page *page = nilfs_get_page(dir, 0); nilfs_dotdot()
399 ino_t nilfs_inode_by_name(struct inode *dir, const struct qstr *qstr) nilfs_inode_by_name() argument
405 de = nilfs_find_entry(dir, qstr, &page); nilfs_inode_by_name()
415 void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de, nilfs_set_link() argument
430 dir->i_mtime = dir->i_ctime = CURRENT_TIME; nilfs_set_link()
438 struct inode *dir = d_inode(dentry->d_parent); nilfs_add_link() local
441 unsigned chunk_size = nilfs_chunk_size(dir); nilfs_add_link()
446 unsigned long npages = dir_pages(dir); nilfs_add_link()
460 page = nilfs_get_page(dir, n); nilfs_add_link()
466 dir_end = kaddr + nilfs_last_byte(dir, n); nilfs_add_link()
479 nilfs_error(dir->i_sb, __func__, nilfs_add_link()
520 dir->i_mtime = dir->i_ctime = CURRENT_TIME; nilfs_add_link()
521 nilfs_mark_inode_dirty(dir); nilfs_add_link()
536 int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) nilfs_delete_entry() argument
541 unsigned from = ((char *)dir - kaddr) & ~(nilfs_chunk_size(inode) - 1); nilfs_delete_entry()
542 unsigned to = ((char *)dir - kaddr) + nilfs_delete_entry()
543 nilfs_rec_len_from_disk(dir->rec_len); nilfs_delete_entry()
548 while ((char *)de < (char *)dir) { nilfs_delete_entry()
565 dir->inode = 0; nilfs_delete_entry()
/linux-4.1.27/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()
44 __generic_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs); xen_dma_map_page()
46 __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs); xen_dma_map_page()
50 size_t size, enum dma_data_direction dir, xen_dma_unmap_page()
60 __generic_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs); xen_dma_unmap_page()
62 __xen_dma_unmap_page(hwdev, handle, size, dir, attrs); xen_dma_unmap_page()
66 dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_cpu()
71 __generic_dma_ops(hwdev)->sync_single_for_cpu(hwdev, handle, size, dir); xen_dma_sync_single_for_cpu()
73 __xen_dma_sync_single_for_cpu(hwdev, handle, size, dir); xen_dma_sync_single_for_cpu()
77 dma_addr_t handle, size_t size, enum dma_data_direction dir) xen_dma_sync_single_for_device()
82 __generic_dma_ops(hwdev)->sync_single_for_device(hwdev, handle, size, dir); xen_dma_sync_single_for_device()
84 __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
49 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
65 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
76 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.1.27/fs/dlm/
H A DMakefile4 dir.o \
/linux-4.1.27/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 */
866 static int fat_get_short_entry(struct inode *dir, loff_t *pos, fat_get_short_entry() argument
870 while (fat_get_entry(dir, pos, bh, de) >= 0) { fat_get_short_entry()
887 int fat_get_dotdot_entry(struct inode *dir, struct buffer_head **bh, fat_get_dotdot_entry() argument
893 while (fat_get_short_entry(dir, &offset, bh, de) >= 0) { fat_get_dotdot_entry()
902 int fat_dir_empty(struct inode *dir) fat_dir_empty() argument
911 while (fat_get_short_entry(dir, &cpos, &bh, &de) >= 0) { fat_dir_empty()
924 * fat_subdirs counts the number of sub-directories of dir. It can be run
927 int fat_subdirs(struct inode *dir) fat_subdirs() argument
936 while (fat_get_short_entry(dir, &cpos, &bh, &de) >= 0) { fat_subdirs()
948 int fat_scan(struct inode *dir, const unsigned char *name, fat_scan() argument
951 struct super_block *sb = dir->i_sb; fat_scan()
955 while (fat_get_short_entry(dir, &sinfo->slot_off, &sinfo->bh, fat_scan()
972 int fat_scan_logstart(struct inode *dir, int i_logstart, fat_scan_logstart() argument
975 struct super_block *sb = dir->i_sb; fat_scan_logstart()
979 while (fat_get_short_entry(dir, &sinfo->slot_off, &sinfo->bh, fat_scan_logstart()
991 static int __fat_remove_entries(struct inode *dir, loff_t pos, int nr_slots) __fat_remove_entries() argument
993 struct super_block *sb = dir->i_sb; __fat_remove_entries()
1000 if (fat_get_entry(dir, &pos, &bh, &de) < 0) { __fat_remove_entries()
1012 mark_buffer_dirty_inode(bh, dir); __fat_remove_entries()
1013 if (IS_DIRSYNC(dir)) __fat_remove_entries()
1026 int fat_remove_entries(struct inode *dir, struct fat_slot_info *sinfo) fat_remove_entries() argument
1028 struct super_block *sb = dir->i_sb; fat_remove_entries()
1047 mark_buffer_dirty_inode(bh, dir); fat_remove_entries()
1048 if (IS_DIRSYNC(dir)) fat_remove_entries()
1053 dir->i_version++; fat_remove_entries()
1061 err = __fat_remove_entries(dir, sinfo->slot_off, nr_slots); fat_remove_entries()
1068 dir->i_mtime = dir->i_atime = CURRENT_TIME_SEC; fat_remove_entries()
1069 if (IS_DIRSYNC(dir)) fat_remove_entries()
1070 (void)fat_sync_inode(dir); fat_remove_entries()
1072 mark_inode_dirty(dir); fat_remove_entries()
1078 static int fat_zeroed_cluster(struct inode *dir, sector_t blknr, int nr_used, fat_zeroed_cluster() argument
1081 struct super_block *sb = dir->i_sb; fat_zeroed_cluster()
1096 mark_buffer_dirty_inode(bhs[n], dir); fat_zeroed_cluster()
1101 if (IS_DIRSYNC(dir)) { fat_zeroed_cluster()
1111 if (IS_DIRSYNC(dir)) { fat_zeroed_cluster()
1127 int fat_alloc_new_dir(struct inode *dir, struct timespec *ts) fat_alloc_new_dir() argument
1129 struct super_block *sb = dir->i_sb; fat_alloc_new_dir()
1138 err = fat_alloc_clusters(dir, &cluster, 1); fat_alloc_new_dir()
1170 fat_set_start(&de[1], MSDOS_I(dir)->i_logstart); fat_alloc_new_dir()
1174 mark_buffer_dirty_inode(bhs[0], dir); fat_alloc_new_dir()
1176 err = fat_zeroed_cluster(dir, blknr, 1, bhs, MAX_BUF_PER_PAGE); fat_alloc_new_dir()
1183 fat_free_clusters(dir, cluster); fat_alloc_new_dir()
1189 static int fat_add_new_entries(struct inode *dir, void *slots, int nr_slots, fat_add_new_entries() argument
1193 struct super_block *sb = dir->i_sb; fat_add_new_entries()
1209 err = fat_alloc_clusters(dir, cluster, *nr_cluster); fat_add_new_entries()
1235 mark_buffer_dirty_inode(bhs[n], dir); fat_add_new_entries()
1251 err = fat_zeroed_cluster(dir, start_blknr, ++n, bhs, MAX_BUF_PER_PAGE); fat_add_new_entries()
1264 fat_free_clusters(dir, cluster[0]); fat_add_new_entries()
1269 int fat_add_entries(struct inode *dir, void *slots, int nr_slots, fat_add_entries() argument
1272 struct super_block *sb = dir->i_sb; fat_add_entries()
1286 while (fat_get_entry(dir, &pos, &bh, &de) > -1) { fat_add_entries()
1307 if (dir->i_ino == MSDOS_ROOT_INO) { fat_add_entries()
1310 } else if (MSDOS_I(dir)->i_start == 0) { fat_add_entries()
1312 MSDOS_I(dir)->i_pos); fat_add_entries()
1335 mark_buffer_dirty_inode(bhs[i], dir); fat_add_entries()
1340 if (long_bhs && IS_DIRSYNC(dir)) fat_add_entries()
1346 mark_buffer_dirty_inode(bhs[i], dir); fat_add_entries()
1347 if (IS_DIRSYNC(dir)) fat_add_entries()
1362 * add the cluster to dir. fat_add_entries()
1364 cluster = fat_add_new_entries(dir, slots, nr_slots, &nr_cluster, fat_add_entries()
1370 err = fat_chain_add(dir, cluster, nr_cluster); fat_add_entries()
1372 fat_free_clusters(dir, cluster); fat_add_entries()
1375 if (dir->i_size & (sbi->cluster_size - 1)) { fat_add_entries()
1377 dir->i_size = (dir->i_size + sbi->cluster_size - 1) fat_add_entries()
1380 dir->i_size += nr_cluster << sbi->cluster_bits; fat_add_entries()
1381 MSDOS_I(dir)->mmu_private += nr_cluster << sbi->cluster_bits; fat_add_entries()
1399 __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.1.27/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.1.27/tools/lib/api/
H A DMakefile5 srctree := $(patsubst %/,%,$(dir $(shell pwd)))
6 srctree := $(patsubst %/,%,$(dir $(srctree)))
7 srctree := $(patsubst %/,%,$(dir $(srctree)))
24 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
/linux-4.1.27/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.1.27/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()
465 static int ubifs_dir_release(struct inode *dir, struct file *file) ubifs_dir_release() argument
498 static int ubifs_link(struct dentry *old_dentry, struct inode *dir, ubifs_link() argument
501 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_link()
504 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_link()
514 dbg_gen("dent '%pd' to ino %lu (nlink %d) in dir ino %lu", ubifs_link()
516 inode->i_nlink, dir->i_ino); ubifs_link()
517 ubifs_assert(mutex_is_locked(&dir->i_mutex)); ubifs_link()
528 lock_2_inodes(dir, inode); ubifs_link()
532 dir->i_size += sz_change; ubifs_link()
533 dir_ui->ui_size = dir->i_size; ubifs_link()
534 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_link()
535 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_link()
538 unlock_2_inodes(dir, inode); ubifs_link()
545 dir->i_size -= sz_change; ubifs_link()
546 dir_ui->ui_size = dir->i_size; ubifs_link()
548 unlock_2_inodes(dir, inode); ubifs_link()
554 static int ubifs_unlink(struct inode *dir, struct dentry *dentry) ubifs_unlink() argument
556 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_unlink()
558 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_unlink()
571 dbg_gen("dent '%pd' from ino %lu (nlink %d) in dir ino %lu", ubifs_unlink()
573 inode->i_nlink, dir->i_ino); ubifs_unlink()
574 ubifs_assert(mutex_is_locked(&dir->i_mutex)); ubifs_unlink()
587 lock_2_inodes(dir, inode); ubifs_unlink()
588 inode->i_ctime = ubifs_current_time(dir); ubifs_unlink()
590 dir->i_size -= sz_change; ubifs_unlink()
591 dir_ui->ui_size = dir->i_size; ubifs_unlink()
592 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_unlink()
593 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 1, 0); ubifs_unlink()
596 unlock_2_inodes(dir, inode); ubifs_unlink()
608 dir->i_size += sz_change; ubifs_unlink()
609 dir_ui->ui_size = dir->i_size; ubifs_unlink()
611 unlock_2_inodes(dir, inode); ubifs_unlink()
620 * @dir: VFS inode object of the directory to check
622 * This function checks if directory @dir is empty. Returns zero if the
626 static int check_dir_empty(struct ubifs_info *c, struct inode *dir) check_dir_empty() argument
633 lowest_dent_key(c, &key, dir->i_ino); check_dir_empty()
646 static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) ubifs_rmdir() argument
648 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_rmdir()
652 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_rmdir()
661 dbg_gen("directory '%pd', ino %lu in dir ino %lu", dentry, ubifs_rmdir()
662 inode->i_ino, dir->i_ino); ubifs_rmdir()
663 ubifs_assert(mutex_is_locked(&dir->i_mutex)); ubifs_rmdir()
676 lock_2_inodes(dir, inode); ubifs_rmdir()
677 inode->i_ctime = ubifs_current_time(dir); ubifs_rmdir()
679 drop_nlink(dir); ubifs_rmdir()
680 dir->i_size -= sz_change; ubifs_rmdir()
681 dir_ui->ui_size = dir->i_size; ubifs_rmdir()
682 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_rmdir()
683 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 1, 0); ubifs_rmdir()
686 unlock_2_inodes(dir, inode); ubifs_rmdir()
698 dir->i_size += sz_change; ubifs_rmdir()
699 dir_ui->ui_size = dir->i_size; ubifs_rmdir()
700 inc_nlink(dir); ubifs_rmdir()
702 unlock_2_inodes(dir, inode); ubifs_rmdir()
708 static int ubifs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ubifs_mkdir() argument
711 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_mkdir()
712 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_mkdir()
721 dbg_gen("dent '%pd', mode %#hx in dir ino %lu", ubifs_mkdir()
722 dentry, mode, dir->i_ino); ubifs_mkdir()
728 inode = ubifs_new_inode(c, dir, S_IFDIR | mode); ubifs_mkdir()
734 err = ubifs_init_security(dir, inode, &dentry->d_name); ubifs_mkdir()
741 inc_nlink(dir); ubifs_mkdir()
742 dir->i_size += sz_change; ubifs_mkdir()
743 dir_ui->ui_size = dir->i_size; ubifs_mkdir()
744 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_mkdir()
745 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_mkdir()
757 dir->i_size -= sz_change; ubifs_mkdir()
758 dir_ui->ui_size = dir->i_size; ubifs_mkdir()
759 drop_nlink(dir); ubifs_mkdir()
769 static int ubifs_mknod(struct inode *dir, struct dentry *dentry, ubifs_mknod() argument
774 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_mknod()
775 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_mknod()
788 dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino); ubifs_mknod()
806 inode = ubifs_new_inode(c, dir, mode); ubifs_mknod()
819 err = ubifs_init_security(dir, inode, &dentry->d_name); ubifs_mknod()
824 dir->i_size += sz_change; ubifs_mknod()
825 dir_ui->ui_size = dir->i_size; ubifs_mknod()
826 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_mknod()
827 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_mknod()
838 dir->i_size -= sz_change; ubifs_mknod()
839 dir_ui->ui_size = dir->i_size; ubifs_mknod()
849 static int ubifs_symlink(struct inode *dir, struct dentry *dentry, ubifs_symlink() argument
854 struct ubifs_inode *dir_ui = ubifs_inode(dir); ubifs_symlink()
855 struct ubifs_info *c = dir->i_sb->s_fs_info; ubifs_symlink()
867 dbg_gen("dent '%pd', target '%s' in dir ino %lu", dentry, ubifs_symlink()
868 symname, dir->i_ino); ubifs_symlink()
877 inode = ubifs_new_inode(c, dir, S_IFLNK | S_IRWXUGO); ubifs_symlink()
900 err = ubifs_init_security(dir, inode, &dentry->d_name); ubifs_symlink()
905 dir->i_size += sz_change; ubifs_symlink()
906 dir_ui->ui_size = dir->i_size; ubifs_symlink()
907 dir->i_mtime = dir->i_ctime = inode->i_ctime; ubifs_symlink()
908 err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 0, 0); ubifs_symlink()
919 dir->i_size -= sz_change; ubifs_symlink()
920 dir_ui->ui_size = dir->i_size; ubifs_symlink()
997 dbg_gen("dent '%pd' ino %lu in dir ino %lu to dent '%pd' in dir ino %lu", ubifs_rename()
/linux-4.1.27/fs/f2fs/
H A Ddir.c2 * fs/f2fs/dir.c
157 static struct f2fs_dir_entry *find_in_level(struct inode *dir, find_in_level() argument
169 f2fs_bug_on(F2FS_I_SB(dir), level > MAX_DIR_HASH_DEPTH); find_in_level()
171 nbucket = dir_buckets(level, F2FS_I(dir)->i_dir_level); find_in_level()
174 bidx = dir_block_index(level, F2FS_I(dir)->i_dir_level, find_in_level()
180 dentry_page = find_data_page(dir, bidx, true); find_in_level()
195 if (!de && room && F2FS_I(dir)->chash != namehash) { find_in_level()
196 F2FS_I(dir)->chash = namehash; find_in_level()
197 F2FS_I(dir)->clevel = level; find_in_level()
209 struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir, f2fs_find_entry() argument
212 unsigned long npages = dir_blocks(dir); f2fs_find_entry()
220 if (f2fs_has_inline_dentry(dir)) f2fs_find_entry()
221 return find_in_inline_dir(dir, child, res_page); f2fs_find_entry()
227 max_depth = F2FS_I(dir)->i_current_depth; f2fs_find_entry()
230 de = find_in_level(dir, level, child, name_hash, res_page); f2fs_find_entry()
234 if (!de && F2FS_I(dir)->chash != name_hash) { f2fs_find_entry()
235 F2FS_I(dir)->chash = name_hash; f2fs_find_entry()
236 F2FS_I(dir)->clevel = level - 1; f2fs_find_entry()
241 struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p) f2fs_parent_dir() argument
247 if (f2fs_has_inline_dentry(dir)) f2fs_parent_dir()
248 return f2fs_parent_inline_dir(dir, p); f2fs_parent_dir()
250 page = get_lock_data_page(dir, 0); f2fs_parent_dir()
261 ino_t f2fs_inode_by_name(struct inode *dir, struct qstr *qstr) f2fs_inode_by_name() argument
267 de = f2fs_find_entry(dir, qstr, &page); f2fs_inode_by_name()
270 f2fs_dentry_kunmap(dir, page); f2fs_inode_by_name()
277 void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de, f2fs_set_link() argument
280 enum page_type type = f2fs_has_inline_dentry(dir) ? NODE : DATA; f2fs_set_link()
285 f2fs_dentry_kunmap(dir, page); f2fs_set_link()
287 dir->i_mtime = dir->i_ctime = CURRENT_TIME; f2fs_set_link()
288 mark_inode_dirty(dir); f2fs_set_link()
369 struct page *init_inode_metadata(struct inode *inode, struct inode *dir, init_inode_metadata() argument
381 err = make_empty_dir(inode, dir, page); init_inode_metadata()
386 err = f2fs_init_acl(inode, dir, page, dpage); init_inode_metadata()
390 err = f2fs_init_security(inode, dir, name, page); init_inode_metadata()
394 page = get_node_page(F2FS_I_SB(dir), inode->i_ino); init_inode_metadata()
415 remove_orphan_inode(F2FS_I_SB(dir), inode->i_ino); init_inode_metadata()
431 void update_parent_metadata(struct inode *dir, struct inode *inode, update_parent_metadata() argument
436 inc_nlink(dir); update_parent_metadata()
437 set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); update_parent_metadata()
441 dir->i_mtime = dir->i_ctime = CURRENT_TIME; update_parent_metadata()
442 mark_inode_dirty(dir); update_parent_metadata()
444 if (F2FS_I(dir)->i_current_depth != current_depth) { update_parent_metadata()
445 F2FS_I(dir)->i_current_depth = current_depth; update_parent_metadata()
446 set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); update_parent_metadata()
495 int __f2fs_add_link(struct inode *dir, const struct qstr *name, __f2fs_add_link() argument
512 if (f2fs_has_inline_dentry(dir)) { __f2fs_add_link()
513 err = f2fs_add_inline_entry(dir, name, inode, ino, mode); __f2fs_add_link()
522 current_depth = F2FS_I(dir)->i_current_depth; __f2fs_add_link()
523 if (F2FS_I(dir)->chash == dentry_hash) { __f2fs_add_link()
524 level = F2FS_I(dir)->clevel; __f2fs_add_link()
525 F2FS_I(dir)->chash = 0; __f2fs_add_link()
536 nbucket = dir_buckets(level, F2FS_I(dir)->i_dir_level); __f2fs_add_link()
539 bidx = dir_block_index(level, F2FS_I(dir)->i_dir_level, __f2fs_add_link()
543 dentry_page = get_new_data_page(dir, NULL, block, true); __f2fs_add_link()
565 page = init_inode_metadata(inode, dir, name, NULL); __f2fs_add_link()
579 F2FS_I(inode)->i_pino = dir->i_ino; __f2fs_add_link()
584 update_parent_metadata(dir, inode, current_depth); __f2fs_add_link()
589 if (is_inode_flag_set(F2FS_I(dir), FI_UPDATE_DIR)) { __f2fs_add_link()
590 update_inode_page(dir); __f2fs_add_link()
591 clear_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); __f2fs_add_link()
598 int f2fs_do_tmpfile(struct inode *inode, struct inode *dir) f2fs_do_tmpfile() argument
604 page = init_inode_metadata(inode, dir, NULL, NULL); f2fs_do_tmpfile()
619 void f2fs_drop_nlink(struct inode *dir, struct inode *inode, struct page *page) f2fs_drop_nlink() argument
621 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_drop_nlink()
626 drop_nlink(dir); f2fs_drop_nlink()
628 update_inode(dir, page); f2fs_drop_nlink()
630 update_inode_page(dir); f2fs_drop_nlink()
653 struct inode *dir, struct inode *inode) f2fs_delete_entry()
660 if (f2fs_has_inline_dentry(dir)) f2fs_delete_entry()
661 return f2fs_delete_inline_entry(dentry, page, dir, inode); f2fs_delete_entry()
678 dir->i_ctime = dir->i_mtime = CURRENT_TIME; f2fs_delete_entry()
681 f2fs_drop_nlink(dir, inode, NULL); f2fs_delete_entry()
684 truncate_hole(dir, page->index, page->index + 1); f2fs_delete_entry()
688 inode_dec_dirty_pages(dir); f2fs_delete_entry()
693 bool f2fs_empty_dir(struct inode *dir) f2fs_empty_dir() argument
699 unsigned long nblock = dir_blocks(dir); f2fs_empty_dir()
701 if (f2fs_has_inline_dentry(dir)) f2fs_empty_dir()
702 return f2fs_empty_inline_dir(dir); f2fs_empty_dir()
705 dentry_page = get_lock_data_page(dir, bidx); f2fs_empty_dir()
774 /* readahead for multi pages of dir */ f2fs_readdir()
652 f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, struct inode *dir, struct inode *inode) f2fs_delete_entry() argument
H A DMakefile3 f2fs-y := dir.o file.o inode.o namei.o hash.o super.o inline.o
H A Dinline.c269 struct f2fs_dir_entry *find_in_inline_dir(struct inode *dir, find_in_inline_dir() argument
272 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); find_in_inline_dir()
278 ipage = get_node_page(sbi, dir->i_ino); find_in_inline_dir()
301 struct f2fs_dir_entry *f2fs_parent_inline_dir(struct inode *dir, f2fs_parent_inline_dir() argument
304 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_parent_inline_dir()
309 ipage = get_node_page(sbi, dir->i_ino); f2fs_parent_inline_dir()
341 static int f2fs_convert_inline_dir(struct inode *dir, struct page *ipage, f2fs_convert_inline_dir() argument
349 page = grab_cache_page(dir->i_mapping, 0); f2fs_convert_inline_dir()
353 set_new_dnode(&dn, dir, ipage, NULL, 0); f2fs_convert_inline_dir()
375 /* clear inline dir and flag after data writeback */ f2fs_convert_inline_dir()
378 stat_dec_inline_dir(dir); f2fs_convert_inline_dir()
379 clear_inode_flag(F2FS_I(dir), FI_INLINE_DENTRY); f2fs_convert_inline_dir()
381 if (i_size_read(dir) < PAGE_CACHE_SIZE) { f2fs_convert_inline_dir()
382 i_size_write(dir, PAGE_CACHE_SIZE); f2fs_convert_inline_dir()
383 set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); f2fs_convert_inline_dir()
392 int f2fs_add_inline_entry(struct inode *dir, const struct qstr *name, f2fs_add_inline_entry() argument
395 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_add_inline_entry()
406 ipage = get_node_page(sbi, dir->i_ino); f2fs_add_inline_entry()
414 err = f2fs_convert_inline_dir(dir, ipage, dentry_blk); f2fs_add_inline_entry()
422 page = init_inode_metadata(inode, dir, name, ipage); f2fs_add_inline_entry()
439 F2FS_I(inode)->i_pino = dir->i_ino; f2fs_add_inline_entry()
444 update_parent_metadata(dir, inode, 0); f2fs_add_inline_entry()
449 if (is_inode_flag_set(F2FS_I(dir), FI_UPDATE_DIR)) { f2fs_add_inline_entry()
450 update_inode(dir, ipage); f2fs_add_inline_entry()
451 clear_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); f2fs_add_inline_entry()
459 struct inode *dir, struct inode *inode) f2fs_delete_inline_entry()
477 dir->i_ctime = dir->i_mtime = CURRENT_TIME; f2fs_delete_inline_entry()
480 f2fs_drop_nlink(dir, inode, page); f2fs_delete_inline_entry()
485 bool f2fs_empty_inline_dir(struct inode *dir) f2fs_empty_inline_dir() argument
487 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_empty_inline_dir()
492 ipage = get_node_page(sbi, dir->i_ino); f2fs_empty_inline_dir()
458 f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page, struct inode *dir, struct inode *inode) f2fs_delete_inline_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()
109 static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode, f2fs_create() argument
112 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_create()
119 inode = f2fs_new_inode(dir, mode); f2fs_create()
143 if (IS_DIRSYNC(dir)) f2fs_create()
151 static int f2fs_link(struct dentry *old_dentry, struct inode *dir, f2fs_link() argument
155 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_link()
172 if (IS_DIRSYNC(dir)) f2fs_link()
191 static int __recover_dot_dentries(struct inode *dir, nid_t pino) __recover_dot_dentries() argument
193 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); __recover_dot_dentries()
202 de = f2fs_find_entry(dir, &dot, &page); __recover_dot_dentries()
204 f2fs_dentry_kunmap(dir, page); __recover_dot_dentries()
207 err = __f2fs_add_link(dir, &dot, NULL, dir->i_ino, S_IFDIR); __recover_dot_dentries()
212 de = f2fs_find_entry(dir, &dotdot, &page); __recover_dot_dentries()
214 f2fs_dentry_kunmap(dir, page); __recover_dot_dentries()
217 err = __f2fs_add_link(dir, &dotdot, NULL, pino, S_IFDIR); __recover_dot_dentries()
221 clear_inode_flag(F2FS_I(dir), FI_INLINE_DOTS); __recover_dot_dentries()
222 mark_inode_dirty(dir); __recover_dot_dentries()
229 static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, f2fs_lookup() argument
239 de = f2fs_find_entry(dir, &dentry->d_name, &page); f2fs_lookup()
242 f2fs_dentry_kunmap(dir, page); f2fs_lookup()
245 inode = f2fs_iget(dir->i_sb, ino); f2fs_lookup()
252 err = __recover_dot_dentries(inode, dir->i_ino); f2fs_lookup()
263 static int f2fs_unlink(struct inode *dir, struct dentry *dentry) f2fs_unlink() argument
265 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_unlink()
271 trace_f2fs_unlink_enter(dir, dentry); f2fs_unlink()
274 de = f2fs_find_entry(dir, &dentry->d_name, &page); f2fs_unlink()
282 f2fs_dentry_kunmap(dir, page); f2fs_unlink()
286 f2fs_delete_entry(de, page, dir, inode); f2fs_unlink()
292 if (IS_DIRSYNC(dir)) f2fs_unlink()
314 static int f2fs_symlink(struct inode *dir, struct dentry *dentry, f2fs_symlink() argument
317 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_symlink()
324 inode = f2fs_new_inode(dir, S_IFLNK | S_IRWXUGO); f2fs_symlink()
348 * Note that, it needs to do dir->fsync to make this recoverable. f2fs_symlink()
354 if (IS_DIRSYNC(dir)) f2fs_symlink()
362 static int f2fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) f2fs_mkdir() argument
364 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_mkdir()
370 inode = f2fs_new_inode(dir, S_IFDIR | mode); f2fs_mkdir()
392 if (IS_DIRSYNC(dir)) f2fs_mkdir()
402 static int f2fs_rmdir(struct inode *dir, struct dentry *dentry) f2fs_rmdir() argument
406 return f2fs_unlink(dir, dentry); f2fs_rmdir()
410 static int f2fs_mknod(struct inode *dir, struct dentry *dentry, f2fs_mknod() argument
413 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_mknod()
422 inode = f2fs_new_inode(dir, mode); f2fs_mknod()
440 if (IS_DIRSYNC(dir)) f2fs_mknod()
650 /* update directory entry info of old dir inode */ f2fs_cross_rename()
671 /* update directory entry info of new dir inode */ f2fs_cross_rename()
740 static int f2fs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) f2fs_tmpfile() argument
742 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); f2fs_tmpfile()
746 inode = f2fs_new_inode(dir, mode); f2fs_tmpfile()
759 err = f2fs_do_tmpfile(inode, dir); f2fs_tmpfile()
/linux-4.1.27/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.1.27/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.1.27/tools/build/tests/ex/
H A DMakefile6 build := -f $(srctree)/tools/build/Makefile.build dir=. obj
11 make -f $(srctree)/tools/build/Makefile.build dir=. $@
/linux-4.1.27/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.1.27/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.1.27/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.1.27/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.h32 enum dma_data_direction dir,
35 size_t size, enum dma_data_direction dir,
42 int nents, enum dma_data_direction dir,
46 enum dma_data_direction dir,
50 enum dma_data_direction dir);
53 enum dma_data_direction dir);
56 enum dma_data_direction dir);
59 enum dma_data_direction dir);
261 #define dma_map_single_attrs(dev, cpu_addr, size, dir, attrs) \
262 dma_map_single(dev, cpu_addr, size, dir)
264 #define dma_unmap_single_attrs(dev, dma_addr, size, dir, attrs) \
265 dma_unmap_single(dev, dma_addr, size, dir)
267 #define dma_map_sg_attrs(dev, sgl, nents, dir, attrs) \
268 dma_map_sg(dev, sgl, nents, dir)
270 #define dma_unmap_sg_attrs(dev, sgl, nents, dir, attrs) \
271 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.1.27/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.1.27/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.1.27/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.1.27/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 enum dma_data_direction dir) dma_sync_sg_for_device()
129 dma_sync_single_for_device(dev, sg->dma_address, sg->length, dir); dma_sync_sg_for_device()
134 enum dma_data_direction dir) dma_map_single()
138 dma_sync_single_for_device(dev, handle, size, dir); dma_map_single()
145 enum dma_data_direction dir) dma_map_page()
149 dma_sync_single_for_device(dev, handle, size, dir); dma_map_page()
155 enum dma_data_direction dir) dma_map_sg()
161 dma_sync_single_for_device(dev, sg->dma_address, sg->length, dir); dma_map_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 *sg, int nents, enum dma_data_direction dir) dma_sync_sg_for_device() argument
133 dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction dir) dma_map_single() argument
143 dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir) dma_map_page() argument
154 dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir) dma_map_sg() argument
/linux-4.1.27/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.1.27/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()
620 static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, reiserfs_create() argument
631 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + reiserfs_create()
632 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); reiserfs_create()
636 dquot_initialize(dir); reiserfs_create()
638 if (!(inode = new_inode(dir->i_sb))) { reiserfs_create()
641 new_inode_init(inode, dir, mode); reiserfs_create()
643 jbegin_count += reiserfs_cache_default_acl(dir); reiserfs_create()
644 retval = reiserfs_security_init(dir, inode, &dentry->d_name, &security); reiserfs_create()
650 reiserfs_write_lock(dir->i_sb); reiserfs_create()
652 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_create()
659 reiserfs_new_inode(&th, dir, mode, NULL, 0 /*i_size */ , dentry, reiserfs_create()
669 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_create()
683 reiserfs_update_inode_transaction(dir); reiserfs_create()
690 reiserfs_write_unlock(dir->i_sb); reiserfs_create()
694 static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, reiserfs_mknod() argument
707 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + reiserfs_mknod()
708 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); reiserfs_mknod()
713 dquot_initialize(dir); reiserfs_mknod()
715 if (!(inode = new_inode(dir->i_sb))) { reiserfs_mknod()
718 new_inode_init(inode, dir, mode); reiserfs_mknod()
720 jbegin_count += reiserfs_cache_default_acl(dir); reiserfs_mknod()
721 retval = reiserfs_security_init(dir, inode, &dentry->d_name, &security); reiserfs_mknod()
727 reiserfs_write_lock(dir->i_sb); reiserfs_mknod()
729 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_mknod()
736 reiserfs_new_inode(&th, dir, mode, NULL, 0 /*i_size */ , dentry, reiserfs_mknod()
749 reiserfs_update_inode_transaction(dir); reiserfs_mknod()
752 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_mknod()
771 reiserfs_write_unlock(dir->i_sb); reiserfs_mknod()
775 static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) reiserfs_mkdir() argument
787 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + reiserfs_mkdir()
788 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); reiserfs_mkdir()
790 dquot_initialize(dir); reiserfs_mkdir()
797 REISERFS_I(dir)->new_packing_locality = 1; reiserfs_mkdir()
800 if (!(inode = new_inode(dir->i_sb))) { reiserfs_mkdir()
803 new_inode_init(inode, dir, mode); reiserfs_mkdir()
805 jbegin_count += reiserfs_cache_default_acl(dir); reiserfs_mkdir()
806 retval = reiserfs_security_init(dir, inode, &dentry->d_name, &security); reiserfs_mkdir()
812 reiserfs_write_lock(dir->i_sb); reiserfs_mkdir()
814 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_mkdir()
824 INC_DIR_INODE_NLINK(dir) reiserfs_mkdir()
826 retval = reiserfs_new_inode(&th, dir, mode, NULL /*symlink */ , reiserfs_mkdir()
827 old_format_only(dir->i_sb) ? reiserfs_mkdir()
831 DEC_DIR_INODE_NLINK(dir) reiserfs_mkdir()
836 reiserfs_update_inode_transaction(dir); reiserfs_mkdir()
841 /* note, _this_ add_entry will not update dir's stat data */ reiserfs_mkdir()
843 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_mkdir()
848 DEC_DIR_INODE_NLINK(dir); reiserfs_mkdir()
857 /* the above add_entry did not update dir's stat data */ reiserfs_mkdir()
858 reiserfs_update_sd(&th, dir); reiserfs_mkdir()
864 reiserfs_write_unlock(dir->i_sb); reiserfs_mkdir()
871 * we can cheat because an old format dir cannot have reiserfs_empty_dir()
872 * EMPTY_DIR_SIZE, and a new format dir cannot have reiserfs_empty_dir()
883 static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) reiserfs_rmdir() argument
900 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); reiserfs_rmdir()
902 dquot_initialize(dir); reiserfs_rmdir()
904 reiserfs_write_lock(dir->i_sb); reiserfs_rmdir()
905 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_rmdir()
911 reiserfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, reiserfs_rmdir()
923 reiserfs_update_inode_transaction(dir); reiserfs_rmdir()
937 /* cut entry from dir directory */ reiserfs_rmdir()
939 dir, NULL, /* page */ reiserfs_rmdir()
950 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; reiserfs_rmdir()
953 DEC_DIR_INODE_NLINK(dir) reiserfs_rmdir()
954 dir->i_size -= (DEH_SIZE + de.de_entrylen); reiserfs_rmdir()
955 reiserfs_update_sd(&th, dir); reiserfs_rmdir()
963 reiserfs_write_unlock(dir->i_sb); reiserfs_rmdir()
974 reiserfs_write_unlock(dir->i_sb); reiserfs_rmdir()
978 static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) reiserfs_unlink() argument
988 dquot_initialize(dir); reiserfs_unlink()
1001 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); reiserfs_unlink()
1003 reiserfs_write_lock(dir->i_sb); reiserfs_unlink()
1004 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_unlink()
1010 reiserfs_find_entry(dir, dentry->d_name.name, dentry->d_name.len, reiserfs_unlink()
1020 reiserfs_update_inode_transaction(dir); reiserfs_unlink()
1046 reiserfs_cut_from_item(&th, &path, &de.de_entry_key, dir, NULL, reiserfs_unlink()
1055 dir->i_size -= (de.de_entrylen + DEH_SIZE); reiserfs_unlink()
1056 dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; reiserfs_unlink()
1057 reiserfs_update_sd(&th, dir); reiserfs_unlink()
1065 reiserfs_write_unlock(dir->i_sb); reiserfs_unlink()
1075 reiserfs_write_unlock(dir->i_sb); reiserfs_unlink()
1173 static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, reiserfs_link() argument
1185 2 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); reiserfs_link()
1187 dquot_initialize(dir); reiserfs_link()
1189 reiserfs_write_lock(dir->i_sb); reiserfs_link()
1192 reiserfs_write_unlock(dir->i_sb); reiserfs_link()
1199 retval = journal_begin(&th, dir->i_sb, jbegin_count); reiserfs_link()
1202 reiserfs_write_unlock(dir->i_sb); reiserfs_link()
1208 reiserfs_add_entry(&th, dir, dentry->d_name.name, reiserfs_link()
1212 reiserfs_update_inode_transaction(dir); reiserfs_link()
1218 reiserfs_write_unlock(dir->i_sb); reiserfs_link()
1228 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
H A Dacl.h54 struct inode *dir, struct dentry *dentry,
56 int reiserfs_cache_default_acl(struct inode *dir);
71 const struct inode *dir, struct dentry *dentry, reiserfs_inherit_default_acl()
70 reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, const struct inode *dir, struct dentry *dentry, struct inode *inode) reiserfs_inherit_default_acl() argument
/linux-4.1.27/drivers/staging/lustre/lustre/llite/
H A Dnamei.c144 static void ll_invalidate_negative_children(struct inode *dir) ll_invalidate_negative_children() argument
149 ll_lock_dcache(dir); ll_invalidate_negative_children()
150 ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_u.d_alias) { ll_invalidate_negative_children()
164 ll_unlock_dcache(dir); ll_invalidate_negative_children()
493 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),intent=%s\n", ll_lookup_it()
571 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),flags=%u\n", ll_lookup_nd()
595 static int ll_atomic_open(struct inode *dir, struct dentry *dentry, ll_atomic_open() argument
605 "VFS Op:name=%pd,dir=%lu/%u(%p),file %p,open_flags %x,mode %x opened %d\n", ll_atomic_open()
606 dentry, dir->i_ino, ll_atomic_open()
607 dir->i_generation, dir, file, open_flags, mode, *opened); ll_atomic_open()
622 de = ll_lookup_it(dir, dentry, it, lookup_flags); ll_atomic_open()
631 rc = ll_create_it(dir, dentry, mode, it); ll_atomic_open()
675 static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it) ll_create_node() argument
679 struct ll_sb_info *sbi = ll_i2sbi(dir); ll_create_node()
687 rc = ll_prep_inode(&inode, request, dir->i_sb, it); ll_create_node()
720 static int ll_create_it(struct inode *dir, struct dentry *dentry, int mode, ll_create_it() argument
726 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),intent=%s\n", ll_create_it()
727 dentry, dir->i_ino, ll_create_it()
728 dir->i_generation, dir, LL_IT2STR(it)); ll_create_it()
734 inode = ll_create_node(dir, it); ll_create_it()
760 static int ll_new_node(struct inode *dir, struct dentry *dentry, ll_new_node() argument
767 struct ll_sb_info *sbi = ll_i2sbi(dir); ll_new_node()
774 op_data = ll_prep_md_op_data(NULL, dir, NULL, ll_new_node()
791 ll_update_times(request, dir); ll_new_node()
793 err = ll_prep_inode(&inode, request, dir->i_sb, NULL); ll_new_node()
804 static int ll_mknod(struct inode *dir, struct dentry *dchild, ll_mknod() argument
809 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p) mode %o dev %x\n", ll_mknod()
810 dchild, dir->i_ino, dir->i_generation, dir, ll_mknod()
813 if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir))) ll_mknod()
824 err = ll_new_node(dir, dchild, NULL, mode, ll_mknod()
836 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKNOD, 1); ll_mknod()
844 static int ll_create_nd(struct inode *dir, struct dentry *dentry, ll_create_nd() argument
849 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),flags=%u, excl=%d\n", ll_create_nd()
850 dentry, dir->i_ino, ll_create_nd()
851 dir->i_generation, dir, mode, want_excl); ll_create_nd()
853 rc = ll_mknod(dir, dentry, mode, 0); ll_create_nd()
855 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_CREATE, 1); ll_create_nd()
870 * Remove dir entry
872 int ll_rmdir_entry(struct inode *dir, char *name, int namelen) ll_rmdir_entry() argument
878 CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n", ll_rmdir_entry()
879 namelen, name, dir->i_ino, dir->i_generation, dir); ll_rmdir_entry()
881 op_data = ll_prep_md_op_data(NULL, dir, NULL, name, strlen(name), ll_rmdir_entry()
886 rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); ll_rmdir_entry()
889 ll_update_times(request, dir); ll_rmdir_entry()
890 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1); ll_rmdir_entry()
897 int ll_objects_destroy(struct ptlrpc_request *request, struct inode *dir) ll_objects_destroy() argument
926 rc = obd_unpackmd(ll_i2dtexp(dir), &lsm, eadata, body->eadatasize); ll_objects_destroy()
957 rc = md_unpack_capa(ll_i2mdexp(dir), request, &RMF_CAPA2, &oc); ll_objects_destroy()
962 rc = obd_destroy(NULL, ll_i2dtexp(dir), oa, lsm, &oti, ll_objects_destroy()
963 ll_i2mdexp(dir), oc); ll_objects_destroy()
969 obd_free_memmd(ll_i2dtexp(dir), &lsm); ll_objects_destroy()
979 static int ll_unlink(struct inode *dir, struct dentry *dentry) ll_unlink() argument
985 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p)\n", ll_unlink()
986 dentry, dir->i_ino, dir->i_generation, dir); ll_unlink()
988 op_data = ll_prep_md_op_data(NULL, dir, NULL, ll_unlink()
997 rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); ll_unlink()
1002 ll_update_times(request, dir); ll_unlink()
1003 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_UNLINK, 1); ll_unlink()
1005 rc = ll_objects_destroy(request, dir); ll_unlink()
1011 static int ll_mkdir(struct inode *dir, struct dentry *dentry, ll_umode_t mode) ll_mkdir() argument
1015 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p)\n", ll_mkdir()
1016 dentry, dir->i_ino, dir->i_generation, dir); ll_mkdir()
1018 if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir))) ll_mkdir()
1021 err = ll_new_node(dir, dentry, NULL, mode, 0, LUSTRE_OPC_MKDIR); ll_mkdir()
1024 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_MKDIR, 1); ll_mkdir()
1029 static int ll_rmdir(struct inode *dir, struct dentry *dentry) ll_rmdir() argument
1035 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p)\n", ll_rmdir()
1036 dentry, dir->i_ino, dir->i_generation, dir); ll_rmdir()
1038 op_data = ll_prep_md_op_data(NULL, dir, NULL, ll_rmdir()
1047 rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); ll_rmdir()
1050 ll_update_times(request, dir); ll_rmdir()
1051 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1); ll_rmdir()
1058 static int ll_symlink(struct inode *dir, struct dentry *dentry, ll_symlink() argument
1063 CDEBUG(D_VFSTRACE, "VFS Op:name=%pd,dir=%lu/%u(%p),target=%.*s\n", ll_symlink()
1064 dentry, dir->i_ino, dir->i_generation, ll_symlink()
1065 dir, 3000, oldname); ll_symlink()
1067 err = ll_new_node(dir, dentry, oldname, S_IFLNK | S_IRWXUGO, ll_symlink()
1071 ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_SYMLINK, 1); ll_symlink()
1076 static int ll_link(struct dentry *old_dentry, struct inode *dir, ll_link() argument
1080 struct ll_sb_info *sbi = ll_i2sbi(dir); ll_link()
1086 "VFS Op: inode=%lu/%u(%p), dir=%lu/%u(%p), target=%pd\n", ll_link()
1087 src->i_ino, src->i_generation, src, dir->i_ino, ll_link()
1088 dir->i_generation, dir, new_dentry); ll_link()
1090 op_data = ll_prep_md_op_data(NULL, src, dir, new_dentry->d_name.name, ll_link()
1101 ll_update_times(request, dir); ll_link()
H A Dllite_nfs.c233 struct inode *dir = d_inode(dentry); ll_get_name() local
241 if (!dir || !S_ISDIR(dir->i_mode)) { ll_get_name()
246 if (!dir->i_fop) { ll_get_name()
251 mutex_lock(&dir->i_mutex); ll_get_name()
252 rc = ll_dir_read(dir, &lgd.ctx); ll_get_name()
253 mutex_unlock(&dir->i_mutex); ll_get_name()
285 struct inode *dir = d_inode(dchild); ll_get_parent() local
294 LASSERT(dir && S_ISDIR(dir->i_mode)); ll_get_parent()
296 sbi = ll_s2sbi(dir->i_sb); ll_get_parent()
299 dir->i_ino, PFID(ll_inode2fid(dir))); ll_get_parent()
305 op_data = ll_prep_md_op_data(NULL, dir, NULL, dotdot, ll_get_parent()
314 CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino); ll_get_parent()
321 PFID(ll_inode2fid(dir)), PFID(&body->fid1)); ll_get_parent()
323 result = ll_iget_for_nfs(dir->i_sb, &body->fid1, NULL); ll_get_parent()
H A DMakefile3 lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \
/linux-4.1.27/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.1.27/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.c74 int hfsplus_init_security(struct inode *inode, struct inode *dir, hfsplus_init_security() argument
77 return security_inode_init_security(inode, dir, qstr, hfsplus_init_security()
82 struct inode *dir, hfsplus_init_inode_security()
87 err = hfsplus_init_posix_acl(inode, dir); hfsplus_init_inode_security()
89 err = hfsplus_init_security(inode, dir, qstr); hfsplus_init_inode_security()
81 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.1.27/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.1.27/fs/ceph/
H A DMakefile7 ceph-y := super.o inode.o dir.o file.o locks.o addr.o ioctl.o \
H A Ddir.c113 * falling back to a "normal" sync readdir if any dentries in the dir
116 * Complete dir indicates that we have all dentries in the dir. It is
125 struct inode *dir = d_inode(parent); __dcache_readdir() local
136 dir, shared_gen, ctx->pos, last); __dcache_readdir()
184 if (!ceph_dir_is_complete_ordered(dir)) { __dcache_readdir()
185 dout(" lost dir complete on %p; falling back to mds\n", dir); __dcache_readdir()
227 * regardless of what dir changes take place on the
311 /* note dir version at start of readdir so we can tell ceph_readdir()
369 /* preclude from marking dir complete */ ceph_readdir()
452 * if dir_release_count still matches the dir, no dentries ceph_readdir()
454 * the complete dir contents in our cache. ceph_readdir()
548 /* .snap dir? */ ceph_handle_snapdir()
607 * Look up a single dir entry. If there is a lookup intent, inform
610 static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry, ceph_lookup() argument
613 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_lookup()
620 dir, dentry, dentry); ceph_lookup()
631 struct ceph_inode_info *ci = ceph_inode(dir); ceph_lookup()
635 dout(" dir %p flags are %d\n", dir, ci->i_ceph_flags); ceph_lookup()
639 !is_root_ceph_dentry(dir, dentry) && ceph_lookup()
644 dout(" dir %p complete, -ENOENT\n", dir); ceph_lookup()
652 op = ceph_snap(dir) == CEPH_SNAPDIR ? ceph_lookup()
661 req->r_locked_dir = dir; ceph_lookup()
674 int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry) ceph_handle_notrace_create() argument
676 struct dentry *result = ceph_lookup(dir, dentry, 0); ceph_handle_notrace_create()
697 static int ceph_mknod(struct inode *dir, struct dentry *dentry, ceph_mknod() argument
700 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_mknod()
706 if (ceph_snap(dir) != CEPH_NOSNAP) ceph_mknod()
709 err = ceph_pre_init_acls(dir, &mode, &acls); ceph_mknod()
713 dout("mknod in dir %p dentry %p mode 0%ho rdev %d\n", ceph_mknod()
714 dir, dentry, mode, rdev); ceph_mknod()
722 req->r_locked_dir = dir; ceph_mknod()
731 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_mknod()
733 err = ceph_handle_notrace_create(dir, dentry); ceph_mknod()
744 static int ceph_create(struct inode *dir, struct dentry *dentry, umode_t mode, ceph_create() argument
747 return ceph_mknod(dir, dentry, mode, 0); ceph_create()
750 static int ceph_symlink(struct inode *dir, struct dentry *dentry, ceph_symlink() argument
753 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_symlink()
758 if (ceph_snap(dir) != CEPH_NOSNAP) ceph_symlink()
761 dout("symlink in dir %p dentry %p to '%s'\n", dir, dentry, dest); ceph_symlink()
773 req->r_locked_dir = dir; ceph_symlink()
778 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_symlink()
780 err = ceph_handle_notrace_create(dir, dentry); ceph_symlink()
788 static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ceph_mkdir() argument
790 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_mkdir()
797 if (ceph_snap(dir) == CEPH_SNAPDIR) { ceph_mkdir()
800 dout("mksnap dir %p snap '%pd' dn %p\n", dir, ceph_mkdir()
802 } else if (ceph_snap(dir) == CEPH_NOSNAP) { ceph_mkdir()
803 dout("mkdir dir %p dn %p mode 0%ho\n", dir, dentry, mode); ceph_mkdir()
810 err = ceph_pre_init_acls(dir, &mode, &acls); ceph_mkdir()
822 req->r_locked_dir = dir; ceph_mkdir()
830 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_mkdir()
834 err = ceph_handle_notrace_create(dir, dentry); ceph_mkdir()
845 static int ceph_link(struct dentry *old_dentry, struct inode *dir, ceph_link() argument
848 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_link()
853 if (ceph_snap(dir) != CEPH_NOSNAP) ceph_link()
856 dout("link in dir %p old_dentry %p dentry %p\n", dir, ceph_link()
866 req->r_locked_dir = dir; ceph_link()
871 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_link()
905 static int ceph_unlink(struct inode *dir, struct dentry *dentry) ceph_unlink() argument
907 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); ceph_unlink()
914 if (ceph_snap(dir) == CEPH_SNAPDIR) { ceph_unlink()
916 dout("rmsnap dir %p '%pd' dn %p\n", dir, dentry, dentry); ceph_unlink()
918 } else if (ceph_snap(dir) == CEPH_NOSNAP) { ceph_unlink()
919 dout("unlink/rmdir dir %p dn %p inode %p\n", ceph_unlink()
920 dir, dentry, inode); ceph_unlink()
932 req->r_locked_dir = dir; ceph_unlink()
936 err = ceph_mdsc_do_request(mdsc, dir, req); ceph_unlink()
961 dout("rename dir %p dentry %p to dir %p dentry %p\n", ceph_rename()
1026 struct inode *dir = NULL; dentry_lease_is_valid() local
1045 dir = d_inode(dentry->d_parent); dentry_lease_is_valid()
1056 ceph_mdsc_lease_send_msg(session, dir, dentry, dentry_lease_is_valid()
1067 static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry) dir_lease_is_valid() argument
1069 struct ceph_inode_info *ci = ceph_inode(dir); dir_lease_is_valid()
1077 dout("dir_lease_is_valid dir %p v%u dentry %p v%u = %d\n", dir_lease_is_valid()
1078 dir, (unsigned)ci->i_shared_gen, dentry, dir_lease_is_valid()
1089 struct inode *dir; ceph_d_revalidate() local
1097 dir = ceph_get_dentry_parent_inode(dentry); ceph_d_revalidate()
1100 if (ceph_snap(dir) != CEPH_NOSNAP) { ceph_d_revalidate()
1108 dir_lease_is_valid(dir, dentry)) { ceph_d_revalidate()
1119 ceph_dir_clear_complete(dir); ceph_d_revalidate()
1121 iput(dir); ceph_d_revalidate()
1164 /* if we are not hashed, we don't affect dir's completeness */ ceph_d_prune()
1176 * read() on a dir. This weird interface hack only works if mounted
1227 * an fsync() on a dir will wait for any uncommitted directory
1334 unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn) ceph_dentry_hash() argument
1336 struct ceph_inode_info *dci = ceph_inode(dir); ceph_dentry_hash()
/linux-4.1.27/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.1.27/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
100 dquot_initialize(dir); ext2_create()
102 inode = ext2_new_inode(dir, mode, &dentry->d_name); ext2_create()
118 static int ext2_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ext2_tmpfile() argument
120 struct inode *inode = ext2_new_inode(dir, mode, NULL); ext2_tmpfile()
138 static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev) ext2_mknod() argument
146 dquot_initialize(dir); ext2_mknod()
148 inode = ext2_new_inode (dir, mode, &dentry->d_name); ext2_mknod()
161 static int ext2_symlink (struct inode * dir, struct dentry * dentry, ext2_symlink() argument
164 struct super_block * sb = dir->i_sb; ext2_symlink()
172 dquot_initialize(dir); ext2_symlink()
174 inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO, &dentry->d_name); ext2_symlink()
208 static int ext2_link (struct dentry * old_dentry, struct inode * dir, ext2_link() argument
214 dquot_initialize(dir); ext2_link()
230 static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) ext2_mkdir() argument
235 dquot_initialize(dir); ext2_mkdir()
237 inode_inc_link_count(dir); ext2_mkdir()
239 inode = ext2_new_inode(dir, S_IFDIR | mode, &dentry->d_name); ext2_mkdir()
253 err = ext2_make_empty(inode, dir); ext2_mkdir()
272 inode_dec_link_count(dir); ext2_mkdir()
276 static int ext2_unlink(struct inode * dir, struct dentry *dentry) ext2_unlink() argument
283 dquot_initialize(dir); ext2_unlink()
285 de = ext2_find_entry (dir, &dentry->d_name, &page); ext2_unlink()
293 inode->i_ctime = dir->i_ctime; ext2_unlink()
300 static int ext2_rmdir (struct inode * dir, struct dentry *dentry) ext2_rmdir() argument
306 err = ext2_unlink(dir, dentry); ext2_rmdir()
310 inode_dec_link_count(dir); ext2_rmdir()
H A Ddir.c2 * linux/fs/ext2/dir.c
11 * linux/fs/minix/dir.c
96 struct inode *dir = mapping->host; ext2_commit_chunk() local
99 dir->i_version++; ext2_commit_chunk()
102 if (pos+len > dir->i_size) { ext2_commit_chunk()
103 i_size_write(dir, pos+len); ext2_commit_chunk()
104 mark_inode_dirty(dir); ext2_commit_chunk()
107 if (IS_DIRSYNC(dir)) { ext2_commit_chunk()
110 err = sync_inode_metadata(dir, 1); ext2_commit_chunk()
120 struct inode *dir = page->mapping->host; ext2_check_page() local
121 struct super_block *sb = dir->i_sb; ext2_check_page()
122 unsigned chunk_size = ext2_chunk_size(dir); ext2_check_page()
130 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { ext2_check_page()
131 limit = dir->i_size & ~PAGE_CACHE_MASK; ext2_check_page()
164 "of chunk size", dir->i_ino); ext2_check_page()
184 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, ext2_check_page()
194 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, ext2_check_page()
202 static struct page * ext2_get_page(struct inode *dir, unsigned long n, ext2_get_page() argument
205 struct address_space *mapping = dir->i_mapping; ext2_get_page()
366 struct ext2_dir_entry_2 *ext2_find_entry (struct inode * dir, ext2_find_entry() argument
373 unsigned long npages = dir_pages(dir); ext2_find_entry()
375 struct ext2_inode_info *ei = EXT2_I(dir); ext2_find_entry()
391 page = ext2_get_page(dir, n, dir_has_error); ext2_find_entry()
395 kaddr += ext2_last_byte(dir, n) - reclen; ext2_find_entry()
398 ext2_error(dir->i_sb, __func__, ext2_find_entry()
414 if (unlikely(n > (dir->i_blocks >> (PAGE_CACHE_SHIFT - 9)))) { ext2_find_entry()
415 ext2_error(dir->i_sb, __func__, ext2_find_entry()
416 "dir %lu size %lld exceeds block count %llu", ext2_find_entry()
417 dir->i_ino, dir->i_size, ext2_find_entry()
418 (unsigned long long)dir->i_blocks); ext2_find_entry()
431 struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p) ext2_dotdot() argument
433 struct page *page = ext2_get_page(dir, 0, 0); ext2_dotdot()
443 ino_t ext2_inode_by_name(struct inode *dir, struct qstr *child) ext2_inode_by_name() argument
449 de = ext2_find_entry (dir, child, &page); ext2_inode_by_name()
463 void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, ext2_set_link() argument
479 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ext2_set_link()
480 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; ext2_set_link()
481 mark_inode_dirty(dir); ext2_set_link()
489 struct inode *dir = d_inode(dentry->d_parent); ext2_add_link() local
492 unsigned chunk_size = ext2_chunk_size(dir); ext2_add_link()
497 unsigned long npages = dir_pages(dir); ext2_add_link()
511 page = ext2_get_page(dir, n, 0); ext2_add_link()
517 dir_end = kaddr + ext2_last_byte(dir, n); ext2_add_link()
530 ext2_error(dir->i_sb, __func__, ext2_add_link()
569 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; ext2_add_link()
570 EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; ext2_add_link()
571 mark_inode_dirty(dir); ext2_add_link()
586 int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) ext2_delete_entry() argument
590 unsigned from = ((char*)dir - kaddr) & ~(ext2_chunk_size(inode)-1); ext2_delete_entry()
591 unsigned to = ((char *)dir - kaddr) + ext2_delete_entry()
592 ext2_rec_len_from_disk(dir->rec_len); ext2_delete_entry()
598 while ((char*)de < (char*)dir) { ext2_delete_entry()
616 dir->inode = 0; ext2_delete_entry()
/linux-4.1.27/fs/ext3/
H A DMakefile7 ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \
H A Dnamei.c143 static unsigned dx_root_limit (struct inode *dir, unsigned infosize);
144 static unsigned dx_node_limit (struct inode *dir);
146 struct inode *dir,
158 static int ext3_htree_next_block(struct inode *dir, __u32 hash,
162 static struct buffer_head * ext3_dx_find_entry(struct inode *dir,
223 static inline unsigned dx_root_limit (struct inode *dir, unsigned infosize) dx_root_limit() argument
225 unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(1) - dx_root_limit()
230 static inline unsigned dx_node_limit (struct inode *dir) dx_node_limit() argument
232 unsigned entry_space = dir->i_sb->s_blocksize - EXT3_DIR_REC_LEN(0); dx_node_limit()
288 struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir, dx_show_entries() argument
291 unsigned blocksize = dir->i_sb->s_blocksize; dx_show_entries()
303 if (!(bh = ext3_bread (NULL,dir, block, 0,&err))) continue; dx_show_entries()
305 dx_show_entries(hinfo, dir, ((struct dx_node *) bh->b_data)->entries, levels - 1): dx_show_entries()
329 dx_probe(struct qstr *entry, struct inode *dir, dx_probe() argument
340 if (!(bh = ext3_dir_bread(NULL, dir, 0, 0, err))) { dx_probe()
348 ext3_warning(dir->i_sb, __func__, dx_probe()
357 hinfo->hash_version += EXT3_SB(dir->i_sb)->s_hash_unsigned; dx_probe()
358 hinfo->seed = EXT3_SB(dir->i_sb)->s_hash_seed; dx_probe()
364 ext3_warning(dir->i_sb, __func__, dx_probe()
373 ext3_warning(dir->i_sb, __func__, dx_probe()
384 if (dx_get_limit(entries) != dx_root_limit(dir, dx_probe()
386 ext3_warning(dir->i_sb, __func__, dx_probe()
398 ext3_warning(dir->i_sb, __func__, dx_probe()
439 if (!(bh = ext3_dir_bread(NULL, dir, dx_get_block(at), 0, err))) { dx_probe()
444 if (dx_get_limit(entries) != dx_node_limit (dir)) { dx_probe()
445 ext3_warning(dir->i_sb, __func__, dx_probe()
461 ext3_warning(dir->i_sb, __func__, dx_probe()
462 "Corrupt dir inode %ld, running e2fsck is " dx_probe()
463 "recommended.", dir->i_ino); dx_probe()
494 static int ext3_htree_next_block(struct inode *dir, __u32 hash, ext3_htree_next_block() argument
540 if (!(bh = ext3_dir_bread(NULL, dir, dx_get_block(p->at), ext3_htree_next_block()
558 struct inode *dir, int block, htree_dirblock_to_tree()
568 if (!(bh = ext3_dir_bread(NULL, dir, block, 0, &err))) htree_dirblock_to_tree()
573 dir->i_sb->s_blocksize - htree_dirblock_to_tree()
576 if (!ext3_check_dir_entry("htree_dirblock_to_tree", dir, de, bh, htree_dirblock_to_tree()
577 (block<<EXT3_BLOCK_SIZE_BITS(dir->i_sb)) htree_dirblock_to_tree()
615 struct inode *dir; ext3_htree_fill_tree() local
623 dir = file_inode(dir_file); ext3_htree_fill_tree()
624 if (!(EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) { ext3_htree_fill_tree()
625 hinfo.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version; ext3_htree_fill_tree()
628 EXT3_SB(dir->i_sb)->s_hash_unsigned; ext3_htree_fill_tree()
629 hinfo.seed = EXT3_SB(dir->i_sb)->s_hash_seed; ext3_htree_fill_tree()
630 count = htree_dirblock_to_tree(dir_file, dir, 0, &hinfo, ext3_htree_fill_tree()
658 ret = htree_dirblock_to_tree(dir_file, dir, block, &hinfo, ext3_htree_fill_tree()
666 ret = ext3_htree_next_block(dir, HASH_NB_ALWAYS, ext3_htree_fill_tree()
794 struct inode *dir, search_dirblock()
806 dlimit = bh->b_data + dir->i_sb->s_blocksize; search_dirblock()
815 dir, de, bh, offset)) search_dirblock()
842 static struct buffer_head *ext3_find_entry(struct inode *dir, ext3_find_entry() argument
860 sb = dir->i_sb; ext3_find_entry()
874 if (is_dx(dir)) { ext3_find_entry()
875 bh = ext3_dx_find_entry(dir, entry, res_dir, &err); ext3_find_entry()
885 nblocks = dir->i_size >> EXT3_BLOCK_SIZE_BITS(sb); ext3_find_entry()
886 start = EXT3_I(dir)->i_dir_start_lookup; ext3_find_entry()
910 bh = ext3_getblk(NULL, dir, b++, 0, &err); ext3_find_entry()
926 "offset %lu", dir->i_ino, block); ext3_find_entry()
930 i = search_dirblock(bh, dir, entry, ext3_find_entry()
933 EXT3_I(dir)->i_dir_start_lookup = block; ext3_find_entry()
951 nblocks = dir->i_size >> EXT3_BLOCK_SIZE_BITS(sb); ext3_find_entry()
964 static struct buffer_head * ext3_dx_find_entry(struct inode *dir, ext3_dx_find_entry() argument
968 struct super_block *sb = dir->i_sb; ext3_dx_find_entry()
975 if (!(frame = dx_probe(entry, dir, &hinfo, frames, err))) ext3_dx_find_entry()
979 if (!(bh = ext3_dir_bread (NULL, dir, block, 0, err))) ext3_dx_find_entry()
982 retval = search_dirblock(bh, dir, entry, ext3_dx_find_entry()
996 retval = ext3_htree_next_block(dir, hinfo.hash, frame, ext3_dx_find_entry()
1001 dir->i_ino); ext3_dx_find_entry()
1014 static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags) ext3_lookup() argument
1023 bh = ext3_find_entry(dir, &dentry->d_name, &de); ext3_lookup()
1028 if (!ext3_valid_inum(dir->i_sb, ino)) { ext3_lookup()
1029 ext3_error(dir->i_sb, "ext3_lookup", ext3_lookup()
1033 inode = ext3_iget(dir->i_sb, ino); ext3_lookup()
1035 ext3_error(dir->i_sb, __func__, ext3_lookup()
1108 * Compact each dir entry in the range to the minimal rec_len.
1134 * Split a full leaf block to make room for a new dir entry.
1138 static struct ext3_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, do_split() argument
1142 unsigned blocksize = dir->i_sb->s_blocksize; do_split()
1153 bh2 = ext3_append (handle, dir, &newblock, &err); do_split()
1224 ext3_std_error(dir->i_sb, err); do_split()
1246 struct inode *dir = d_inode(dentry->d_parent); add_dirent_to_buf() local
1257 top = bh->b_data + dir->i_sb->s_blocksize - reclen; add_dirent_to_buf()
1259 if (!ext3_check_dir_entry("ext3_add_entry", dir, de, add_dirent_to_buf()
1281 ext3_std_error(dir->i_sb, err); add_dirent_to_buf()
1298 ext3_set_de_type(dir->i_sb, de, inode->i_mode); add_dirent_to_buf()
1314 dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; add_dirent_to_buf()
1315 ext3_update_dx_flag(dir); add_dirent_to_buf()
1316 dir->i_version++; add_dirent_to_buf()
1317 ext3_mark_inode_dirty(handle, dir); add_dirent_to_buf()
1321 ext3_std_error(dir->i_sb, err); add_dirent_to_buf()
1333 struct inode *dir = d_inode(dentry->d_parent); make_indexed_dir() local
1349 blocksize = dir->i_sb->s_blocksize; make_indexed_dir()
1350 dxtrace(printk(KERN_DEBUG "Creating index: inode %lu\n", dir->i_ino)); make_indexed_dir()
1353 ext3_std_error(dir->i_sb, retval); make_indexed_dir()
1364 ext3_error(dir->i_sb, __func__, make_indexed_dir()
1366 dir->i_ino); make_indexed_dir()
1372 bh2 = ext3_append (handle, dir, &block, &retval); make_indexed_dir()
1377 EXT3_I(dir)->i_flags |= EXT3_INDEX_FL; make_indexed_dir()
1391 root->info.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version; make_indexed_dir()
1395 dx_set_limit (entries, dx_root_limit(dir, sizeof(root->info))); make_indexed_dir()
1400 hinfo.hash_version += EXT3_SB(dir->i_sb)->s_hash_unsigned; make_indexed_dir()
1401 hinfo.seed = EXT3_SB(dir->i_sb)->s_hash_seed; make_indexed_dir()
1414 de = do_split(handle,dir, &bh, frame, &hinfo, &retval); make_indexed_dir()
1416 ext3_mark_inode_dirty(handle, dir); make_indexed_dir()
1438 struct inode *dir = d_inode(dentry->d_parent); ext3_add_entry() local
1447 sb = dir->i_sb; ext3_add_entry()
1451 if (is_dx(dir)) { ext3_add_entry()
1455 EXT3_I(dir)->i_flags &= ~EXT3_INDEX_FL; ext3_add_entry()
1457 ext3_mark_inode_dirty(handle, dir); ext3_add_entry()
1459 blocks = dir->i_size >> sb->s_blocksize_bits; ext3_add_entry()
1461 if (!(bh = ext3_dir_bread(handle, dir, block, 0, &retval))) ext3_add_entry()
1473 bh = ext3_append(handle, dir, &block, &retval); ext3_add_entry()
1492 struct inode *dir = d_inode(dentry->d_parent); ext3_dx_add_entry() local
1493 struct super_block * sb = dir->i_sb; ext3_dx_add_entry()
1497 frame = dx_probe(&dentry->d_name, dir, &hinfo, frames, &err); ext3_dx_add_entry()
1503 if (!(bh = ext3_dir_bread(handle, dir, dx_get_block(frame->at), 0, &err))) ext3_dx_add_entry()
1536 bh2 = ext3_append (handle, dir, &newblock, &err); ext3_dx_add_entry()
1562 dx_set_limit (entries2, dx_node_limit(dir)); ext3_dx_add_entry()
1582 dx_set_limit(entries2, dx_node_limit(dir)); ext3_dx_add_entry()
1603 de = do_split(handle, dir, &bh, frame, &hinfo, &err); ext3_dx_add_entry()
1611 ext3_std_error(dir->i_sb, err); ext3_dx_add_entry()
1624 struct inode * dir, ext3_delete_entry()
1635 if (!ext3_check_dir_entry("ext3_delete_entry", dir, de, bh, i)) ext3_delete_entry()
1651 dir->i_version++; ext3_delete_entry()
1656 ext3_std_error(dir->i_sb, err); ext3_delete_entry()
1692 static int ext3_create (struct inode * dir, struct dentry * dentry, umode_t mode, ext3_create() argument
1699 dquot_initialize(dir); ext3_create()
1702 handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + ext3_create()
1704 EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb)); ext3_create()
1708 if (IS_DIRSYNC(dir)) ext3_create()
1711 inode = ext3_new_inode (handle, dir, &dentry->d_name, mode); ext3_create()
1720 if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) ext3_create()
1725 static int ext3_mknod (struct inode * dir, struct dentry *dentry, ext3_mknod() argument
1735 dquot_initialize(dir); ext3_mknod()
1738 handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + ext3_mknod()
1740 EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb)); ext3_mknod()
1744 if (IS_DIRSYNC(dir)) ext3_mknod()
1747 inode = ext3_new_inode (handle, dir, &dentry->d_name, mode); ext3_mknod()
1757 if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) ext3_mknod()
1762 static int ext3_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ext3_tmpfile() argument
1768 dquot_initialize(dir); ext3_tmpfile()
1771 handle = ext3_journal_start(dir, EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) + ext3_tmpfile()
1777 inode = ext3_new_inode (handle, dir, NULL, mode); ext3_tmpfile()
1791 if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) ext3_tmpfile()
1800 static int ext3_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) ext3_mkdir() argument
1808 if (dir->i_nlink >= EXT3_LINK_MAX) ext3_mkdir()
1811 dquot_initialize(dir); ext3_mkdir()
1814 handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + ext3_mkdir()
1816 EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb)); ext3_mkdir()
1820 if (IS_DIRSYNC(dir)) ext3_mkdir()
1823 inode = ext3_new_inode (handle, dir, &dentry->d_name, S_IFDIR | mode); ext3_mkdir()
1844 ext3_set_de_type(dir->i_sb, de, S_IFDIR); ext3_mkdir()
1846 de->inode = cpu_to_le32(dir->i_ino); ext3_mkdir()
1851 ext3_set_de_type(dir->i_sb, de, S_IFDIR); ext3_mkdir()
1870 inc_nlink(dir); ext3_mkdir()
1871 ext3_update_dx_flag(dir); ext3_mkdir()
1872 err = ext3_mark_inode_dirty(handle, dir); ext3_mkdir()
1881 if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) ext3_mkdir()
1906 "bad directory (dir #%lu) - no data block", empty_dir()
1917 "bad directory (dir #%lu) - no `.' or `..'", empty_dir()
2103 static int ext3_rmdir (struct inode * dir, struct dentry *dentry) ext3_rmdir() argument
2113 dquot_initialize(dir); ext3_rmdir()
2116 handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); ext3_rmdir()
2121 bh = ext3_find_entry(dir, &dentry->d_name, &de); ext3_rmdir()
2125 if (IS_DIRSYNC(dir)) ext3_rmdir()
2138 retval = ext3_delete_entry(handle, dir, de, bh); ext3_rmdir()
2152 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; ext3_rmdir()
2154 drop_nlink(dir); ext3_rmdir()
2155 ext3_update_dx_flag(dir); ext3_rmdir()
2156 ext3_mark_inode_dirty(handle, dir); ext3_rmdir()
2164 static int ext3_unlink(struct inode * dir, struct dentry *dentry) ext3_unlink() argument
2172 trace_ext3_unlink_enter(dir, dentry); ext3_unlink()
2175 dquot_initialize(dir); ext3_unlink()
2178 handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); ext3_unlink()
2182 if (IS_DIRSYNC(dir)) ext3_unlink()
2186 bh = ext3_find_entry(dir, &dentry->d_name, &de); ext3_unlink()
2202 retval = ext3_delete_entry(handle, dir, de, bh); ext3_unlink()
2205 dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; ext3_unlink()
2206 ext3_update_dx_flag(dir); ext3_unlink()
2207 ext3_mark_inode_dirty(handle, dir); ext3_unlink()
2211 inode->i_ctime = dir->i_ctime; ext3_unlink()
2222 static int ext3_symlink (struct inode * dir, ext3_symlink() argument
2231 if (l > dir->i_sb->s_blocksize) ext3_symlink()
2234 dquot_initialize(dir); ext3_symlink()
2243 credits = 4 + EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) + ext3_symlink()
2252 credits = EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + ext3_symlink()
2254 EXT3_MAXQUOTAS_INIT_BLOCKS(dir->i_sb); ext3_symlink()
2257 handle = ext3_journal_start(dir, credits); ext3_symlink()
2261 if (IS_DIRSYNC(dir)) ext3_symlink()
2264 inode = ext3_new_inode (handle, dir, &dentry->d_name, S_IFLNK|S_IRWXUGO); ext3_symlink()
2292 * Now inode is being linked into dir (EXT3_DATA_TRANS_BLOCKS ext3_symlink()
2295 handle = ext3_journal_start(dir, ext3_symlink()
2296 EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + ext3_symlink()
2318 if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) ext3_symlink()
2328 struct inode * dir, struct dentry *dentry) ext3_link()
2337 dquot_initialize(dir); ext3_link()
2340 handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) + ext3_link()
2345 if (IS_DIRSYNC(dir)) ext3_link()
2366 if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) ext3_link()
557 htree_dirblock_to_tree(struct file *dir_file, struct inode *dir, int block, struct dx_hash_info *hinfo, __u32 start_hash, __u32 start_minor_hash) htree_dirblock_to_tree() argument
793 search_dirblock(struct buffer_head * bh, struct inode *dir, struct qstr *child, unsigned long offset, struct ext3_dir_entry_2 ** res_dir) search_dirblock() argument
1623 ext3_delete_entry(handle_t *handle, struct inode * dir, struct ext3_dir_entry_2 * de_del, struct buffer_head * bh) ext3_delete_entry() argument
2327 ext3_link(struct dentry * old_dentry, struct inode * dir, struct dentry *dentry) ext3_link() argument
/linux-4.1.27/fs/gfs2/
H A DMakefile3 gfs2-y := acl.o bmap.o dir.o xattr.o glock.o \
H A Dinode.c28 #include "dir.h"
283 struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name, gfs2_lookupi() argument
286 struct super_block *sb = dir->i_sb; gfs2_lookupi()
287 struct gfs2_inode *dip = GFS2_I(dir); gfs2_lookupi()
298 dir == d_inode(sb->s_root))) { gfs2_lookupi()
299 igrab(dir); gfs2_lookupi()
300 return dir; gfs2_lookupi()
311 error = gfs2_permission(dir, MAY_EXEC); gfs2_lookupi()
316 inode = gfs2_dir_search(dir, name, false); gfs2_lookupi()
501 * @da: The dir add information
573 * @dir: The parent directory
584 static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, gfs2_create_inode() argument
593 struct gfs2_inode *dip = GFS2_I(dir), *ip; gfs2_create_inode()
620 inode = gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl); gfs2_create_inode()
642 error = gfs2_diradd_alloc_required(dir, name, &da); gfs2_create_inode()
651 error = posix_acl_create(dir, &mode, &default_acl, &acl); gfs2_create_inode()
804 * @dir: The directory in which to create the file
811 static int gfs2_create(struct inode *dir, struct dentry *dentry, gfs2_create() argument
814 return gfs2_create_inode(dir, dentry, NULL, S_IFREG | mode, 0, NULL, 0, excl, NULL); gfs2_create()
819 * @dir: The directory inode
828 static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, __gfs2_lookup() argument
837 inode = gfs2_lookupi(dir, &dentry->d_name, 0); __gfs2_lookup()
868 static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry, gfs2_lookup() argument
871 return __gfs2_lookup(dir, dentry, NULL, NULL); gfs2_lookup()
877 * @dir: Add link to this directory
880 * Link the inode in "old_dentry" into the directory "dir" with the
886 static int gfs2_link(struct dentry *old_dentry, struct inode *dir, gfs2_link() argument
889 struct gfs2_inode *dip = GFS2_I(dir); gfs2_link()
890 struct gfs2_sbd *sdp = GFS2_SB(dir); gfs2_link()
920 error = gfs2_permission(dir, MAY_WRITE | MAY_EXEC); gfs2_link()
924 error = gfs2_dir_check(dir, &dentry->d_name, NULL); gfs2_link()
950 error = gfs2_diradd_alloc_required(dir, &dentry->d_name, &da); gfs2_link()
977 error = gfs2_dir_add(dir, &dentry->d_name, ip, &da); gfs2_link()
1044 * gfs2_unlink_inode - Removes an inode from its parent dir and unlinks it
1081 * @dir: The inode of the directory containing the inode to unlink
1090 static int gfs2_unlink(struct inode *dir, struct dentry *dentry) gfs2_unlink() argument
1092 struct gfs2_inode *dip = GFS2_I(dir); gfs2_unlink()
1093 struct gfs2_sbd *sdp = GFS2_SB(dir); gfs2_unlink()
1166 * @dir: The directory to create the symlink in
1173 static int gfs2_symlink(struct inode *dir, struct dentry *dentry, gfs2_symlink() argument
1176 struct gfs2_sbd *sdp = GFS2_SB(dir); gfs2_symlink()
1183 return gfs2_create_inode(dir, dentry, NULL, S_IFLNK | S_IRWXUGO, 0, symname, size, 0, NULL); gfs2_symlink()
1188 * @dir: The parent directory of the new one
1195 static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) gfs2_mkdir() argument
1197 struct gfs2_sbd *sdp = GFS2_SB(dir); gfs2_mkdir()
1199 return gfs2_create_inode(dir, dentry, NULL, S_IFDIR | mode, 0, NULL, dsize, 0, NULL); gfs2_mkdir()
1204 * @dir: The directory in which the special file will reside
1211 static int gfs2_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, gfs2_mknod() argument
1214 return gfs2_create_inode(dir, dentry, NULL, mode, dev, NULL, 0, 0, NULL); gfs2_mknod()
1219 * @dir: The directory
1229 static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry, gfs2_atomic_open() argument
1239 d = __gfs2_lookup(dir, dentry, file, opened); gfs2_atomic_open()
1257 return gfs2_create_inode(dir, dentry, file, S_IFREG | mode, 0, NULL, 0, excl, opened); gfs2_atomic_open()
1273 struct inode *dir = &to->i_inode; gfs2_ok_to_move() local
1274 struct super_block *sb = dir->i_sb; gfs2_ok_to_move()
1278 igrab(dir); gfs2_ok_to_move()
1281 if (dir == &this->i_inode) { gfs2_ok_to_move()
1285 if (dir == d_inode(sb->s_root)) { gfs2_ok_to_move()
1290 tmp = gfs2_lookupi(dir, &gfs2_qdotdot, 1); gfs2_ok_to_move()
1300 iput(dir); gfs2_ok_to_move()
1301 dir = tmp; gfs2_ok_to_move()
1304 iput(dir); gfs2_ok_to_move()
1457 /* Check out the dir to be renamed */ gfs2_rename()
/linux-4.1.27/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.1.27/fs/exofs/
H A Ddir.c47 /* Accesses dir's inode->i_size must be called under inode lock */ dir_pages()
66 struct inode *dir = mapping->host; exofs_commit_chunk() local
69 dir->i_version++; exofs_commit_chunk()
74 if (pos+len > dir->i_size) { exofs_commit_chunk()
75 i_size_write(dir, pos+len); exofs_commit_chunk()
76 mark_inode_dirty(dir); exofs_commit_chunk()
80 if (IS_DIRSYNC(dir)) exofs_commit_chunk()
90 struct inode *dir = page->mapping->host; exofs_check_page() local
91 unsigned chunk_size = exofs_chunk_size(dir); exofs_check_page()
99 if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) { exofs_check_page()
100 limit = dir->i_size & ~PAGE_CACHE_MASK; exofs_check_page()
128 dir->i_ino exofs_check_page()
147 dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs, exofs_check_page()
156 dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs, exofs_check_page()
163 static struct page *exofs_get_page(struct inode *dir, unsigned long n) exofs_get_page() argument
165 struct address_space *mapping = dir->i_mapping; exofs_get_page()
309 struct exofs_dir_entry *exofs_find_entry(struct inode *dir, exofs_find_entry() argument
316 unsigned long npages = dir_pages(dir); exofs_find_entry()
318 struct exofs_i_info *oi = exofs_i(dir); exofs_find_entry()
332 page = exofs_get_page(dir, n); exofs_find_entry()
336 kaddr += exofs_last_byte(dir, n) - reclen; exofs_find_entry()
341 dir->i_ino); exofs_find_entry()
363 struct exofs_dir_entry *exofs_dotdot(struct inode *dir, struct page **p) exofs_dotdot() argument
365 struct page *page = exofs_get_page(dir, 0); exofs_dotdot()
391 ino_t exofs_inode_by_name(struct inode *dir, struct dentry *dentry) exofs_inode_by_name() argument
397 de = exofs_find_entry(dir, dentry, &page); exofs_inode_by_name()
405 int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de, exofs_set_link() argument
425 dir->i_mtime = dir->i_ctime = CURRENT_TIME; exofs_set_link()
426 mark_inode_dirty(dir); exofs_set_link()
432 struct inode *dir = d_inode(dentry->d_parent); exofs_add_link() local
435 unsigned chunk_size = exofs_chunk_size(dir); exofs_add_link()
441 unsigned long npages = dir_pages(dir); exofs_add_link()
450 page = exofs_get_page(dir, n); exofs_add_link()
456 dir_end = kaddr + exofs_last_byte(dir, n); exofs_add_link()
512 dir->i_mtime = dir->i_ctime = CURRENT_TIME; exofs_add_link()
513 mark_inode_dirty(dir); exofs_add_link()
525 int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page) exofs_delete_entry() argument
531 unsigned from = ((char *)dir - kaddr) & ~(exofs_chunk_size(inode)-1); exofs_delete_entry()
532 unsigned to = ((char *)dir - kaddr) + le16_to_cpu(dir->rec_len); exofs_delete_entry()
538 while (de < dir) { exofs_delete_entry()
560 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
86 inode = exofs_new_inode(dir, mode); exofs_mknod()
96 static int exofs_symlink(struct inode *dir, struct dentry *dentry, exofs_symlink() argument
99 struct super_block *sb = dir->i_sb; exofs_symlink()
108 inode = exofs_new_inode(dir, S_IFLNK | S_IRWXUGO); exofs_symlink()
141 static int exofs_link(struct dentry *old_dentry, struct inode *dir, exofs_link() argument
153 static int exofs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) exofs_mkdir() argument
158 inode_inc_link_count(dir); exofs_mkdir()
160 inode = exofs_new_inode(dir, S_IFDIR | mode); exofs_mkdir()
171 err = exofs_make_empty(inode, dir); exofs_mkdir()
188 inode_dec_link_count(dir); exofs_mkdir()
192 static int exofs_unlink(struct inode *dir, struct dentry *dentry) exofs_unlink() argument
199 de = exofs_find_entry(dir, dentry, &page); exofs_unlink()
207 inode->i_ctime = dir->i_ctime; exofs_unlink()
214 static int exofs_rmdir(struct inode *dir, struct dentry *dentry) exofs_rmdir() argument
220 err = exofs_unlink(dir, dentry); exofs_rmdir()
224 inode_dec_link_count(dir); exofs_rmdir()
/linux-4.1.27/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.1.27/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.1.27/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.1.27/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()
484 ocfs2_error(dir->i_sb, ocfs2_check_dir_trailer()
493 ocfs2_error(dir->i_sb, ocfs2_check_dir_trailer()
501 OCFS2_I(dir)->ip_blkno) { ocfs2_check_dir_trailer()
503 ocfs2_error(dir->i_sb, ocfs2_check_dir_trailer()
508 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_check_dir_trailer()
559 static int ocfs2_read_dir_block_direct(struct inode *dir, u64 phys, ocfs2_read_dir_block_direct() argument
565 ret = ocfs2_read_block(INODE_CACHE(dir), phys, &tmp, ocfs2_read_dir_block_direct()
572 if (ocfs2_supports_dir_trailer(dir)) { ocfs2_read_dir_block_direct()
573 ret = ocfs2_check_dir_trailer(dir, tmp); ocfs2_read_dir_block_direct()
601 "Checksum failed for dir index root block %llu\n", ocfs2_validate_dx_root()
617 static int ocfs2_read_dx_root(struct inode *dir, struct ocfs2_dinode *di, ocfs2_read_dx_root() argument
624 ret = ocfs2_read_block(INODE_CACHE(dir), blkno, &tmp, ocfs2_read_dx_root()
645 "Checksum failed for dir index leaf block %llu\n", ocfs2_validate_dx_leaf()
659 static int ocfs2_read_dx_leaf(struct inode *dir, u64 blkno, ocfs2_read_dx_leaf() argument
665 ret = ocfs2_read_block(INODE_CACHE(dir), blkno, &tmp, ocfs2_read_dx_leaf()
679 static int ocfs2_read_dx_leaves(struct inode *dir, u64 start, int num, ocfs2_read_dx_leaves() argument
684 ret = ocfs2_read_blocks(INODE_CACHE(dir), start, num, dx_leaf_bhs, 0, ocfs2_read_dx_leaves()
693 struct inode *dir, ocfs2_find_entry_el()
707 sb = dir->i_sb; ocfs2_find_entry_el()
709 nblocks = i_size_read(dir) >> sb->s_blocksize_bits; ocfs2_find_entry_el()
710 start = OCFS2_I(dir)->ip_dir_start_lookup; ocfs2_find_entry_el()
737 err = ocfs2_read_dir_block(dir, b++, &bh, ocfs2_find_entry_el()
744 if (ocfs2_read_dir_block(dir, block, &bh, 0)) { ocfs2_find_entry_el()
749 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_find_entry_el()
753 i = ocfs2_search_dirblock(bh, dir, name, namelen, ocfs2_find_entry_el()
758 OCFS2_I(dir)->ip_dir_start_lookup = block; ocfs2_find_entry_el()
776 nblocks = i_size_read(dir) >> sb->s_blocksize_bits; ocfs2_find_entry_el()
919 struct inode *dir, ocfs2_dx_dir_search()
934 ocfs2_dx_dir_name_hash(dir, name, namelen, &res->dl_hinfo); ocfs2_dx_dir_search()
943 ret = ocfs2_dx_dir_lookup(dir, dr_el, hinfo, NULL, &phys); ocfs2_dx_dir_search()
949 trace_ocfs2_dx_dir_search((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_search()
953 ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh); ocfs2_dx_dir_search()
983 ret = ocfs2_read_dir_block_direct(dir, ocfs2_dx_dir_search()
996 found = ocfs2_search_dirblock(dir_ent_bh, dir, name, namelen, ocfs2_dx_dir_search()
998 dir->i_sb->s_blocksize, &dir_ent); ocfs2_dx_dir_search()
1033 struct inode *dir, ocfs2_find_entry_dx()
1042 ret = ocfs2_read_inode_block(dir, &di_bh); ocfs2_find_entry_dx()
1050 ret = ocfs2_read_dx_root(dir, di, &dx_root_bh); ocfs2_find_entry_dx()
1057 ret = ocfs2_dx_dir_search(name, namelen, dir, dx_root, lookup); ocfs2_find_entry_dx()
1073 * Try to find an entry of the provided name within 'dir'.
1087 struct inode *dir, struct ocfs2_dir_lookup_result *lookup) ocfs2_find_entry()
1092 if (ocfs2_dir_indexed(dir)) ocfs2_find_entry()
1093 return ocfs2_find_entry_dx(name, namelen, dir, lookup); ocfs2_find_entry()
1096 * The unindexed dir code only uses part of the lookup ocfs2_find_entry()
1100 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) ocfs2_find_entry()
1101 bh = ocfs2_find_entry_id(name, namelen, dir, &res_dir); ocfs2_find_entry()
1103 bh = ocfs2_find_entry_el(name, namelen, dir, &res_dir); ocfs2_find_entry()
1116 int ocfs2_update_entry(struct inode *dir, handle_t *handle, ocfs2_update_entry() argument
1131 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) ocfs2_update_entry()
1134 ret = access(handle, INODE_CACHE(dir), de_bh, ocfs2_update_entry()
1154 static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir, __ocfs2_delete_entry() argument
1163 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) __ocfs2_delete_entry()
1170 if (!ocfs2_check_dir_entry(dir, de, bh, i)) { __ocfs2_delete_entry()
1176 status = access(handle, INODE_CACHE(dir), bh, __ocfs2_delete_entry()
1187 dir->i_version++; __ocfs2_delete_entry()
1258 static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir, ocfs2_delete_entry_dx() argument
1299 (unsigned long long)OCFS2_I(dir)->ip_blkno, index, ocfs2_delete_entry_dx()
1309 trailer = ocfs2_trailer_from_bh(leaf_bh, dir->i_sb); ocfs2_delete_entry_dx()
1324 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_delete_entry_dx()
1332 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), ocfs2_delete_entry_dx()
1341 trace_ocfs2_delete_entry_dx((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_delete_entry_dx()
1344 ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry, ocfs2_delete_entry_dx()
1351 max_rec_len = ocfs2_find_max_rec_len(dir->i_sb, leaf_bh); ocfs2_delete_entry_dx()
1375 struct inode *dir, ocfs2_delete_entry_id()
1384 ret = ocfs2_read_inode_block(dir, &di_bh); ocfs2_delete_entry_id()
1393 ret = __ocfs2_delete_entry(handle, dir, de_del, bh, data->id_data, ocfs2_delete_entry_id()
1394 i_size_read(dir)); ocfs2_delete_entry_id()
1402 struct inode *dir, ocfs2_delete_entry_el()
1406 return __ocfs2_delete_entry(handle, dir, de_del, bh, bh->b_data, ocfs2_delete_entry_el()
1415 struct inode *dir, ocfs2_delete_entry()
1418 if (ocfs2_dir_indexed(dir)) ocfs2_delete_entry()
1419 return ocfs2_delete_entry_dx(handle, dir, res); ocfs2_delete_entry()
1421 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) ocfs2_delete_entry()
1422 return ocfs2_delete_entry_id(handle, dir, res->dl_entry, ocfs2_delete_entry()
1425 return ocfs2_delete_entry_el(handle, dir, res->dl_entry, ocfs2_delete_entry()
1483 static int __ocfs2_dx_dir_leaf_insert(struct inode *dir, handle_t *handle, __ocfs2_dx_dir_leaf_insert() argument
1491 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), dx_leaf_bh, __ocfs2_dx_dir_leaf_insert()
1506 static void ocfs2_dx_inline_root_insert(struct inode *dir, handle_t *handle, ocfs2_dx_inline_root_insert() argument
1514 static int ocfs2_dx_dir_insert(struct inode *dir, handle_t *handle, ocfs2_dx_dir_insert() argument
1521 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_dx_dir_insert()
1530 ocfs2_dx_inline_root_insert(dir, handle, ocfs2_dx_dir_insert()
1535 ret = __ocfs2_dx_dir_leaf_insert(dir, handle, &lookup->dl_hinfo, ocfs2_dx_dir_insert()
1549 static void ocfs2_remove_block_from_free_list(struct inode *dir, ocfs2_remove_block_from_free_list() argument
1557 trailer = ocfs2_trailer_from_bh(lookup->dl_leaf_bh, dir->i_sb); ocfs2_remove_block_from_free_list()
1565 prev = ocfs2_trailer_from_bh(bh, dir->i_sb); ocfs2_remove_block_from_free_list()
1580 static void ocfs2_recalc_free_list(struct inode *dir, handle_t *handle, ocfs2_recalc_free_list() argument
1587 max_rec_len = ocfs2_find_max_rec_len(dir->i_sb, lookup->dl_leaf_bh); ocfs2_recalc_free_list()
1594 trailer = ocfs2_trailer_from_bh(lookup->dl_leaf_bh, dir->i_sb); ocfs2_recalc_free_list()
1598 ocfs2_remove_block_from_free_list(dir, handle, lookup); ocfs2_recalc_free_list()
1603 * like orphan dir can call this instead.
1609 struct inode *dir, __ocfs2_add_entry()
1619 struct super_block *sb = dir->i_sb; __ocfs2_add_entry()
1628 if (ocfs2_dir_indexed(dir)) { __ocfs2_add_entry()
1632 * An indexed dir may require that we update the free space __ocfs2_add_entry()
1642 INODE_CACHE(dir), bh, __ocfs2_add_entry()
1647 INODE_CACHE(dir), bh, __ocfs2_add_entry()
1654 } else if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { __ocfs2_add_entry()
1656 size = i_size_read(dir); __ocfs2_add_entry()
1670 if (!ocfs2_check_dir_entry(dir, de, insert_bh, offset)) { __ocfs2_add_entry()
1681 mlog_bug_on_msg(ocfs2_skip_dir_trailer(dir, de, offset, size), __ocfs2_add_entry()
1682 "Hit dir trailer trying to insert %.*s " __ocfs2_add_entry()
1687 offset, ocfs2_dir_trailer_blk_off(dir->i_sb)); __ocfs2_add_entry()
1690 dir->i_mtime = dir->i_ctime = CURRENT_TIME; __ocfs2_add_entry()
1691 retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); __ocfs2_add_entry()
1699 INODE_CACHE(dir), __ocfs2_add_entry()
1704 INODE_CACHE(dir), __ocfs2_add_entry()
1708 if (ocfs2_dir_indexed(dir)) { __ocfs2_add_entry()
1709 status = ocfs2_dx_dir_insert(dir, __ocfs2_add_entry()
1739 if (ocfs2_dir_indexed(dir)) __ocfs2_add_entry()
1740 ocfs2_recalc_free_list(dir, handle, lookup); __ocfs2_add_entry()
1742 dir->i_version++; __ocfs2_add_entry()
1775 mlog(ML_ERROR, "Unable to read inode block for dir %llu\n", ocfs2_dir_foreach_blk_id()
1784 /* If the dir block has changed since the last call to ocfs2_dir_foreach_blk_id()
1878 /* If the dir block has changed since the last call to ocfs2_dir_foreach_blk_el()
1998 * NOTE: this should always be called with parent dir i_mutex taken.
2027 int ocfs2_lookup_ino_from_name(struct inode *dir, const char *name, ocfs2_lookup_ino_from_name() argument
2033 ret = ocfs2_find_files_on_disk(name, namelen, blkno, dir, &lookup); ocfs2_lookup_ino_from_name()
2044 * Callers should have i_mutex + a cluster lock on dir
2046 int ocfs2_check_dir_for_entry(struct inode *dir, ocfs2_check_dir_for_entry() argument
2054 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); ocfs2_check_dir_for_entry()
2056 if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) { ocfs2_check_dir_for_entry()
2147 * Returns 1 if dir is empty, zero otherwise.
2173 mlog(ML_ERROR, "bad directory (dir #%llu) - no `.' or `..'\n", ocfs2_empty_dir()
2321 handle_t *handle, struct inode *dir, ocfs2_dx_dir_attach_index()
2336 ocfs2_trailer_from_bh(dirdata_bh, dir->i_sb); ocfs2_dx_dir_attach_index()
2346 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_attach_index()
2354 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), dx_root_bh); ocfs2_dx_dir_attach_index()
2356 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_dx_dir_attach_index()
2371 dx_root->dr_dir_blkno = cpu_to_le64(OCFS2_I(dir)->ip_blkno); ocfs2_dx_dir_attach_index()
2388 ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, ocfs2_dx_dir_attach_index()
2397 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_attach_index()
2398 OCFS2_I(dir)->ip_dyn_features |= OCFS2_INDEXED_DIR_FL; ocfs2_dx_dir_attach_index()
2399 di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features); ocfs2_dx_dir_attach_index()
2400 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_attach_index()
2413 handle_t *handle, struct inode *dir, ocfs2_dx_dir_format_cluster()
2429 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), bh); ocfs2_dx_dir_format_cluster()
2431 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), bh, ocfs2_dx_dir_format_cluster()
2448 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_format_cluster()
2461 * Allocates and formats a new cluster for use in an indexed dir
2465 static int __ocfs2_dx_dir_new_cluster(struct inode *dir, __ocfs2_dx_dir_new_cluster() argument
2474 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); __ocfs2_dx_dir_new_cluster()
2493 ret = ocfs2_dx_dir_format_cluster(osb, handle, dir, dx_leaves, __ocfs2_dx_dir_new_cluster()
2505 static int ocfs2_dx_dir_new_cluster(struct inode *dir, ocfs2_dx_dir_new_cluster() argument
2516 ret = __ocfs2_dx_dir_new_cluster(dir, cpos, handle, data_ac, dx_leaves, ocfs2_dx_dir_new_cluster()
2622 static int ocfs2_dx_dir_index_block(struct inode *dir, ocfs2_dx_dir_index_block() argument
2637 limit = de_buf + dir->i_sb->s_blocksize; ocfs2_dx_dir_index_block()
2646 ocfs2_dx_dir_name_hash(dir, de->name, namelen, &hinfo); ocfs2_dx_dir_index_block()
2648 i = ocfs2_dx_dir_hash_idx(OCFS2_SB(dir->i_sb), &hinfo); ocfs2_dx_dir_index_block()
2651 ret = __ocfs2_dx_dir_leaf_insert(dir, handle, &hinfo, ocfs2_dx_dir_index_block()
2671 static void ocfs2_dx_dir_index_root_block(struct inode *dir, ocfs2_dx_dir_index_root_block() argument
2684 limit = de_buf + dir->i_sb->s_blocksize; ocfs2_dx_dir_index_root_block()
2692 ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo); ocfs2_dx_dir_index_root_block()
2695 (unsigned long long)dir->i_ino, ocfs2_dx_dir_index_root_block()
2714 static int ocfs2_new_dx_should_be_inline(struct inode *dir, ocfs2_new_dx_should_be_inline() argument
2723 limit = de_buf + i_size_read(dir); ocfs2_new_dx_should_be_inline()
2735 return dirent_count < ocfs2_dx_entries_per_root(dir->i_sb); ocfs2_new_dx_should_be_inline()
2741 * expansion from an inline directory to one with extents. The first dir block
2747 * accounting. We do this here since we're already walking the entire dir
2750 * We add the dir trailer if this filesystem wants it.
2753 struct inode *dir) ocfs2_expand_last_dirent()
2755 struct super_block *sb = dir->i_sb; ocfs2_expand_last_dirent()
2763 if (ocfs2_new_dir_wants_trailer(dir)) ocfs2_expand_last_dirent()
2802 static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, ocfs2_expand_inline_dir() argument
2808 struct super_block *sb = dir->i_sb; ocfs2_expand_inline_dir()
2813 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_expand_inline_dir()
2814 struct ocfs2_inode_info *oi = OCFS2_I(dir); ocfs2_expand_inline_dir()
2826 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(dir), di_bh); ocfs2_expand_inline_dir()
2836 dx_inline = ocfs2_new_dx_should_be_inline(dir, di_bh); ocfs2_expand_inline_dir()
2887 ret = dquot_alloc_space_nodirty(dir, ocfs2_expand_inline_dir()
2899 ret = __ocfs2_dx_dir_new_cluster(dir, 0, handle, data_ac, ocfs2_expand_inline_dir()
2906 bytes_allocated += ocfs2_clusters_to_bytes(dir->i_sb, 1); ocfs2_expand_inline_dir()
2921 bytes_allocated += ocfs2_clusters_to_bytes(dir->i_sb, 1); ocfs2_expand_inline_dir()
2928 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off); ocfs2_expand_inline_dir()
2936 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), dirdata_bh); ocfs2_expand_inline_dir()
2938 ret = ocfs2_journal_access_db(handle, INODE_CACHE(dir), dirdata_bh, ocfs2_expand_inline_dir()
2945 memcpy(dirdata_bh->b_data, di->id2.i_data.id_data, i_size_read(dir)); ocfs2_expand_inline_dir()
2946 memset(dirdata_bh->b_data + i_size_read(dir), 0, ocfs2_expand_inline_dir()
2947 sb->s_blocksize - i_size_read(dir)); ocfs2_expand_inline_dir()
2948 i = ocfs2_expand_last_dirent(dirdata_bh->b_data, i_size_read(dir), dir); ocfs2_expand_inline_dir()
2949 if (ocfs2_new_dir_wants_trailer(dir)) { ocfs2_expand_inline_dir()
2951 * Prepare the dir trailer up front. It will otherwise look ocfs2_expand_inline_dir()
2953 * (unlikely), then all we'll have done is given first dir ocfs2_expand_inline_dir()
2956 ocfs2_init_dir_trailer(dir, dirdata_bh, i); ocfs2_expand_inline_dir()
2959 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_expand_inline_dir()
2971 ret = ocfs2_dx_dir_index_block(dir, handle, dx_leaves, ocfs2_expand_inline_dir()
2988 ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, ocfs2_expand_inline_dir()
3000 ocfs2_dinode_new_extent_list(dir, di); ocfs2_expand_inline_dir()
3002 i_size_write(dir, sb->s_blocksize); ocfs2_expand_inline_dir()
3003 dir->i_mtime = dir->i_ctime = CURRENT_TIME; ocfs2_expand_inline_dir()
3006 di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec); ocfs2_expand_inline_dir()
3007 di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec); ocfs2_expand_inline_dir()
3008 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_expand_inline_dir()
3025 dir->i_blocks = ocfs2_inode_sector_count(dir); ocfs2_expand_inline_dir()
3030 ret = ocfs2_dx_dir_attach_index(osb, handle, dir, di_bh, ocfs2_expand_inline_dir()
3039 ocfs2_dx_dir_index_root_block(dir, dx_root_bh, ocfs2_expand_inline_dir()
3043 INODE_CACHE(dir), ocfs2_expand_inline_dir()
3063 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off); ocfs2_expand_inline_dir()
3071 bytes_allocated += ocfs2_clusters_to_bytes(dir->i_sb, 1); ocfs2_expand_inline_dir()
3084 off = ocfs2_dx_dir_hash_idx(OCFS2_SB(dir->i_sb), ocfs2_expand_inline_dir()
3095 dquot_free_space_nodirty(dir, bytes_allocated); ocfs2_expand_inline_dir()
3121 struct inode *dir, ocfs2_do_extend_dir()
3131 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_do_extend_dir()
3132 extend = (i_size_read(dir) == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)); ocfs2_do_extend_dir()
3133 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_do_extend_dir()
3136 u32 offset = OCFS2_I(dir)->ip_clusters; ocfs2_do_extend_dir()
3138 status = dquot_alloc_space_nodirty(dir, ocfs2_do_extend_dir()
3144 status = ocfs2_add_inode_data(OCFS2_SB(sb), dir, &offset, ocfs2_do_extend_dir()
3154 v_blkno = ocfs2_blocks_for_bytes(sb, i_size_read(dir)); ocfs2_do_extend_dir()
3155 status = ocfs2_extent_map_get_blocks(dir, v_blkno, &p_blkno, NULL, NULL); ocfs2_do_extend_dir()
3170 dquot_free_space_nodirty(dir, ocfs2_clusters_to_bytes(sb, 1)); ocfs2_do_extend_dir()
3185 struct inode *dir, ocfs2_extend_dir()
3205 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { ocfs2_extend_dir()
3212 status = ocfs2_expand_inline_dir(dir, parent_fe_bh, ocfs2_extend_dir()
3243 down_write(&OCFS2_I(dir)->ip_alloc_sem); ocfs2_extend_dir()
3245 dir_i_size = i_size_read(dir); ocfs2_extend_dir()
3250 down_write(&OCFS2_I(dir)->ip_alloc_sem); ocfs2_extend_dir()
3252 dir_i_size = i_size_read(dir); ocfs2_extend_dir()
3253 trace_ocfs2_extend_dir((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_extend_dir()
3256 /* dir->i_size is always block aligned. */ ocfs2_extend_dir()
3257 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_extend_dir()
3258 if (dir_i_size == ocfs2_clusters_to_bytes(sb, OCFS2_I(dir)->ip_clusters)) { ocfs2_extend_dir()
3259 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_extend_dir()
3260 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(dir), ocfs2_extend_dir()
3286 data_ac->ac_resv = &OCFS2_I(dir)->ip_la_data_resv; ocfs2_extend_dir()
3290 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_extend_dir()
3295 if (ocfs2_dir_indexed(dir)) ocfs2_extend_dir()
3307 status = ocfs2_do_extend_dir(osb->sb, handle, dir, parent_fe_bh, ocfs2_extend_dir()
3314 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), new_bh); ocfs2_extend_dir()
3316 status = ocfs2_journal_access_db(handle, INODE_CACHE(dir), new_bh, ocfs2_extend_dir()
3326 if (ocfs2_supports_dir_trailer(dir)) { ocfs2_extend_dir()
3329 ocfs2_init_dir_trailer(dir, new_bh, le16_to_cpu(de->rec_len)); ocfs2_extend_dir()
3331 if (ocfs2_dir_indexed(dir)) { ocfs2_extend_dir()
3332 status = ocfs2_dx_dir_link_trailer(dir, handle, ocfs2_extend_dir()
3342 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_extend_dir()
3345 dir_i_size += dir->i_sb->s_blocksize; ocfs2_extend_dir()
3346 i_size_write(dir, dir_i_size); ocfs2_extend_dir()
3347 dir->i_blocks = ocfs2_inode_sector_count(dir); ocfs2_extend_dir()
3348 status = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); ocfs2_extend_dir()
3361 up_write(&OCFS2_I(dir)->ip_alloc_sem); ocfs2_extend_dir()
3373 static int ocfs2_find_dir_space_id(struct inode *dir, struct buffer_head *di_bh, ocfs2_find_dir_space_id() argument
3379 struct super_block *sb = dir->i_sb; ocfs2_find_dir_space_id()
3384 unsigned int rec_len, new_rec_len, free_space = dir->i_sb->s_blocksize; ocfs2_find_dir_space_id()
3390 if (ocfs2_new_dir_wants_trailer(dir)) ocfs2_find_dir_space_id()
3391 free_space = ocfs2_dir_trailer_blk_off(sb) - i_size_read(dir); ocfs2_find_dir_space_id()
3393 free_space = dir->i_sb->s_blocksize - i_size_read(dir); ocfs2_find_dir_space_id()
3396 limit = de_buf + i_size_read(dir); ocfs2_find_dir_space_id()
3402 if (!ocfs2_check_dir_entry(dir, de, di_bh, offset)) { ocfs2_find_dir_space_id()
3444 static int ocfs2_find_dir_space_el(struct inode *dir, const char *name, ocfs2_find_dir_space_el() argument
3451 struct super_block *sb = dir->i_sb; ocfs2_find_dir_space_el()
3453 int blocksize = dir->i_sb->s_blocksize; ocfs2_find_dir_space_el()
3455 status = ocfs2_read_dir_block(dir, 0, &bh, 0); ocfs2_find_dir_space_el()
3467 if (i_size_read(dir) <= offset) { ocfs2_find_dir_space_el()
3475 status = ocfs2_read_dir_block(dir, ocfs2_find_dir_space_el()
3484 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { ocfs2_find_dir_space_el()
3493 if (ocfs2_skip_dir_trailer(dir, de, offset % blocksize, ocfs2_find_dir_space_el()
3668 static void ocfs2_dx_dir_transfer_leaf(struct inode *dir, u32 split_hash, ocfs2_dx_dir_transfer_leaf() argument
3691 memcpy(tmp_dx_leaf, orig_dx_leaf, dir->i_sb->s_blocksize); ocfs2_dx_dir_transfer_leaf()
3705 memcpy(orig_dx_leaf, tmp_dx_leaf, dir->i_sb->s_blocksize); ocfs2_dx_dir_transfer_leaf()
3726 static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, ocfs2_dx_dir_rebalance() argument
3745 trace_ocfs2_dx_dir_rebalance((unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_rebalance()
3749 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_dx_dir_rebalance()
3762 "%llu, %d\n", (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_dx_dir_rebalance()
3782 ret = ocfs2_lock_allocators(dir, &et, 1, 0, &data_ac, &meta_ac); ocfs2_dx_dir_rebalance()
3798 ret = dquot_alloc_space_nodirty(dir, ocfs2_dx_dir_rebalance()
3799 ocfs2_clusters_to_bytes(dir->i_sb, 1)); ocfs2_dx_dir_rebalance()
3804 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), dx_leaf_bh, ocfs2_dx_dir_rebalance()
3854 orig_leaves_start = ocfs2_block_to_cluster_start(dir->i_sb, leaf_blkno); ocfs2_dx_dir_rebalance()
3855 ret = ocfs2_read_dx_leaves(dir, orig_leaves_start, num_dx_leaves, ocfs2_dx_dir_rebalance()
3863 ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle, ocfs2_dx_dir_rebalance()
3872 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), ocfs2_dx_dir_rebalance()
3880 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), ocfs2_dx_dir_rebalance()
3889 ocfs2_dx_dir_transfer_leaf(dir, split_hash, handle, tmp_dx_leaf, ocfs2_dx_dir_rebalance()
3894 dquot_free_space_nodirty(dir, ocfs2_dx_dir_rebalance()
3895 ocfs2_clusters_to_bytes(dir->i_sb, 1)); ocfs2_dx_dir_rebalance()
3897 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_dx_dir_rebalance()
3921 static int ocfs2_find_dir_space_dx(struct ocfs2_super *osb, struct inode *dir, ocfs2_find_dir_space_dx() argument
3937 ret = ocfs2_dx_dir_lookup(dir, &dx_root->dr_list, &lookup->dl_hinfo, ocfs2_find_dir_space_dx()
3944 ret = ocfs2_read_dx_leaf(dir, blkno, &dx_leaf_bh); ocfs2_find_dir_space_dx()
3966 ret = ocfs2_dx_dir_rebalance(osb, dir, dx_root_bh, dx_leaf_bh, ocfs2_find_dir_space_dx()
3994 static int ocfs2_search_dx_free_list(struct inode *dir, ocfs2_search_dx_free_list() argument
4014 ret = ocfs2_read_dir_block_direct(dir, next_block, &leaf_bh); ocfs2_search_dx_free_list()
4020 db = ocfs2_trailer_from_bh(leaf_bh, dir->i_sb); ocfs2_search_dx_free_list()
4042 static int ocfs2_expand_inline_dx_root(struct inode *dir, ocfs2_expand_inline_dx_root() argument
4050 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_expand_inline_dx_root()
4077 ret = dquot_alloc_space_nodirty(dir, ocfs2_expand_inline_dx_root()
4088 ret = ocfs2_journal_access_dr(handle, INODE_CACHE(dir), dx_root_bh, ocfs2_expand_inline_dx_root()
4095 ret = __ocfs2_dx_dir_new_cluster(dir, 0, handle, data_ac, dx_leaves, ocfs2_expand_inline_dx_root()
4130 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_expand_inline_dx_root()
4136 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_expand_inline_dx_root()
4141 dquot_free_space_nodirty(dir, ocfs2_expand_inline_dx_root()
4142 ocfs2_clusters_to_bytes(dir->i_sb, 1)); ocfs2_expand_inline_dx_root()
4173 static int ocfs2_prepare_dx_dir_for_insert(struct inode *dir, ocfs2_prepare_dx_dir_for_insert() argument
4180 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_prepare_dx_dir_for_insert()
4186 ret = ocfs2_read_dx_root(dir, di, &dx_root_bh); ocfs2_prepare_dx_dir_for_insert()
4210 ret = ocfs2_expand_inline_dx_root(dir, dx_root_bh); ocfs2_prepare_dx_dir_for_insert()
4223 ret = ocfs2_find_dir_space_dx(osb, dir, di_bh, dx_root_bh, name, ocfs2_prepare_dx_dir_for_insert()
4237 ret = ocfs2_search_dx_free_list(dir, dx_root_bh, namelen, lookup); ocfs2_prepare_dx_dir_for_insert()
4248 ret = ocfs2_extend_dir(osb, dir, di_bh, 1, lookup, &leaf_bh); ocfs2_prepare_dx_dir_for_insert()
4271 * happens here. Success returns zero, and enough context in the dir
4276 struct inode *dir, ocfs2_prepare_dir_for_insert()
4287 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen); ocfs2_prepare_dir_for_insert()
4307 ocfs2_dx_dir_name_hash(dir, name, namelen, &lookup->dl_hinfo); ocfs2_prepare_dir_for_insert()
4309 if (ocfs2_dir_indexed(dir)) { ocfs2_prepare_dir_for_insert()
4310 ret = ocfs2_prepare_dx_dir_for_insert(dir, parent_fe_bh, ocfs2_prepare_dir_for_insert()
4317 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { ocfs2_prepare_dir_for_insert()
4318 ret = ocfs2_find_dir_space_id(dir, parent_fe_bh, name, ocfs2_prepare_dir_for_insert()
4321 ret = ocfs2_find_dir_space_el(dir, name, namelen, &bh); ocfs2_prepare_dir_for_insert()
4334 ret = ocfs2_extend_dir(osb, dir, parent_fe_bh, blocks_wanted, ocfs2_prepare_dir_for_insert()
4352 static int ocfs2_dx_dir_remove_index(struct inode *dir, ocfs2_dx_dir_remove_index() argument
4357 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_dx_dir_remove_index()
4392 ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, ocfs2_dx_dir_remove_index()
4399 spin_lock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_remove_index()
4400 OCFS2_I(dir)->ip_dyn_features &= ~OCFS2_INDEXED_DIR_FL; ocfs2_dx_dir_remove_index()
4401 di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features); ocfs2_dx_dir_remove_index()
4402 spin_unlock(&OCFS2_I(dir)->ip_lock); ocfs2_dx_dir_remove_index()
4404 ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_dx_dir_remove_index()
4433 int ocfs2_dx_dir_truncate(struct inode *dir, struct buffer_head *di_bh) ocfs2_dx_dir_truncate() argument
4439 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_dx_dir_truncate()
4448 if (!ocfs2_dir_indexed(dir)) ocfs2_dx_dir_truncate()
4451 ret = ocfs2_read_dx_root(dir, di, &dx_root_bh); ocfs2_dx_dir_truncate()
4461 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_dx_dir_truncate()
4465 ret = ocfs2_dx_dir_lookup_rec(dir, &dx_root->dr_list, ocfs2_dx_dir_truncate()
4472 p_cpos = ocfs2_blocks_to_clusters(dir->i_sb, blkno); ocfs2_dx_dir_truncate()
4474 ret = ocfs2_remove_btree_range(dir, &et, cpos, p_cpos, clen, 0, ocfs2_dx_dir_truncate()
4488 ret = ocfs2_dx_dir_remove_index(dir, di_bh, dx_root_bh); ocfs2_dx_dir_truncate()
4494 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
692 ocfs2_find_entry_el(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_entry **res_dir) ocfs2_find_entry_el() argument
918 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
1032 ocfs2_find_entry_dx(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_lookup_result *lookup) ocfs2_find_entry_dx() argument
1086 ocfs2_find_entry(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_lookup_result *lookup) ocfs2_find_entry() argument
1374 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
1401 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
1414 ocfs2_delete_entry(handle_t *handle, struct inode *dir, struct ocfs2_dir_lookup_result *res) ocfs2_delete_entry() argument
1608 __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
2320 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
2412 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
2752 ocfs2_expand_last_dirent(char *start, unsigned int old_size, struct inode *dir) ocfs2_expand_last_dirent() argument
3119 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
3184 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
4275 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 */
112 static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, ocfs2_lookup() argument
121 trace_ocfs2_lookup(dir, dentry, dentry->d_name.len, ocfs2_lookup()
123 (unsigned long long)OCFS2_I(dir)->ip_blkno, 0); ocfs2_lookup()
130 status = ocfs2_inode_lock_nested(dir, NULL, 0, OI_LS_PARENT); ocfs2_lookup()
138 status = ocfs2_lookup_ino_from_name(dir, dentry->d_name.name, ocfs2_lookup()
143 inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0, 0); ocfs2_lookup()
177 OCFS2_I(dir)->ip_blkno); ocfs2_lookup()
191 ocfs2_inode_unlock(dir, 0); ocfs2_lookup()
200 static struct inode *ocfs2_get_init_inode(struct inode *dir, umode_t mode) ocfs2_get_init_inode() argument
204 inode = new_inode(dir->i_sb); ocfs2_get_init_inode()
215 inode_init_owner(inode, dir, mode); ocfs2_get_init_inode()
235 static int ocfs2_mknod(struct inode *dir, ocfs2_mknod() argument
262 trace_ocfs2_mknod(dir, dentry, dentry->d_name.len, dentry->d_name.name, ocfs2_mknod()
263 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_mknod()
266 dquot_initialize(dir); ocfs2_mknod()
269 osb = OCFS2_SB(dir->i_sb); ocfs2_mknod()
271 status = ocfs2_inode_lock(dir, &parent_fe_bh, 1); ocfs2_mknod()
278 if (S_ISDIR(mode) && (dir->i_nlink >= ocfs2_link_max(osb))) { ocfs2_mknod()
290 status = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_mknod()
295 /* get a spot inside the dir. */ ocfs2_mknod()
296 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, ocfs2_mknod()
312 inode = ocfs2_get_init_inode(dir, mode); ocfs2_mknod()
320 status = ocfs2_init_security_get(inode, dir, &dentry->d_name, &si); ocfs2_mknod()
331 status = ocfs2_calc_xattr_init(dir, parent_fe_bh, mode, ocfs2_mknod()
382 status = ocfs2_mknod_locked(osb, dir, inode, dev, ocfs2_mknod()
391 status = ocfs2_fill_new_dir(osb, handle, dir, inode, ocfs2_mknod()
398 status = ocfs2_journal_access_di(handle, INODE_CACHE(dir), ocfs2_mknod()
407 inc_nlink(dir); ocfs2_mknod()
410 status = ocfs2_init_acl(handle, inode, dir, new_fe_bh, parent_fe_bh, ocfs2_mknod()
433 OCFS2_I(dir)->ip_blkno); ocfs2_mknod()
458 ocfs2_inode_unlock(dir, 1); ocfs2_mknod()
497 static int __ocfs2_mknod_locked(struct inode *dir, __ocfs2_mknod_locked() argument
507 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); __ocfs2_mknod_locked()
610 struct inode *dir, ocfs2_mknod_locked()
624 status = ocfs2_claim_new_inode(handle, dir, parent_fe_bh, ocfs2_mknod_locked()
632 return __ocfs2_mknod_locked(dir, inode, dev, new_fe_bh, ocfs2_mknod_locked()
637 static int ocfs2_mkdir(struct inode *dir, ocfs2_mkdir() argument
643 trace_ocfs2_mkdir(dir, dentry, dentry->d_name.len, dentry->d_name.name, ocfs2_mkdir()
644 OCFS2_I(dir)->ip_blkno, mode); ocfs2_mkdir()
645 ret = ocfs2_mknod(dir, dentry, mode | S_IFDIR, 0); ocfs2_mkdir()
652 static int ocfs2_create(struct inode *dir, ocfs2_create() argument
659 trace_ocfs2_create(dir, dentry, dentry->d_name.len, dentry->d_name.name, ocfs2_create()
660 (unsigned long long)OCFS2_I(dir)->ip_blkno, mode); ocfs2_create()
661 ret = ocfs2_mknod(dir, dentry, mode | S_IFREG, 0); ocfs2_create()
669 struct inode *dir, ocfs2_link()
680 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_link()
692 dquot_initialize(dir); ocfs2_link()
695 &parent_fe_bh, dir, 0); ocfs2_link()
715 if (!dir->i_nlink) { ocfs2_link()
736 err = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_link()
741 err = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, ocfs2_link()
797 err = ocfs2_dentry_attach_lock(dentry, inode, OCFS2_I(dir)->ip_blkno); ocfs2_link()
813 ocfs2_double_unlock(old_dir, dir); ocfs2_link()
857 static int ocfs2_unlink(struct inode *dir, ocfs2_unlink() argument
865 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_unlink()
875 trace_ocfs2_unlink(dir, dentry, dentry->d_name.len, ocfs2_unlink()
877 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_unlink()
880 dquot_initialize(dir); ocfs2_unlink()
882 BUG_ON(d_inode(dentry->d_parent) != dir); ocfs2_unlink()
887 status = ocfs2_inode_lock_nested(dir, &parent_node_bh, 1, ocfs2_unlink()
896 dentry->d_name.len, &blkno, dir, ocfs2_unlink()
966 /* delete the name from the parent dir */ ocfs2_unlink()
967 status = ocfs2_delete_entry(handle, dir, &lookup); ocfs2_unlink()
979 dir->i_ctime = dir->i_mtime = CURRENT_TIME; ocfs2_unlink()
981 drop_nlink(dir); ocfs2_unlink()
983 status = ocfs2_mark_inode_dirty(handle, dir, parent_node_bh); ocfs2_unlink()
987 inc_nlink(dir); ocfs2_unlink()
1005 ocfs2_inode_unlock(dir, 1); ocfs2_unlink()
1581 mlog(ML_ERROR, "need to change nlink for old dir " ocfs2_rename()
1746 static int ocfs2_symlink(struct inode *dir, ocfs2_symlink() argument
1774 trace_ocfs2_symlink_begin(dir, dentry, symname, ocfs2_symlink()
1777 dquot_initialize(dir); ocfs2_symlink()
1779 sb = dir->i_sb; ocfs2_symlink()
1787 status = ocfs2_inode_lock(dir, &parent_fe_bh, 1); ocfs2_symlink()
1801 status = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_symlink()
1806 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_fe_bh, ocfs2_symlink()
1821 inode = ocfs2_get_init_inode(dir, S_IFLNK | S_IRWXUGO); ocfs2_symlink()
1829 status = ocfs2_init_security_get(inode, dir, &dentry->d_name, &si); ocfs2_symlink()
1841 status = ocfs2_calc_security_init(dir, &si, &want_clusters, ocfs2_symlink()
1877 trace_ocfs2_symlink_create(dir, dentry, dentry->d_name.len, ocfs2_symlink()
1879 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_symlink()
1882 status = ocfs2_mknod_locked(osb, dir, inode, ocfs2_symlink()
1955 status = ocfs2_dentry_attach_lock(dentry, inode, OCFS2_I(dir)->ip_blkno); ocfs2_symlink()
1982 ocfs2_inode_unlock(dir, 1); ocfs2_symlink()
2120 * @ret_orphan_dir: Orphan dir inode - returned locked!
2121 * @blkno: Actual block number of the inode to be inserted into orphan dir.
2122 * @lookup: dir lookup result, to be passed back into functions like
2248 /* Record which orphan dir our inode now resides ocfs2_orphan_add()
2250 * dir to lock. */ ocfs2_orphan_add()
2272 /* unlike orphan_add, we expect the orphan dir to already be locked here. */ ocfs2_orphan_del()
2348 * ocfs2_prep_new_orphaned_file() - Prepare the orphan dir to receive a newly
2349 * allocated file. This is different from the typical 'add to orphan dir'
2351 * the orphan dir stringifies the inode block number to come up with it's
2355 * @dir: The directory which this inode will ultimately wind up under - not the
2356 * orphan dir!
2357 * @dir_bh: buffer_head the @dir inode block
2359 * with the string to be used for orphan dirent. Pass back to the orphan dir
2361 * @ret_orphan_dir: orphan dir inode returned to be passed back into orphan
2362 * dir code.
2364 * @orphan_insert: Dir insert context to be passed back into orphan dir code.
2372 static int ocfs2_prep_new_orphaned_file(struct inode *dir, ocfs2_prep_new_orphaned_file() argument
2382 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_prep_new_orphaned_file()
2401 ret = ocfs2_find_new_inode_loc(dir, dir_bh, inode_ac, ocfs2_prep_new_orphaned_file()
2430 /* Unroll orphan dir locking */ ocfs2_prep_new_orphaned_file()
2441 int ocfs2_create_inode_in_orphan(struct inode *dir, ocfs2_create_inode_in_orphan() argument
2448 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_create_inode_in_orphan()
2459 status = ocfs2_inode_lock(dir, &parent_di_bh, 1); ocfs2_create_inode_in_orphan()
2466 status = ocfs2_prep_new_orphaned_file(dir, parent_di_bh, ocfs2_create_inode_in_orphan()
2475 inode = ocfs2_get_init_inode(dir, mode); ocfs2_create_inode_in_orphan()
2495 status = ocfs2_claim_new_inode_at_loc(handle, dir, inode_ac, ocfs2_create_inode_in_orphan()
2505 status = __ocfs2_mknod_locked(dir, inode, ocfs2_create_inode_in_orphan()
2522 /* get open lock so that only nodes can't remove it from orphan dir. */ ocfs2_create_inode_in_orphan()
2556 ocfs2_inode_unlock(dir, 1); ocfs2_create_inode_in_orphan()
2741 int ocfs2_mv_orphaned_inode_to_new(struct inode *dir, ocfs2_mv_orphaned_inode_to_new() argument
2748 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); ocfs2_mv_orphaned_inode_to_new()
2755 trace_ocfs2_mv_orphaned_inode_to_new(dir, dentry, ocfs2_mv_orphaned_inode_to_new()
2757 (unsigned long long)OCFS2_I(dir)->ip_blkno, ocfs2_mv_orphaned_inode_to_new()
2760 status = ocfs2_inode_lock(dir, &parent_di_bh, 1); ocfs2_mv_orphaned_inode_to_new()
2774 status = ocfs2_check_dir_for_entry(dir, dentry->d_name.name, ocfs2_mv_orphaned_inode_to_new()
2779 /* get a spot inside the dir. */ ocfs2_mv_orphaned_inode_to_new()
2780 status = ocfs2_prepare_dir_for_insert(osb, dir, parent_di_bh, ocfs2_mv_orphaned_inode_to_new()
2852 OCFS2_I(dir)->ip_blkno); ocfs2_mv_orphaned_inode_to_new()
2868 ocfs2_inode_unlock(dir, 1); ocfs2_mv_orphaned_inode_to_new()
609 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
668 ocfs2_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) ocfs2_link() argument
H A DMakefile18 dir.o \
/linux-4.1.27/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.1.27/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.1.27/fs/ext4/
H A Dnamei.c249 static unsigned dx_root_limit(struct inode *dir, unsigned infosize);
250 static unsigned dx_node_limit(struct inode *dir);
252 struct inode *dir,
256 static int dx_make_map(struct inode *dir, struct ext4_dir_entry_2 *de,
265 static int ext4_htree_next_block(struct inode *dir, __u32 hash,
269 static struct buffer_head * ext4_dx_find_entry(struct inode *dir,
441 EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D."); ext4_dx_csum_verify()
470 EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D."); ext4_dx_csum_set()
548 static inline unsigned dx_root_limit(struct inode *dir, unsigned infosize) dx_root_limit() argument
550 unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(1) - dx_root_limit()
553 if (ext4_has_metadata_csum(dir->i_sb)) dx_root_limit()
558 static inline unsigned dx_node_limit(struct inode *dir) dx_node_limit() argument
560 unsigned entry_space = dir->i_sb->s_blocksize - EXT4_DIR_REC_LEN(0); dx_node_limit()
562 if (ext4_has_metadata_csum(dir->i_sb)) dx_node_limit()
589 static struct stats dx_show_leaf(struct inode *dir, dx_show_leaf() argument
615 ctx = ext4_get_fname_crypto_ctx(dir, dx_show_leaf()
682 struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir, dx_show_entries() argument
685 unsigned blocksize = dir->i_sb->s_blocksize; dx_show_entries()
697 bh = ext4_bread(NULL,dir, block, 0); dx_show_entries()
701 dx_show_entries(hinfo, dir, ((struct dx_node *) bh->b_data)->entries, levels - 1): dx_show_entries()
702 dx_show_leaf(dir, hinfo, (struct ext4_dir_entry_2 *) dx_show_entries()
727 dx_probe(const struct qstr *d_name, struct inode *dir, dx_probe() argument
737 frame->bh = ext4_read_dirblock(dir, 0, INDEX); dx_probe()
745 ext4_warning(dir->i_sb, "Unrecognised inode hash code %d", dx_probe()
751 hinfo->hash_version += EXT4_SB(dir->i_sb)->s_hash_unsigned; dx_probe()
752 hinfo->seed = EXT4_SB(dir->i_sb)->s_hash_seed; dx_probe()
759 ctx = ext4_get_fname_crypto_ctx(dir, EXT4_NAME_LEN); dx_probe()
778 ext4_warning(dir->i_sb, "Unimplemented inode hash flags: %#06x", dx_probe()
784 ext4_warning(dir->i_sb, "Unimplemented inode hash depth: %#06x", dx_probe()
792 if (dx_get_limit(entries) != dx_root_limit(dir, dx_probe()
794 ext4_warning(dir->i_sb, "dx entry: limit != root limit"); dx_probe()
802 ext4_warning(dir->i_sb, dx_probe()
840 frame->bh = ext4_read_dirblock(dir, dx_get_block(at), INDEX); dx_probe()
848 if (dx_get_limit(entries) != dx_node_limit (dir)) { dx_probe()
849 ext4_warning(dir->i_sb, dx_probe()
861 ext4_warning(dir->i_sb, dx_probe()
862 "Corrupt dir inode %lu, running e2fsck is " dx_probe()
863 "recommended.", dir->i_ino); dx_probe()
894 static int ext4_htree_next_block(struct inode *dir, __u32 hash, ext4_htree_next_block() argument
940 bh = ext4_read_dirblock(dir, dx_get_block(p->at), INDEX); ext4_htree_next_block()
958 struct inode *dir, ext4_lblk_t block, htree_dirblock_to_tree()
970 bh = ext4_read_dirblock(dir, block, DIRENT); htree_dirblock_to_tree()
976 dir->i_sb->s_blocksize - htree_dirblock_to_tree()
980 ctx = ext4_get_fname_crypto_ctx(dir, EXT4_NAME_LEN); htree_dirblock_to_tree()
996 for (; de < top; de = ext4_next_entry(de, dir->i_sb->s_blocksize)) { htree_dirblock_to_tree()
997 if (ext4_check_dir_entry(dir, NULL, de, bh, htree_dirblock_to_tree()
999 (block<<EXT4_BLOCK_SIZE_BITS(dir->i_sb)) htree_dirblock_to_tree()
1060 struct inode *dir; ext4_htree_fill_tree() local
1069 dir = file_inode(dir_file); ext4_htree_fill_tree()
1070 if (!(ext4_test_inode_flag(dir, EXT4_INODE_INDEX))) { ext4_htree_fill_tree()
1071 hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; ext4_htree_fill_tree()
1074 EXT4_SB(dir->i_sb)->s_hash_unsigned; ext4_htree_fill_tree()
1075 hinfo.seed = EXT4_SB(dir->i_sb)->s_hash_seed; ext4_htree_fill_tree()
1076 if (ext4_has_inline_data(dir)) { ext4_htree_fill_tree()
1078 count = htree_inlinedir_to_tree(dir_file, dir, 0, ext4_htree_fill_tree()
1087 count = htree_dirblock_to_tree(dir_file, dir, 0, &hinfo, ext4_htree_fill_tree()
1094 frame = dx_probe(NULL, dir, &hinfo, frames); ext4_htree_fill_tree()
1111 de = ext4_next_entry(de, dir->i_sb->s_blocksize); ext4_htree_fill_tree()
1123 ret = htree_dirblock_to_tree(dir_file, dir, block, &hinfo, ext4_htree_fill_tree()
1131 ret = ext4_htree_next_block(dir, HASH_NB_ALWAYS, ext4_htree_fill_tree()
1157 struct inode *dir, search_dirblock()
1162 return search_dir(bh, bh->b_data, dir->i_sb->s_blocksize, dir, search_dirblock()
1174 static int dx_make_map(struct inode *dir, struct ext4_dir_entry_2 *de, dx_make_map() argument
1269 struct inode *dir, const struct qstr *d_name, search_dir()
1281 ctx = ext4_get_fname_crypto_ctx(dir, EXT4_NAME_LEN); search_dir()
1300 if (ext4_check_dir_entry(dir, NULL, de, bh, search_dir()
1314 dir->i_sb->s_blocksize); search_dir()
1330 static int is_dx_internal_node(struct inode *dir, ext4_lblk_t block, is_dx_internal_node() argument
1333 struct super_block *sb = dir->i_sb; is_dx_internal_node()
1335 if (!is_dx(dir)) is_dx_internal_node()
1357 static struct buffer_head * ext4_find_entry (struct inode *dir, ext4_find_entry() argument
1376 sb = dir->i_sb; ext4_find_entry()
1381 if (ext4_has_inline_data(dir)) { ext4_find_entry()
1383 ret = ext4_find_inline_entry(dir, d_name, res_dir, ext4_find_entry()
1402 if (is_dx(dir)) { ext4_find_entry()
1403 bh = ext4_dx_find_entry(dir, d_name, res_dir); ext4_find_entry()
1414 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); ext4_find_entry()
1415 start = EXT4_I(dir)->i_dir_start_lookup; ext4_find_entry()
1439 bh = ext4_getblk(NULL, dir, b++, 0); ext4_find_entry()
1456 EXT4_ERROR_INODE(dir, "reading directory lblock %lu", ext4_find_entry()
1462 !is_dx_internal_node(dir, block, ext4_find_entry()
1464 !ext4_dirent_csum_verify(dir, ext4_find_entry()
1466 EXT4_ERROR_INODE(dir, "checksumming directory " ext4_find_entry()
1472 i = search_dirblock(bh, dir, d_name, ext4_find_entry()
1475 EXT4_I(dir)->i_dir_start_lookup = block; ext4_find_entry()
1493 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); ext4_find_entry()
1506 static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct qstr *d_name, ext4_dx_find_entry() argument
1509 struct super_block * sb = dir->i_sb; ext4_dx_find_entry()
1519 frame = dx_probe(d_name, dir, &hinfo, frames); ext4_dx_find_entry()
1524 bh = ext4_read_dirblock(dir, block, DIRENT); ext4_dx_find_entry()
1528 retval = search_dirblock(bh, dir, d_name, ext4_dx_find_entry()
1540 retval = ext4_htree_next_block(dir, hinfo.hash, frame, ext4_dx_find_entry()
1545 retval, dir->i_ino); ext4_dx_find_entry()
1559 static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) ext4_lookup() argument
1568 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); ext4_lookup()
1575 if (!ext4_valid_inum(dir->i_sb, ino)) { ext4_lookup()
1576 EXT4_ERROR_INODE(dir, "bad inode number: %u", ino); ext4_lookup()
1579 if (unlikely(ino == dir->i_ino)) { ext4_lookup()
1580 EXT4_ERROR_INODE(dir, "'%pd' linked to parent dir", ext4_lookup()
1584 inode = ext4_iget_normal(dir->i_sb, ino); ext4_lookup()
1586 EXT4_ERROR_INODE(dir, ext4_lookup()
1591 if (!IS_ERR(inode) && ext4_encrypted_inode(dir) && ext4_lookup()
1594 !ext4_is_child_context_consistent_with_parent(dir, ext4_lookup()
1599 (unsigned long) dir->i_ino, ext4_lookup()
1657 * Compact each dir entry in the range to the minimal rec_len.
1682 * Split a full leaf block to make room for a new dir entry.
1686 static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, do_split() argument
1690 unsigned blocksize = dir->i_sb->s_blocksize; do_split()
1703 if (ext4_has_metadata_csum(dir->i_sb)) do_split()
1706 bh2 = ext4_append(handle, dir, &newblock); do_split()
1727 count = dx_make_map(dir, (struct ext4_dir_entry_2 *) data1, do_split()
1767 dxtrace(dx_show_leaf(dir, hinfo, (struct ext4_dir_entry_2 *) data1, do_split()
1769 dxtrace(dx_show_leaf(dir, hinfo, (struct ext4_dir_entry_2 *) data2, do_split()
1778 err = ext4_handle_dirty_dirent_node(handle, dir, bh2); do_split()
1781 err = ext4_handle_dirty_dx_node(handle, dir, frame->bh); do_split()
1792 ext4_std_error(dir->i_sb, err); do_split()
1796 int ext4_find_dest_de(struct inode *dir, struct inode *inode, ext4_find_dest_de() argument
1811 ctx = ext4_get_fname_crypto_ctx(dir, EXT4_NAME_LEN); ext4_find_dest_de()
1828 if (ext4_check_dir_entry(dir, NULL, de, bh, ext4_find_dest_de()
1861 int ext4_insert_dentry(struct inode *dir, ext4_insert_dentry() argument
1875 ctx = ext4_get_fname_crypto_ctx(dir, EXT4_NAME_LEN); ext4_insert_dentry()
1931 struct inode *dir = d_inode(dentry->d_parent); add_dirent_to_buf() local
1934 unsigned int blocksize = dir->i_sb->s_blocksize; add_dirent_to_buf()
1942 err = ext4_find_dest_de(dir, inode, add_dirent_to_buf()
1951 ext4_std_error(dir->i_sb, err); add_dirent_to_buf()
1957 err = ext4_insert_dentry(dir, inode, de, blocksize, &dentry->d_name, add_dirent_to_buf()
1973 dir->i_mtime = dir->i_ctime = ext4_current_time(dir); add_dirent_to_buf()
1974 ext4_update_dx_flag(dir); add_dirent_to_buf()
1975 dir->i_version++; add_dirent_to_buf()
1976 ext4_mark_inode_dirty(handle, dir); add_dirent_to_buf()
1978 err = ext4_handle_dirty_dirent_node(handle, dir, bh); add_dirent_to_buf()
1980 ext4_std_error(dir->i_sb, err); add_dirent_to_buf()
1991 struct inode *dir = d_inode(dentry->d_parent); make_indexed_dir() local
2015 ctx = ext4_get_fname_crypto_ctx(dir, EXT4_NAME_LEN); make_indexed_dir()
2023 blocksize = dir->i_sb->s_blocksize; make_indexed_dir()
2024 dxtrace(printk(KERN_DEBUG "Creating index: inode %lu\n", dir->i_ino)); make_indexed_dir()
2028 ext4_std_error(dir->i_sb, retval); make_indexed_dir()
2039 EXT4_ERROR_INODE(dir, "invalid rec_len for '..'"); make_indexed_dir()
2046 bh2 = ext4_append(handle, dir, &block); make_indexed_dir()
2051 ext4_set_inode_flag(dir, EXT4_INODE_INDEX); make_indexed_dir()
2074 root->info.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; make_indexed_dir()
2078 dx_set_limit(entries, dx_root_limit(dir, sizeof(root->info))); make_indexed_dir()
2083 hinfo.hash_version += EXT4_SB(dir->i_sb)->s_hash_unsigned; make_indexed_dir()
2084 hinfo.seed = EXT4_SB(dir->i_sb)->s_hash_seed; make_indexed_dir()
2089 ext4_mark_inode_dirty(handle, dir); make_indexed_dir()
2104 retval = ext4_handle_dirty_dx_node(handle, dir, frame->bh); make_indexed_dir()
2107 retval = ext4_handle_dirty_dirent_node(handle, dir, bh); make_indexed_dir()
2111 de = do_split(handle,dir, &bh, frame, &hinfo); make_indexed_dir()
2127 ext4_mark_inode_dirty(handle, dir); make_indexed_dir()
2145 struct inode *dir = d_inode(dentry->d_parent); ext4_add_entry() local
2159 sb = dir->i_sb; ext4_add_entry()
2164 if (ext4_has_inline_data(dir)) { ext4_add_entry()
2174 if (is_dx(dir)) { ext4_add_entry()
2178 ext4_clear_inode_flag(dir, EXT4_INODE_INDEX); ext4_add_entry()
2180 ext4_mark_inode_dirty(handle, dir); ext4_add_entry()
2182 blocks = dir->i_size >> sb->s_blocksize_bits; ext4_add_entry()
2184 bh = ext4_read_dirblock(dir, block, DIRENT); ext4_add_entry()
2200 bh = ext4_append(handle, dir, &block); ext4_add_entry()
2230 struct inode *dir = d_inode(dentry->d_parent); ext4_dx_add_entry() local
2231 struct super_block *sb = dir->i_sb; ext4_dx_add_entry()
2235 frame = dx_probe(&dentry->d_name, dir, &hinfo, frames); ext4_dx_add_entry()
2240 bh = ext4_read_dirblock(dir, dx_get_block(frame->at), DIRENT); ext4_dx_add_entry()
2274 bh2 = ext4_append(handle, dir, &newblock); ext4_dx_add_entry()
2304 dx_set_limit(entries2, dx_node_limit(dir)); ext4_dx_add_entry()
2316 err = ext4_handle_dirty_dx_node(handle, dir, bh2); ext4_dx_add_entry()
2325 dx_set_limit(entries2, dx_node_limit(dir)); ext4_dx_add_entry()
2342 err = ext4_handle_dirty_dx_node(handle, dir, frames[0].bh); ext4_dx_add_entry()
2348 de = do_split(handle, dir, &bh, frame, &hinfo); ext4_dx_add_entry()
2357 ext4_std_error(dir->i_sb, err); ext4_dx_add_entry()
2369 struct inode *dir, ext4_generic_delete_entry()
2377 unsigned int blocksize = dir->i_sb->s_blocksize; ext4_generic_delete_entry()
2384 if (ext4_check_dir_entry(dir, NULL, de, bh, ext4_generic_delete_entry()
2397 dir->i_version++; ext4_generic_delete_entry()
2408 struct inode *dir, ext4_delete_entry()
2414 if (ext4_has_inline_data(dir)) { ext4_delete_entry()
2416 err = ext4_delete_inline_entry(handle, dir, de_del, bh, ext4_delete_entry()
2422 if (ext4_has_metadata_csum(dir->i_sb)) ext4_delete_entry()
2430 err = ext4_generic_delete_entry(handle, dir, de_del, ext4_delete_entry()
2432 dir->i_sb->s_blocksize, csum_size); ext4_delete_entry()
2437 err = ext4_handle_dirty_dirent_node(handle, dir, bh); ext4_delete_entry()
2444 ext4_std_error(dir->i_sb, err); ext4_delete_entry()
2500 static int ext4_create(struct inode *dir, struct dentry *dentry, umode_t mode, ext4_create() argument
2507 dquot_initialize(dir); ext4_create()
2509 credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_create()
2512 inode = ext4_new_inode_start_handle(dir, mode, &dentry->d_name, 0, ext4_create()
2522 if (!err && (ext4_encrypted_inode(dir) || ext4_create()
2523 DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb)))) { ext4_create()
2524 err = ext4_inherit_context(dir, inode); ext4_create()
2534 if (!err && IS_DIRSYNC(dir)) ext4_create()
2539 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_create()
2544 static int ext4_mknod(struct inode *dir, struct dentry *dentry, ext4_mknod() argument
2554 dquot_initialize(dir); ext4_mknod()
2556 credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_mknod()
2559 inode = ext4_new_inode_start_handle(dir, mode, &dentry->d_name, 0, ext4_mknod()
2567 if (!err && IS_DIRSYNC(dir)) ext4_mknod()
2572 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_mknod()
2577 static int ext4_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ext4_tmpfile() argument
2583 dquot_initialize(dir); ext4_tmpfile()
2586 inode = ext4_new_inode_start_handle(dir, mode, ext4_tmpfile()
2589 EXT4_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) + ext4_tmpfile()
2606 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_tmpfile()
2643 static int ext4_init_new_dir(handle_t *handle, struct inode *dir, ext4_init_new_dir() argument
2650 unsigned int blocksize = dir->i_sb->s_blocksize; ext4_init_new_dir()
2654 if (ext4_has_metadata_csum(dir->i_sb)) ext4_init_new_dir()
2658 err = ext4_try_create_inline_dir(handle, dir, inode); ext4_init_new_dir()
2670 ext4_init_dot_dotdot(inode, de, blocksize, csum_size, dir->i_ino, 0); ext4_init_new_dir()
2687 static int ext4_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ext4_mkdir() argument
2693 if (EXT4_DIR_LINK_MAX(dir)) ext4_mkdir()
2696 dquot_initialize(dir); ext4_mkdir()
2698 credits = (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_mkdir()
2701 inode = ext4_new_inode_start_handle(dir, S_IFDIR | mode, ext4_mkdir()
2711 err = ext4_init_new_dir(handle, dir, inode); ext4_mkdir()
2715 if (ext4_encrypted_inode(dir) || ext4_mkdir()
2716 DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))) { ext4_mkdir()
2717 err = ext4_inherit_context(dir, inode); ext4_mkdir()
2733 ext4_inc_count(handle, dir); ext4_mkdir()
2734 ext4_update_dx_flag(dir); ext4_mkdir()
2735 err = ext4_mark_inode_dirty(handle, dir); ext4_mkdir()
2740 if (IS_DIRSYNC(dir)) ext4_mkdir()
2746 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_mkdir()
2786 "bad directory (dir #%lu) - no `.' or `..'", ext4_empty_dir()
2995 static int ext4_rmdir(struct inode *dir, struct dentry *dentry) ext4_rmdir() argument
3005 dquot_initialize(dir); ext4_rmdir()
3009 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); ext4_rmdir()
3025 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_rmdir()
3026 EXT4_DATA_TRANS_BLOCKS(dir->i_sb)); ext4_rmdir()
3033 if (IS_DIRSYNC(dir)) ext4_rmdir()
3036 retval = ext4_delete_entry(handle, dir, de, bh); ext4_rmdir()
3050 inode->i_ctime = dir->i_ctime = dir->i_mtime = ext4_current_time(inode); ext4_rmdir()
3052 ext4_dec_count(handle, dir); ext4_rmdir()
3053 ext4_update_dx_flag(dir); ext4_rmdir()
3054 ext4_mark_inode_dirty(handle, dir); ext4_rmdir()
3063 static int ext4_unlink(struct inode *dir, struct dentry *dentry) ext4_unlink() argument
3071 trace_ext4_unlink_enter(dir, dentry); ext4_unlink()
3074 dquot_initialize(dir); ext4_unlink()
3078 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL); ext4_unlink()
3090 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_unlink()
3091 EXT4_DATA_TRANS_BLOCKS(dir->i_sb)); ext4_unlink()
3098 if (IS_DIRSYNC(dir)) ext4_unlink()
3107 retval = ext4_delete_entry(handle, dir, de, bh); ext4_unlink()
3110 dir->i_ctime = dir->i_mtime = ext4_current_time(dir); ext4_unlink()
3111 ext4_update_dx_flag(dir); ext4_unlink()
3112 ext4_mark_inode_dirty(handle, dir); ext4_unlink()
3127 static int ext4_symlink(struct inode *dir, ext4_symlink() argument
3141 encryption_required = (ext4_encrypted_inode(dir) || ext4_symlink()
3142 DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb))); ext4_symlink()
3145 if (disk_link.len > dir->i_sb->s_blocksize) ext4_symlink()
3148 dquot_initialize(dir); ext4_symlink()
3157 credits = 4 + EXT4_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) + ext4_symlink()
3166 credits = EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_symlink()
3170 inode = ext4_new_inode_start_handle(dir, S_IFLNK|S_IRWXUGO, ext4_symlink()
3190 err = ext4_inherit_context(dir, inode); ext4_symlink()
3234 * Now inode is being linked into dir (EXT4_DATA_TRANS_BLOCKS ext4_symlink()
3237 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_symlink()
3238 EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_symlink()
3261 if (!err && IS_DIRSYNC(dir)) ext4_symlink()
3279 struct inode *dir, struct dentry *dentry) ext4_link()
3287 if (ext4_encrypted_inode(dir) && ext4_link()
3288 !ext4_is_child_context_consistent_with_parent(dir, inode)) ext4_link()
3290 dquot_initialize(dir); ext4_link()
3293 handle = ext4_journal_start(dir, EXT4_HT_DIR, ext4_link()
3294 (EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + ext4_link()
3299 if (IS_DIRSYNC(dir)) ext4_link()
3320 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) ext4_link()
3329 * if it is a normal dir.
3356 struct inode *dir; member in struct:ext4_renament
3382 if (le32_to_cpu(ent->parent_de->inode) != ent->dir->i_ino) ext4_rename_dir_prepare()
3409 ext4_std_error(ent->dir->i_sb, retval); ext4_rename_dir_finish()
3425 if (EXT4_HAS_INCOMPAT_FEATURE(ent->dir->i_sb, ext4_setent()
3428 ent->dir->i_version++; ext4_setent()
3429 ent->dir->i_ctime = ent->dir->i_mtime = ext4_setent()
3430 ext4_current_time(ent->dir); ext4_setent()
3431 ext4_mark_inode_dirty(handle, ent->dir); ext4_setent()
3435 ent->dir, ent->bh); ext4_setent()
3437 ext4_std_error(ent->dir->i_sb, retval); ext4_setent()
3447 static int ext4_find_delete_entry(handle_t *handle, struct inode *dir, ext4_find_delete_entry() argument
3454 bh = ext4_find_entry(dir, d_name, &de, NULL); ext4_find_delete_entry()
3458 retval = ext4_delete_entry(handle, dir, de, bh); ext4_find_delete_entry()
3479 retval = ext4_find_delete_entry(handle, ent->dir, ext4_rename_delete()
3482 retval = ext4_delete_entry(handle, ent->dir, ent->de, ent->bh); ext4_rename_delete()
3484 retval = ext4_find_delete_entry(handle, ent->dir, ext4_rename_delete()
3490 ext4_warning(ent->dir->i_sb, ext4_rename_delete()
3492 ent->dir->i_ino, ent->dir->i_nlink, retval); ext4_rename_delete()
3500 ext4_dec_count(handle, ent->dir); ext4_update_dir_count()
3502 ext4_inc_count(handle, ent->dir); ext4_update_dir_count()
3503 ext4_mark_inode_dirty(handle, ent->dir); ext4_update_dir_count()
3518 credits += (EXT4_MAXQUOTAS_TRANS_BLOCKS(ent->dir->i_sb) + ext4_whiteout_for_rename()
3521 wh = ext4_new_inode_start_handle(ent->dir, S_IFCHR | WHITEOUT_MODE, ext4_whiteout_for_rename()
3530 ext4_should_retry_alloc(ent->dir->i_sb, &retries)) ext4_whiteout_for_rename()
3554 .dir = old_dir, ext4_rename()
3559 .dir = new_dir, ext4_rename()
3569 dquot_initialize(old.dir); ext4_rename()
3570 dquot_initialize(new.dir); ext4_rename()
3577 old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de, NULL); ext4_rename()
3590 if ((old.dir != new.dir) && ext4_rename()
3591 ext4_encrypted_inode(new.dir) && ext4_rename()
3592 !ext4_is_child_context_consistent_with_parent(new.dir, ext4_rename()
3598 new.bh = ext4_find_entry(new.dir, &new.dentry->d_name, ext4_rename()
3611 if (new.inode && !test_opt(new.dir->i_sb, NO_AUTO_DA_ALLOC)) ext4_rename()
3614 credits = (2 * EXT4_DATA_TRANS_BLOCKS(old.dir->i_sb) + ext4_rename()
3617 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits); ext4_rename()
3632 if (IS_DIRSYNC(old.dir) || IS_DIRSYNC(new.dir)) ext4_rename()
3642 if (new.dir != old.dir && EXT4_DIR_LINK_MAX(new.dir)) ext4_rename()
3650 * If we're renaming a file within an inline_data dir and adding or ext4_rename()
3656 force_reread = (new.dir->i_ino == old.dir->i_ino && ext4_rename()
3657 ext4_test_inode_flag(new.dir, EXT4_INODE_INLINE_DATA)); ext4_rename()
3682 force_reread = !ext4_test_inode_flag(new.dir, ext4_rename()
3703 old.dir->i_ctime = old.dir->i_mtime = ext4_current_time(old.dir); ext4_rename()
3704 ext4_update_dx_flag(old.dir); ext4_rename()
3706 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); ext4_rename()
3710 ext4_dec_count(handle, old.dir); ext4_rename()
3717 ext4_inc_count(handle, new.dir); ext4_rename()
3718 ext4_update_dx_flag(new.dir); ext4_rename()
3719 ext4_mark_inode_dirty(handle, new.dir); ext4_rename()
3722 ext4_mark_inode_dirty(handle, old.dir); ext4_rename()
3750 .dir = old_dir, ext4_cross_rename()
3755 .dir = new_dir, ext4_cross_rename()
3762 dquot_initialize(old.dir); ext4_cross_rename()
3763 dquot_initialize(new.dir); ext4_cross_rename()
3765 old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, ext4_cross_rename()
3779 new.bh = ext4_find_entry(new.dir, &new.dentry->d_name, ext4_cross_rename()
3791 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, ext4_cross_rename()
3792 (2 * EXT4_DATA_TRANS_BLOCKS(old.dir->i_sb) + ext4_cross_rename()
3800 if (IS_DIRSYNC(old.dir) || IS_DIRSYNC(new.dir)) ext4_cross_rename()
3820 if (old.dir != new.dir && old.is_dir != new.is_dir) { ext4_cross_rename()
3824 if ((old.dir_nlink_delta > 0 && EXT4_DIR_LINK_MAX(old.dir)) || ext4_cross_rename()
3825 (new.dir_nlink_delta > 0 && EXT4_DIR_LINK_MAX(new.dir))) ext4_cross_rename()
3848 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); ext4_cross_rename()
3853 retval = ext4_rename_dir_finish(handle, &new, old.dir->i_ino); ext4_cross_rename()
957 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
1156 search_dirblock(struct buffer_head *bh, struct inode *dir, const struct qstr *d_name, unsigned int offset, struct ext4_dir_entry_2 **res_dir) search_dirblock() argument
1268 search_dir(struct buffer_head *bh, char *search_buf, int buf_size, struct inode *dir, const struct qstr *d_name, unsigned int offset, struct ext4_dir_entry_2 **res_dir) search_dir() argument
2368 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
2407 ext4_delete_entry(handle_t *handle, struct inode *dir, struct ext4_dir_entry_2 *de_del, struct buffer_head *bh) ext4_delete_entry() argument
3278 ext4_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) ext4_link() argument
H A Dinline.c965 void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh, ext4_show_inline_dir() argument
973 trace_printk("inode %lu\n", dir->i_ino); ext4_show_inline_dir()
980 if (ext4_check_dir_entry(dir, NULL, de, bh, ext4_show_inline_dir()
989 #define ext4_show_inline_dir(dir, bh, inline_start, inline_size)
993 * Add a new entry into a inline dir.
1003 struct inode *dir = d_inode(dentry->d_parent); ext4_add_dirent_to_inline() local
1009 err = ext4_find_dest_de(dir, inode, iloc->bh, ext4_add_dirent_to_inline()
1019 ext4_insert_dentry(dir, inode, de, inline_size, &dentry->d_name, ext4_add_dirent_to_inline()
1022 ext4_show_inline_dir(dir, iloc->bh, inline_start, inline_size); ext4_add_dirent_to_inline()
1035 dir->i_mtime = dir->i_ctime = ext4_current_time(dir); ext4_add_dirent_to_inline()
1036 ext4_update_dx_flag(dir); ext4_add_dirent_to_inline()
1037 dir->i_version++; ext4_add_dirent_to_inline()
1038 ext4_mark_inode_dirty(handle, dir); ext4_add_dirent_to_inline()
1083 static int ext4_update_inline_dir(handle_t *handle, struct inode *dir, ext4_update_inline_dir() argument
1087 int old_size = EXT4_I(dir)->i_inline_size - EXT4_MIN_INLINE_DATA_SIZE; ext4_update_inline_dir()
1088 int new_size = get_max_inline_xattr_value_size(dir, iloc); ext4_update_inline_dir()
1093 ret = ext4_update_inline_data(handle, dir, ext4_update_inline_dir()
1098 ext4_update_final_de(ext4_get_inline_xattr_pos(dir, iloc), old_size, ext4_update_inline_dir()
1099 EXT4_I(dir)->i_inline_size - ext4_update_inline_dir()
1101 dir->i_size = EXT4_I(dir)->i_disksize = EXT4_I(dir)->i_inline_size; ext4_update_inline_dir()
1126 * First create "." and ".." and then copy the dir information ext4_finish_convert_inline_dir()
1248 * If succeeds, return 0. If not, extended the inline dir and copied data to
1257 struct inode *dir = d_inode(dentry->d_parent); ext4_try_add_inline_entry() local
1259 ret = ext4_get_inode_loc(dir, &iloc); ext4_try_add_inline_entry()
1263 down_write(&EXT4_I(dir)->xattr_sem); ext4_try_add_inline_entry()
1264 if (!ext4_has_inline_data(dir)) ext4_try_add_inline_entry()
1277 inline_size = EXT4_I(dir)->i_inline_size - ext4_try_add_inline_entry()
1281 ret = ext4_update_inline_dir(handle, dir, &iloc); ext4_try_add_inline_entry()
1285 inline_size = EXT4_I(dir)->i_inline_size - ext4_try_add_inline_entry()
1290 inline_start = ext4_get_inline_xattr_pos(dir, &iloc); ext4_try_add_inline_entry()
1302 * dir first. ext4_try_add_inline_entry()
1304 ret = ext4_convert_inline_data_nolock(handle, dir, &iloc); ext4_try_add_inline_entry()
1307 ext4_mark_inode_dirty(handle, dir); ext4_try_add_inline_entry()
1308 up_write(&EXT4_I(dir)->xattr_sem); ext4_try_add_inline_entry()
1315 * inlined dir. It returns the number directory entries loaded
1319 struct inode *dir, ext4_lblk_t block, htree_inlinedir_to_tree()
1363 * As inlined dir doesn't store any information about '.' and htree_inlinedir_to_tree()
1425 * after we convert from an inlined dir to a blocked based,
1426 * we just pretend that we are a normal dir and return the
1475 * size for ".." and "." if the dir is block based while ext4_read_inline_dir()
1478 * during the inline dir iteration. ext4_read_inline_dir()
1489 * dir to make sure. ext4_read_inline_dir()
1576 * Try to create the inline data for the new dir.
1578 * In case of ENOSPC, the caller should create the normal disk layout dir.
1596 * For inline dir, we only save the inode information for the ".." ext4_try_create_inline_dir()
1613 struct buffer_head *ext4_find_inline_entry(struct inode *dir, ext4_find_inline_entry() argument
1623 if (ext4_get_inode_loc(dir, &iloc)) ext4_find_inline_entry()
1626 down_read(&EXT4_I(dir)->xattr_sem); ext4_find_inline_entry()
1627 if (!ext4_has_inline_data(dir)) { ext4_find_inline_entry()
1636 dir, d_name, 0, res_dir); ext4_find_inline_entry()
1642 if (ext4_get_inline_size(dir) == EXT4_MIN_INLINE_DATA_SIZE) ext4_find_inline_entry()
1645 inline_start = ext4_get_inline_xattr_pos(dir, &iloc); ext4_find_inline_entry()
1646 inline_size = ext4_get_inline_size(dir) - EXT4_MIN_INLINE_DATA_SIZE; ext4_find_inline_entry()
1649 dir, d_name, 0, res_dir); ext4_find_inline_entry()
1657 up_read(&EXT4_I(dir)->xattr_sem); ext4_find_inline_entry()
1662 struct inode *dir, ext4_delete_inline_entry()
1671 err = ext4_get_inode_loc(dir, &iloc); ext4_delete_inline_entry()
1675 down_write(&EXT4_I(dir)->xattr_sem); ext4_delete_inline_entry()
1676 if (!ext4_has_inline_data(dir)) { ext4_delete_inline_entry()
1688 inline_start = ext4_get_inline_xattr_pos(dir, &iloc); ext4_delete_inline_entry()
1689 inline_size = ext4_get_inline_size(dir) - ext4_delete_inline_entry()
1698 err = ext4_generic_delete_entry(handle, dir, de_del, bh, ext4_delete_inline_entry()
1704 err = ext4_mark_inode_dirty(handle, dir); ext4_delete_inline_entry()
1708 ext4_show_inline_dir(dir, iloc.bh, inline_start, inline_size); ext4_delete_inline_entry()
1710 up_write(&EXT4_I(dir)->xattr_sem); ext4_delete_inline_entry()
1713 ext4_std_error(dir->i_sb, err); ext4_delete_inline_entry()
1746 int empty_inline_dir(struct inode *dir, int *has_inline_data) empty_inline_dir() argument
1755 err = ext4_get_inode_loc(dir, &iloc); empty_inline_dir()
1757 EXT4_ERROR_INODE(dir, "error %d getting inode %lu block", empty_inline_dir()
1758 err, dir->i_ino); empty_inline_dir()
1762 down_read(&EXT4_I(dir)->xattr_sem); empty_inline_dir()
1763 if (!ext4_has_inline_data(dir)) { empty_inline_dir()
1770 ext4_warning(dir->i_sb, empty_inline_dir()
1771 "bad inline directory (dir #%lu) - no `..'", empty_inline_dir()
1772 dir->i_ino); empty_inline_dir()
1778 while (offset < dir->i_size) { empty_inline_dir()
1779 de = ext4_get_inline_entry(dir, &iloc, offset, empty_inline_dir()
1781 if (ext4_check_dir_entry(dir, NULL, de, empty_inline_dir()
1784 ext4_warning(dir->i_sb, empty_inline_dir()
1785 "bad inline directory (dir #%lu) - " empty_inline_dir()
1788 dir->i_ino, le32_to_cpu(de->inode), empty_inline_dir()
1802 up_read(&EXT4_I(dir)->xattr_sem); empty_inline_dir()
1318 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
1661 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.1.27/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.1.27/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.1.27/fs/cachefiles/
H A Dnamei.c266 struct dentry *dir, cachefiles_bury_object()
275 _enter(",'%pd','%pd'", dir, rep); cachefiles_bury_object()
277 _debug("remove %p from %p", rep, dir); cachefiles_bury_object()
284 path.dentry = dir; cachefiles_bury_object()
289 ret = vfs_unlink(d_inode(dir), rep, NULL); cachefiles_bury_object()
295 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_bury_object()
306 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_bury_object()
315 trap = lock_rename(cache->graveyard, dir); cachefiles_bury_object()
318 if (rep->d_parent != dir) { cachefiles_bury_object()
319 /* the entry was probably culled when we dropped the parent dir cachefiles_bury_object()
321 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
327 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
333 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
339 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
346 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
359 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
367 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
375 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
383 path.dentry = dir; cachefiles_bury_object()
390 ret = vfs_rename(d_inode(dir), rep, cachefiles_bury_object()
400 unlock_rename(cache->graveyard, dir); cachefiles_bury_object()
412 struct dentry *dir; cachefiles_delete_object() local
421 dir = dget_parent(object->dentry); cachefiles_delete_object()
423 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); cachefiles_delete_object()
429 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_delete_object()
434 if (dir == object->dentry->d_parent) { cachefiles_delete_object()
435 ret = cachefiles_bury_object(cache, dir, cachefiles_delete_object()
441 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_delete_object()
446 dput(dir); cachefiles_delete_object()
461 struct dentry *dir, *next = NULL; cachefiles_walk_to_object() local
479 // TODO: convert file to dir cachefiles_walk_to_object()
484 dir = dget(parent->dentry); cachefiles_walk_to_object()
500 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); cachefiles_walk_to_object()
503 next = lookup_one_len(name, dir, nlen); cachefiles_walk_to_object()
527 path.dentry = dir; cachefiles_walk_to_object()
532 ret = vfs_mkdir(d_inode(dir), next, 0); cachefiles_walk_to_object()
556 path.dentry = dir; cachefiles_walk_to_object()
561 ret = vfs_create(d_inode(dir), next, S_IFREG, true); cachefiles_walk_to_object()
584 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_walk_to_object()
585 dput(dir); cachefiles_walk_to_object()
586 dir = next; cachefiles_walk_to_object()
605 ret = cachefiles_bury_object(cache, dir, next, true); cachefiles_walk_to_object()
620 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_walk_to_object()
621 dput(dir); cachefiles_walk_to_object()
622 dir = NULL; cachefiles_walk_to_object()
698 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_walk_to_object()
701 dput(dir); cachefiles_walk_to_object()
711 struct dentry *dir, cachefiles_get_directory()
722 mutex_lock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
725 subdir = lookup_one_len(dirname, dir, strlen(dirname)); cachefiles_get_directory()
745 path.dentry = dir; cachefiles_get_directory()
749 ret = vfs_mkdir(d_inode(dir), subdir, 0700); cachefiles_get_directory()
761 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
793 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
799 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
805 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_get_directory()
817 struct dentry *dir, cachefiles_check_active()
827 // dir, filename); cachefiles_check_active()
830 mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT); cachefiles_check_active()
833 victim = lookup_one_len(filename, dir, strlen(filename)); cachefiles_check_active()
845 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_active()
874 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_active()
880 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_active()
883 /* file or dir now absent - probably retired by netfs */ cachefiles_check_active()
903 int cachefiles_cull(struct cachefiles_cache *cache, struct dentry *dir, cachefiles_cull() argument
909 _enter(",%pd/,%s", dir, filename); cachefiles_cull()
911 victim = cachefiles_check_active(cache, dir, filename); cachefiles_cull()
927 /* actually remove the victim (drops the dir mutex) */ cachefiles_cull()
930 ret = cachefiles_bury_object(cache, dir, victim, false); cachefiles_cull()
939 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_cull()
943 /* file or dir now absent - probably retired by netfs */ cachefiles_cull()
962 int cachefiles_check_in_use(struct cachefiles_cache *cache, struct dentry *dir, cachefiles_check_in_use() argument
968 // dir, filename); cachefiles_check_in_use()
970 victim = cachefiles_check_active(cache, dir, filename); cachefiles_check_in_use()
974 mutex_unlock(&d_inode(dir)->i_mutex); cachefiles_check_in_use()
265 cachefiles_bury_object(struct cachefiles_cache *cache, struct dentry *dir, struct dentry *rep, bool preemptive) cachefiles_bury_object() argument
710 cachefiles_get_directory(struct cachefiles_cache *cache, struct dentry *dir, const char *dirname) cachefiles_get_directory() argument
816 cachefiles_check_active(struct cachefiles_cache *cache, struct dentry *dir, char *filename) cachefiles_check_active() argument
/linux-4.1.27/include/linux/netfilter/
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.1.27/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()
214 enum ip_conntrack_dir dir, nf_ct_seq_offset()
223 this_way = &seqadj->seq[dir]; nf_ct_seq_offset()
213 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.1.27/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.1.27/drivers/crypto/caam/
H A Dsg_sw_sec4.h89 unsigned int nents, enum dma_data_direction dir, dma_map_sg_chained()
95 dma_map_sg(dev, sg, 1, dir); dma_map_sg_chained()
99 dma_map_sg(dev, sg, nents, dir); dma_map_sg_chained()
105 unsigned int nents, enum dma_data_direction dir, dma_unmap_sg_chained()
111 dma_unmap_sg(dev, sg, 1, dir); dma_unmap_sg_chained()
115 dma_unmap_sg(dev, sg, nents, dir); dma_unmap_sg_chained()
88 dma_map_sg_chained(struct device *dev, struct scatterlist *sg, unsigned int nents, enum dma_data_direction dir, bool chained) dma_map_sg_chained() argument
104 dma_unmap_sg_chained(struct device *dev, struct scatterlist *sg, unsigned int nents, enum dma_data_direction dir, bool chained) dma_unmap_sg_chained() argument
/linux-4.1.27/arch/arm64/mm/
H A Ddma-mapping.c207 enum dma_data_direction dir, __swiotlb_map_page()
212 dev_addr = swiotlb_map_page(dev, page, offset, size, dir, attrs); __swiotlb_map_page()
214 __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_map_page()
221 size_t size, enum dma_data_direction dir, __swiotlb_unmap_page()
225 __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_unmap_page()
226 swiotlb_unmap_page(dev, dev_addr, size, dir, attrs); __swiotlb_unmap_page()
230 int nelems, enum dma_data_direction dir, __swiotlb_map_sg_attrs()
236 ret = swiotlb_map_sg_attrs(dev, sgl, nelems, dir, attrs); __swiotlb_map_sg_attrs()
240 sg->length, dir); __swiotlb_map_sg_attrs()
247 enum dma_data_direction dir, __swiotlb_unmap_sg_attrs()
256 sg->length, dir); __swiotlb_unmap_sg_attrs()
257 swiotlb_unmap_sg_attrs(dev, sgl, nelems, dir, attrs); __swiotlb_unmap_sg_attrs()
262 enum dma_data_direction dir) __swiotlb_sync_single_for_cpu()
265 __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_sync_single_for_cpu()
266 swiotlb_sync_single_for_cpu(dev, dev_addr, size, dir); __swiotlb_sync_single_for_cpu()
271 enum dma_data_direction dir) __swiotlb_sync_single_for_device()
273 swiotlb_sync_single_for_device(dev, dev_addr, size, dir); __swiotlb_sync_single_for_device()
275 __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); __swiotlb_sync_single_for_device()
280 enum dma_data_direction dir) __swiotlb_sync_sg_for_cpu()
288 sg->length, dir); __swiotlb_sync_sg_for_cpu()
289 swiotlb_sync_sg_for_cpu(dev, sgl, nelems, dir); __swiotlb_sync_sg_for_cpu()
294 enum dma_data_direction dir) __swiotlb_sync_sg_for_device()
299 swiotlb_sync_sg_for_device(dev, sgl, nelems, dir); __swiotlb_sync_sg_for_device()
303 sg->length, dir); __swiotlb_sync_sg_for_device()
205 __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
220 __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
229 __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
245 __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
260 __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
269 __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
278 __swiotlb_sync_sg_for_cpu(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) __swiotlb_sync_sg_for_cpu() argument
292 __swiotlb_sync_sg_for_device(struct device *dev, struct scatterlist *sgl, int nelems, enum dma_data_direction dir) __swiotlb_sync_sg_for_device() argument
/linux-4.1.27/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.1.27/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.1.27/arch/mips/loongson/common/
H A Ddma-swiotlb.c59 enum dma_data_direction dir, loongson_dma_map_page()
63 dir, attrs); loongson_dma_map_page()
69 int nents, enum dma_data_direction dir, loongson_dma_map_sg()
72 int r = swiotlb_map_sg_attrs(dev, sg, nents, dir, NULL); loongson_dma_map_sg()
80 enum dma_data_direction dir) loongson_dma_sync_single_for_device()
82 swiotlb_sync_single_for_device(dev, dma_handle, size, dir); loongson_dma_sync_single_for_device()
88 enum dma_data_direction dir) loongson_dma_sync_sg_for_device()
90 swiotlb_sync_sg_for_device(dev, sg, nents, dir); loongson_dma_sync_sg_for_device()
57 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
68 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
78 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
86 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.1.27/sound/firewire/
H A Dfcp.h18 enum avc_general_plug_dir dir,
21 enum avc_general_plug_dir dir,
/linux-4.1.27/sound/firewire/oxfw/
H A Doxfw.h80 int avc_stream_set_format(struct fw_unit *unit, enum avc_general_plug_dir dir,
83 enum avc_general_plug_dir dir, unsigned int pid,
87 enum avc_general_plug_dir dir, unsigned int pid, avc_stream_get_format_single()
90 return avc_stream_get_format(unit, dir, pid, buf, len, 0xff); avc_stream_get_format_single()
94 enum avc_general_plug_dir dir, unsigned int pid, avc_stream_get_format_list()
98 return avc_stream_get_format(unit, dir, pid, buf, len, eid); avc_stream_get_format_list()
106 enum avc_general_plug_dir dir,
129 enum avc_general_plug_dir dir,
86 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
93 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.1.27/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.1.27/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.1.27/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.1.27/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.1.27/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.1.27/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.1.27/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.1.27/fs/ntfs/
H A DMakefile5 ntfs-y := aops.o attrib.o collate.o compress.o debug.o dir.o file.o \
/linux-4.1.27/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()
1163 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.1.27/arch/s390/hypfs/
H A Dhypfs_vm.c110 #define ATTRIBUTE(dir, name, member) \
113 rc = hypfs_create_u64(dir, name, member); \
128 /* guest dir */ hpyfs_vm_create_guest()
178 struct dentry *dir, *file; hypfs_vm_create_files() local
188 dir = hypfs_mkdir(root, "hyp"); hypfs_vm_create_files()
189 if (IS_ERR(dir)) { hypfs_vm_create_files()
190 rc = PTR_ERR(dir); hypfs_vm_create_files()
193 file = hypfs_create_str(dir, "type", "z/VM Hypervisor"); hypfs_vm_create_files()
200 dir = hypfs_mkdir(root, "cpus"); hypfs_vm_create_files()
201 if (IS_ERR(dir)) { hypfs_vm_create_files()
202 rc = PTR_ERR(dir); hypfs_vm_create_files()
205 file = hypfs_create_u64(dir, "count", data->lcpus); hypfs_vm_create_files()
212 dir = hypfs_mkdir(root, "systems"); hypfs_vm_create_files()
213 if (IS_ERR(dir)) { hypfs_vm_create_files()
214 rc = PTR_ERR(dir); hypfs_vm_create_files()
219 rc = hpyfs_vm_create_guest(dir, &(data[i])); hypfs_vm_create_files()
/linux-4.1.27/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.1.27/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.1.27/fs/cifs/
H A DMakefile6 cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
/linux-4.1.27/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()
216 enum iio_event_direction dir, int state) ad7150_write_event_config()
221 int rising = (dir == IIO_EV_DIR_RISING); ad7150_write_event_config()
228 event_code = IIO_UNMOD_EVENT_CODE(chan->type, chan->channel, type, dir); ad7150_write_event_config()
274 ret = ad7150_write_event_params(indio_dev, chan->channel, type, dir); ad7150_write_event_config()
284 enum iio_event_direction dir, ad7150_read_event_value()
289 int rising = (dir == IIO_EV_DIR_RISING); ad7150_read_event_value()
310 enum iio_event_direction dir, ad7150_write_event_value()
316 int rising = (dir == IIO_EV_DIR_RISING); ad7150_write_event_value()
335 ret = ad7150_write_event_params(indio_dev, chan->channel, type, dir); ad7150_write_event_value()
379 enum iio_event_direction dir; ad7150_store_timeout() local
386 dir = IIO_EVENT_CODE_EXTRACT_DIR(this_attr->address); ad7150_store_timeout()
387 rising = (dir == IIO_EV_DIR_RISING); ad7150_store_timeout()
406 ret = ad7150_write_event_params(indio_dev, chan, type, dir); ad7150_store_timeout()
416 #define AD7150_TIMEOUT(chan, type, dir, ev_type, ev_dir) \
417 IIO_DEVICE_ATTR(in_capacitance##chan##_##type##_##dir##_timeout, \
437 .dir = IIO_EV_DIR_RISING,
442 .dir = IIO_EV_DIR_FALLING,
447 .dir = IIO_EV_DIR_RISING,
452 .dir = IIO_EV_DIR_FALLING,
457 .dir = IIO_EV_DIR_RISING,
462 .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
214 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
281 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
307 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.1.27/arch/hexagon/kernel/
H A Ddma.c118 int nents, enum dma_data_direction dir, hexagon_map_sg()
144 enum dma_data_direction dir) dma_sync()
146 switch (dir) { dma_sync()
170 * @dir: transfer direction
185 enum dma_data_direction dir, hexagon_map_page()
194 dma_sync(dma_addr_to_virt(bus), size, dir); hexagon_map_page()
201 enum dma_data_direction dir) hexagon_sync_single_for_cpu()
203 dma_sync(dma_addr_to_virt(dma_handle), size, dir); hexagon_sync_single_for_cpu() local
208 enum dma_data_direction dir) hexagon_sync_single_for_device()
210 dma_sync(dma_addr_to_virt(dma_handle), size, dir); hexagon_sync_single_for_device() local
117 hexagon_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, enum dma_data_direction dir, struct dma_attrs *attrs) hexagon_map_sg() argument
143 dma_sync(void *addr, size_t size, enum dma_data_direction dir) dma_sync() argument
183 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
199 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
206 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.1.27/net/xfrm/
H A Dxfrm_policy.c58 static void __xfrm_policy_link(struct xfrm_policy *pol, int dir);
60 int dir);
182 int dir; xfrm_policy_timer() local
189 dir = xfrm_policy_id2dir(xp->index); xfrm_policy_timer()
229 km_policy_expired(xp, dir, 0, 0); xfrm_policy_timer()
241 if (!xfrm_policy_delete(xp, dir)) xfrm_policy_timer()
242 km_policy_expired(xp, dir, 1, 0); xfrm_policy_timer()
355 unsigned short family, int dir, __get_hash_thresh()
360 *dbits = net->xfrm.policy_bydst[dir].dbits4; __get_hash_thresh()
361 *sbits = net->xfrm.policy_bydst[dir].sbits4; __get_hash_thresh()
365 *dbits = net->xfrm.policy_bydst[dir].dbits6; __get_hash_thresh()
366 *sbits = net->xfrm.policy_bydst[dir].sbits6; __get_hash_thresh()
377 unsigned short family, int dir) policy_hash_bysel()
379 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; policy_hash_bysel()
384 __get_hash_thresh(net, family, dir, &dbits, &sbits); policy_hash_bysel()
388 &net->xfrm.policy_inexact[dir] : policy_hash_bysel()
389 net->xfrm.policy_bydst[dir].table + hash); policy_hash_bysel()
395 unsigned short family, int dir) policy_hash_direct()
397 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; policy_hash_direct()
402 __get_hash_thresh(net, family, dir, &dbits, &sbits); policy_hash_direct()
405 return net->xfrm.policy_bydst[dir].table + hash; policy_hash_direct()
412 int dir) xfrm_dst_hash_transfer()
424 __get_hash_thresh(net, pol->family, dir, &dbits, &sbits); hlist_for_each_entry_safe()
465 static void xfrm_bydst_resize(struct net *net, int dir) xfrm_bydst_resize() argument
467 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; xfrm_bydst_resize()
470 struct hlist_head *odst = net->xfrm.policy_bydst[dir].table; xfrm_bydst_resize()
480 xfrm_dst_hash_transfer(net, odst + i, ndst, nhashmask, dir); xfrm_bydst_resize()
482 net->xfrm.policy_bydst[dir].table = ndst; xfrm_bydst_resize()
483 net->xfrm.policy_bydst[dir].hmask = nhashmask; xfrm_bydst_resize()
515 static inline int xfrm_bydst_should_resize(struct net *net, int dir, int *total) xfrm_bydst_should_resize() argument
517 unsigned int cnt = net->xfrm.policy_count[dir]; xfrm_bydst_should_resize()
518 unsigned int hmask = net->xfrm.policy_bydst[dir].hmask; xfrm_bydst_should_resize()
560 int dir, total; xfrm_hash_resize() local
565 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_hash_resize()
566 if (xfrm_bydst_should_resize(net, dir, &total)) xfrm_hash_resize()
567 xfrm_bydst_resize(net, dir); xfrm_hash_resize()
586 int dir; xfrm_hash_rebuild() local
605 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_hash_rebuild()
606 INIT_HLIST_HEAD(&net->xfrm.policy_inexact[dir]); xfrm_hash_rebuild()
607 hmask = net->xfrm.policy_bydst[dir].hmask; xfrm_hash_rebuild()
608 odst = net->xfrm.policy_bydst[dir].table; xfrm_hash_rebuild()
611 if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) { xfrm_hash_rebuild()
612 /* dir out => dst = remote, src = local */ xfrm_hash_rebuild()
613 net->xfrm.policy_bydst[dir].dbits4 = rbits4; xfrm_hash_rebuild()
614 net->xfrm.policy_bydst[dir].sbits4 = lbits4; xfrm_hash_rebuild()
615 net->xfrm.policy_bydst[dir].dbits6 = rbits6; xfrm_hash_rebuild()
616 net->xfrm.policy_bydst[dir].sbits6 = lbits6; xfrm_hash_rebuild()
618 /* dir in/fwd => dst = local, src = remote */ xfrm_hash_rebuild()
619 net->xfrm.policy_bydst[dir].dbits4 = lbits4; xfrm_hash_rebuild()
620 net->xfrm.policy_bydst[dir].sbits4 = rbits4; xfrm_hash_rebuild()
621 net->xfrm.policy_bydst[dir].dbits6 = lbits6; xfrm_hash_rebuild()
622 net->xfrm.policy_bydst[dir].sbits6 = rbits6; xfrm_hash_rebuild()
657 static u32 xfrm_gen_index(struct net *net, int dir, u32 index) xfrm_gen_index() argument
668 idx = (idx_generator | dir); xfrm_gen_index()
747 int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) xfrm_policy_insert() argument
756 chain = policy_hash_bysel(net, &policy->selector, policy->family, dir); xfrm_policy_insert()
783 __xfrm_policy_link(policy, dir);
794 __xfrm_policy_unlink(delpol, dir);
796 policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir, policy->index);
806 else if (xfrm_bydst_should_resize(net, dir, NULL))
814 int dir, struct xfrm_selector *sel, xfrm_policy_bysel_ctx()
823 chain = policy_hash_bysel(net, sel, sel->family, dir); xfrm_policy_bysel_ctx()
838 __xfrm_policy_unlink(pol, dir); hlist_for_each_entry()
853 int dir, u32 id, int delete, int *err) xfrm_policy_byid()
859 if (xfrm_policy_id2dir(id) != dir) xfrm_policy_byid()
877 __xfrm_policy_unlink(pol, dir); hlist_for_each_entry()
895 int dir, err = 0; xfrm_policy_flush_secctx_check() local
897 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_flush_secctx_check()
902 &net->xfrm.policy_inexact[dir], bydst) { xfrm_policy_flush_secctx_check()
911 for (i = net->xfrm.policy_bydst[dir].hmask; i >= 0; i--) { xfrm_policy_flush_secctx_check()
913 net->xfrm.policy_bydst[dir].table + i, xfrm_policy_flush_secctx_check()
939 int dir, err = 0, cnt = 0; xfrm_policy_flush() local
947 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_flush()
953 &net->xfrm.policy_inexact[dir], bydst) { xfrm_policy_flush()
956 __xfrm_policy_unlink(pol, dir); xfrm_policy_flush()
968 for (i = net->xfrm.policy_bydst[dir].hmask; i >= 0; i--) { xfrm_policy_flush()
971 net->xfrm.policy_bydst[dir].table + i, xfrm_policy_flush()
975 __xfrm_policy_unlink(pol, dir); xfrm_policy_flush()
1069 u8 type, u16 family, int dir) xfrm_policy_match()
1083 dir); xfrm_policy_match()
1090 u16 family, u8 dir) xfrm_policy_lookup_bytype()
1104 chain = policy_hash_direct(net, daddr, saddr, family, dir); xfrm_policy_lookup_bytype()
1107 err = xfrm_policy_match(pol, fl, type, family, dir); hlist_for_each_entry()
1121 chain = &net->xfrm.policy_inexact[dir]; hlist_for_each_entry()
1123 err = xfrm_policy_match(pol, fl, type, family, dir); hlist_for_each_entry()
1145 __xfrm_policy_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir) __xfrm_policy_lookup() argument
1150 pol = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_SUB, fl, family, dir); __xfrm_policy_lookup()
1154 return xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, fl, family, dir); __xfrm_policy_lookup()
1157 static int flow_to_policy_dir(int dir) flow_to_policy_dir() argument
1162 return dir; flow_to_policy_dir()
1164 switch (dir) { flow_to_policy_dir()
1177 u8 dir, struct flow_cache_object *old_obj, void *ctx) xfrm_policy_lookup()
1184 pol = __xfrm_policy_lookup(net, fl, family, flow_to_policy_dir(dir)); xfrm_policy_lookup()
1195 static inline int policy_to_flow_dir(int dir) policy_to_flow_dir() argument
1200 return dir; policy_to_flow_dir()
1201 switch (dir) { policy_to_flow_dir()
1212 static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, xfrm_sk_policy_lookup() argument
1219 if ((pol = sk->sk_policy[dir]) != NULL) { xfrm_sk_policy_lookup()
1231 policy_to_flow_dir(dir)); xfrm_sk_policy_lookup()
1246 static void __xfrm_policy_link(struct xfrm_policy *pol, int dir) __xfrm_policy_link() argument
1251 net->xfrm.policy_count[dir]++; __xfrm_policy_link()
1256 int dir) __xfrm_policy_unlink()
1270 net->xfrm.policy_count[dir]--; __xfrm_policy_unlink()
1275 static void xfrm_sk_policy_link(struct xfrm_policy *pol, int dir) xfrm_sk_policy_link() argument
1277 __xfrm_policy_link(pol, XFRM_POLICY_MAX + dir); xfrm_sk_policy_link()
1280 static void xfrm_sk_policy_unlink(struct xfrm_policy *pol, int dir) xfrm_sk_policy_unlink() argument
1282 __xfrm_policy_unlink(pol, XFRM_POLICY_MAX + dir); xfrm_sk_policy_unlink()
1285 int xfrm_policy_delete(struct xfrm_policy *pol, int dir) xfrm_policy_delete() argument
1290 pol = __xfrm_policy_unlink(pol, dir); xfrm_policy_delete()
1300 int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol) xfrm_sk_policy_insert() argument
1311 old_pol = sk->sk_policy[dir]; xfrm_sk_policy_insert()
1312 sk->sk_policy[dir] = pol; xfrm_sk_policy_insert()
1315 pol->index = xfrm_gen_index(net, XFRM_POLICY_MAX+dir, 0); xfrm_sk_policy_insert()
1316 xfrm_sk_policy_link(pol, dir); xfrm_sk_policy_insert()
1325 xfrm_sk_policy_unlink(old_pol, dir); xfrm_sk_policy_insert()
1335 static struct xfrm_policy *clone_policy(const struct xfrm_policy *old, int dir) clone_policy() argument
1358 xfrm_sk_policy_link(newp, dir); clone_policy()
2064 xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir, xfrm_bundle_lookup() argument
2097 flow_to_policy_dir(dir)); xfrm_bundle_lookup()
2196 u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); xfrm_lookup() local
2247 flo = flow_cache_lookup(net, fl, family, dir, xfrm_lookup()
2443 int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, __xfrm_policy_check() argument
2457 reverse = dir & ~XFRM_POLICY_MASK; __xfrm_policy_check()
2458 dir &= XFRM_POLICY_MASK; __xfrm_policy_check()
2459 fl_dir = policy_to_flow_dir(dir); __xfrm_policy_check()
2482 if (sk && sk->sk_policy[dir]) { __xfrm_policy_check()
2483 pol = xfrm_sk_policy_lookup(sk, dir, &fl); __xfrm_policy_check()
2921 int dir; xfrm_policy_init() local
2937 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_init()
2940 net->xfrm.policy_count[dir] = 0; xfrm_policy_init()
2941 net->xfrm.policy_count[XFRM_POLICY_MAX + dir] = 0; xfrm_policy_init()
2942 INIT_HLIST_HEAD(&net->xfrm.policy_inexact[dir]); xfrm_policy_init()
2944 htab = &net->xfrm.policy_bydst[dir]; xfrm_policy_init()
2969 for (dir--; dir >= 0; dir--) { xfrm_policy_init()
2972 htab = &net->xfrm.policy_bydst[dir]; xfrm_policy_init()
2983 int dir; xfrm_policy_fini() local
2993 for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { xfrm_policy_fini()
2996 WARN_ON(!hlist_empty(&net->xfrm.policy_inexact[dir])); xfrm_policy_fini()
2998 htab = &net->xfrm.policy_bydst[dir]; xfrm_policy_fini()
3156 u8 dir, u8 type, struct net *net) xfrm_migrate_policy_find()
3163 chain = policy_hash_direct(net, &sel->daddr, &sel->saddr, sel->family, dir); hlist_for_each_entry()
3172 chain = &net->xfrm.policy_inexact[dir]; hlist_for_each_entry()
3294 int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, xfrm_migrate() argument
3309 if ((pol = xfrm_migrate_policy_find(sel, dir, type, net)) == NULL) { xfrm_migrate()
3340 km_migrate(sel, dir, type, m, num_migrate, k); xfrm_migrate()
354 __get_hash_thresh(struct net *net, unsigned short family, int dir, u8 *dbits, u8 *sbits) __get_hash_thresh() argument
375 policy_hash_bysel(struct net *net, const struct xfrm_selector *sel, unsigned short family, int dir) policy_hash_bysel() argument
392 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
408 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
813 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
852 xfrm_policy_byid(struct net *net, u32 mark, u8 type, int dir, u32 id, int delete, int *err) xfrm_policy_byid() argument
1067 xfrm_policy_match(const struct xfrm_policy *pol, const struct flowi *fl, u8 type, u16 family, int dir) xfrm_policy_match() argument
1088 xfrm_policy_lookup_bytype(struct net *net, u8 type, const struct flowi *fl, u16 family, u8 dir) xfrm_policy_lookup_bytype() argument
1176 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
1255 __xfrm_policy_unlink(struct xfrm_policy *pol, int dir) __xfrm_policy_unlink() argument
3155 xfrm_migrate_policy_find(const struct xfrm_selector *sel, u8 dir, u8 type, struct net *net) xfrm_migrate_policy_find() argument
/linux-4.1.27/fs/pstore/
H A Dftrace.c109 struct dentry *dir; pstore_register_ftrace() local
115 dir = debugfs_create_dir("pstore", NULL); pstore_register_ftrace()
116 if (!dir) { pstore_register_ftrace()
121 file = debugfs_create_file("record_ftrace", 0600, dir, NULL, pstore_register_ftrace()
130 debugfs_remove(dir); pstore_register_ftrace()
/linux-4.1.27/arch/s390/oprofile/
H A Dinit.c366 struct dentry *dir; oprofile_create_hwsampling_files() local
368 dir = oprofilefs_mkdir(root, "timer"); oprofile_create_hwsampling_files()
369 if (!dir) oprofile_create_hwsampling_files()
372 oprofilefs_create_file(dir, "enabled", &timer_enabled_fops); oprofile_create_hwsampling_files()
393 dir = oprofilefs_mkdir(root, "0"); oprofile_create_hwsampling_files()
394 if (!dir) oprofile_create_hwsampling_files()
397 oprofilefs_create_file(dir, "enabled", &hwsampler_fops); oprofile_create_hwsampling_files()
398 oprofilefs_create_file(dir, "event", &zero_fops); oprofile_create_hwsampling_files()
399 oprofilefs_create_file(dir, "count", &hw_interval_fops); oprofile_create_hwsampling_files()
400 oprofilefs_create_file(dir, "unit_mask", &zero_fops); oprofile_create_hwsampling_files()
401 oprofilefs_create_file(dir, "kernel", &kernel_fops); oprofile_create_hwsampling_files()
402 oprofilefs_create_file(dir, "user", &user_fops); oprofile_create_hwsampling_files()
403 oprofilefs_create_ulong(dir, "hw_sdbt_blocks", oprofile_create_hwsampling_files()
413 dir = oprofilefs_mkdir(root, "hwsampling"); oprofile_create_hwsampling_files()
414 if (!dir) oprofile_create_hwsampling_files()
417 oprofilefs_create_file(dir, "hwsampler", oprofile_create_hwsampling_files()
419 oprofilefs_create_file(dir, "hw_interval", oprofile_create_hwsampling_files()
421 oprofilefs_create_ro_ulong(dir, "hw_min_interval", oprofile_create_hwsampling_files()
423 oprofilefs_create_ro_ulong(dir, "hw_max_interval", oprofile_create_hwsampling_files()
425 oprofilefs_create_ulong(dir, "hw_sdbt_blocks", oprofile_create_hwsampling_files()
/linux-4.1.27/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.1.27/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.1.27/drivers/xen/
H A Dswiotlb-xen.c387 enum dma_data_direction dir, xen_swiotlb_map_page()
393 BUG_ON(dir == DMA_NONE); xen_swiotlb_map_page()
406 xen_dma_map_page(dev, page, dev_addr, offset, size, dir, attrs); xen_swiotlb_map_page()
415 map = swiotlb_tbl_map_single(dev, start_dma_addr, phys, size, dir); xen_swiotlb_map_page()
420 dev_addr, map & ~PAGE_MASK, size, dir, attrs); xen_swiotlb_map_page()
427 swiotlb_tbl_unmap_single(dev, map, size, dir); xen_swiotlb_map_page()
443 size_t size, enum dma_data_direction dir, xen_unmap_single()
448 BUG_ON(dir == DMA_NONE); xen_unmap_single()
450 xen_dma_unmap_page(hwdev, dev_addr, size, dir, attrs); xen_unmap_single()
454 swiotlb_tbl_unmap_single(hwdev, paddr, size, dir); xen_unmap_single()
458 if (dir != DMA_FROM_DEVICE) xen_unmap_single()
471 size_t size, enum dma_data_direction dir, xen_swiotlb_unmap_page()
474 xen_unmap_single(hwdev, dev_addr, size, dir, attrs); xen_swiotlb_unmap_page()
490 size_t size, enum dma_data_direction dir, xen_swiotlb_sync_single()
495 BUG_ON(dir == DMA_NONE); xen_swiotlb_sync_single()
498 xen_dma_sync_single_for_cpu(hwdev, dev_addr, size, dir); xen_swiotlb_sync_single()
502 swiotlb_tbl_sync_single(hwdev, paddr, size, dir, target); xen_swiotlb_sync_single()
505 xen_dma_sync_single_for_device(hwdev, dev_addr, size, dir); xen_swiotlb_sync_single()
507 if (dir != DMA_FROM_DEVICE) xen_swiotlb_sync_single()
515 size_t size, enum dma_data_direction dir) xen_swiotlb_sync_single_for_cpu()
517 xen_swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_CPU); xen_swiotlb_sync_single_for_cpu()
523 size_t size, enum dma_data_direction dir) xen_swiotlb_sync_single_for_device()
525 xen_swiotlb_sync_single(hwdev, dev_addr, size, dir, SYNC_FOR_DEVICE); xen_swiotlb_sync_single_for_device()
547 int nelems, enum dma_data_direction dir, xen_swiotlb_map_sg_attrs()
553 BUG_ON(dir == DMA_NONE); xen_swiotlb_map_sg_attrs()
567 dir); for_each_sg()
572 xen_swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir, for_each_sg()
581 dir, for_each_sg()
592 dir, for_each_sg()
608 int nelems, enum dma_data_direction dir, xen_swiotlb_unmap_sg_attrs()
614 BUG_ON(dir == DMA_NONE); xen_swiotlb_unmap_sg_attrs()
617 xen_unmap_single(hwdev, sg->dma_address, sg_dma_len(sg), dir, attrs); xen_swiotlb_unmap_sg_attrs()
631 int nelems, enum dma_data_direction dir, xen_swiotlb_sync_sg()
639 sg_dma_len(sg), dir, target); xen_swiotlb_sync_sg()
644 int nelems, enum dma_data_direction dir) xen_swiotlb_sync_sg_for_cpu()
646 xen_swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_CPU); xen_swiotlb_sync_sg_for_cpu()
652 int nelems, enum dma_data_direction dir) xen_swiotlb_sync_sg_for_device()
654 xen_swiotlb_sync_sg(hwdev, sg, nelems, dir, SYNC_FOR_DEVICE); xen_swiotlb_sync_sg_for_device()
385 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
442 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
470 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
489 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
514 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
522 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
546 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
607 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
630 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
643 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
651 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.1.27/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.1.27/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.1.27/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.1.27/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.1.27/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.1.27/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()
1324 * @dir: inode to create special file in
1331 static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, v9fs_vfs_mkspecial() argument
1337 v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_mkspecial()
1343 fid = v9fs_create(v9ses, dir, dentry, (char *) extension, perm, v9fs_vfs_mkspecial()
1348 v9fs_invalidate_inode_attr(dir); v9fs_vfs_mkspecial()
1355 * @dir: directory inode containing symlink
1364 v9fs_vfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) v9fs_vfs_symlink() argument
1367 dir->i_ino, dentry, symname); v9fs_vfs_symlink()
1369 return v9fs_vfs_mkspecial(dir, dentry, P9_DMSYMLINK, symname); v9fs_vfs_symlink()
1375 * @dir: inode destination for new link
1381 v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, v9fs_vfs_link() argument
1389 dir->i_ino, dentry, old_dentry); v9fs_vfs_link()
1402 retval = v9fs_vfs_mkspecial(dir, dentry, P9_DMLINK, name); v9fs_vfs_link()
1406 v9fs_invalidate_inode_attr(dir); v9fs_vfs_link()
1415 * @dir: inode destination for new link
1423 v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) v9fs_vfs_mknod() argument
1425 struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir); v9fs_vfs_mknod()
1431 dir->i_ino, dentry, mode, v9fs_vfs_mknod()
1455 retval = v9fs_vfs_mkspecial(dir, dentry, perm, name); v9fs_vfs_mknod()
/linux-4.1.27/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.1.27/kernel/trace/
H A Dtrace_events.c452 static void __get_system_dir(struct ftrace_subsystem_dir *dir) __get_system_dir() argument
454 WARN_ON_ONCE(dir->ref_count == 0); __get_system_dir()
455 dir->ref_count++; __get_system_dir()
456 __get_system(dir->subsystem); __get_system_dir()
459 static void __put_system_dir(struct ftrace_subsystem_dir *dir) __put_system_dir() argument
461 WARN_ON_ONCE(dir->ref_count == 0); __put_system_dir()
462 /* If the subsystem is about to be freed, the dir must be too */ __put_system_dir()
463 WARN_ON_ONCE(system_refcount(dir->subsystem) == 1 && dir->ref_count != 1); __put_system_dir()
465 __put_system(dir->subsystem); __put_system_dir()
466 if (!--dir->ref_count) __put_system_dir()
467 kfree(dir); __put_system_dir()
470 static void put_system(struct ftrace_subsystem_dir *dir) put_system() argument
473 __put_system_dir(dir); put_system()
477 static void remove_subsystem(struct ftrace_subsystem_dir *dir) remove_subsystem() argument
479 if (!dir) remove_subsystem()
482 if (!--dir->nr_events) { remove_subsystem()
483 tracefs_remove_recursive(dir->entry); remove_subsystem()
484 list_del(&dir->list); remove_subsystem()
485 __put_system_dir(dir); remove_subsystem()
491 struct dentry *dir = file->dir; remove_event_file_dir() local
494 if (dir) { remove_event_file_dir()
495 spin_lock(&dir->d_lock); /* probably unneeded */ remove_event_file_dir()
496 list_for_each_entry(child, &dir->d_subdirs, d_child) { remove_event_file_dir()
500 spin_unlock(&dir->d_lock); remove_event_file_dir()
502 tracefs_remove_recursive(dir); remove_event_file_dir()
832 struct ftrace_subsystem_dir *dir = filp->private_data; system_enable_read() local
833 struct event_subsystem *system = dir->subsystem; system_enable_read()
836 struct trace_array *tr = dir->tr; system_enable_read()
877 struct ftrace_subsystem_dir *dir = filp->private_data; system_enable_write() local
878 struct event_subsystem *system = dir->subsystem; system_enable_write()
901 ret = __ftrace_set_clr_event(dir->tr, NULL, name, NULL, val); system_enable_write()
1136 struct ftrace_subsystem_dir *dir = NULL; /* Initialize for gcc */ subsystem_open() local
1147 list_for_each_entry(dir, &tr->systems, list) { subsystem_open()
1148 if (dir == inode->i_private) { subsystem_open()
1150 if (dir->nr_events) { subsystem_open()
1151 __get_system_dir(dir); subsystem_open()
1152 system = dir->subsystem; subsystem_open()
1165 /* Some versions of gcc think dir can be uninitialized here */ subsystem_open()
1166 WARN_ON(!dir); subsystem_open()
1170 put_system(dir); subsystem_open()
1177 put_system(dir); subsystem_open()
1185 struct ftrace_subsystem_dir *dir; system_tr_open() local
1195 /* Make a temporary dir that has no system but points to tr */ system_tr_open()
1196 dir = kzalloc(sizeof(*dir), GFP_KERNEL); system_tr_open()
1197 if (!dir) { system_tr_open()
1202 dir->tr = tr; system_tr_open()
1207 kfree(dir); system_tr_open()
1211 filp->private_data = dir; system_tr_open()
1218 struct ftrace_subsystem_dir *dir = file->private_data; subsystem_release() local
1220 trace_array_put(dir->tr); subsystem_release()
1223 * If dir->subsystem is NULL, then this is a temporary subsystem_release()
1227 if (dir->subsystem) subsystem_release()
1228 put_system(dir); subsystem_release()
1230 kfree(dir); subsystem_release()
1239 struct ftrace_subsystem_dir *dir = filp->private_data; subsystem_filter_read() local
1240 struct event_subsystem *system = dir->subsystem; subsystem_filter_read()
1266 struct ftrace_subsystem_dir *dir = filp->private_data; subsystem_filter_write() local
1283 err = apply_subsystem_event_filter(dir, buf); subsystem_filter_write()
1503 struct ftrace_subsystem_dir *dir; event_subsystem_dir() local
1507 /* First see if we did not already create this dir */ event_subsystem_dir()
1508 list_for_each_entry(dir, &tr->systems, list) { event_subsystem_dir()
1509 system = dir->subsystem; event_subsystem_dir()
1511 dir->nr_events++; event_subsystem_dir()
1512 file->system = dir; event_subsystem_dir()
1513 return dir->entry; event_subsystem_dir()
1526 dir = kmalloc(sizeof(*dir), GFP_KERNEL); event_subsystem_dir()
1527 if (!dir) event_subsystem_dir()
1537 dir->entry = tracefs_create_dir(name, parent); event_subsystem_dir()
1538 if (!dir->entry) { event_subsystem_dir()
1544 dir->tr = tr; event_subsystem_dir()
1545 dir->ref_count = 1; event_subsystem_dir()
1546 dir->nr_events = 1; event_subsystem_dir()
1547 dir->subsystem = system; event_subsystem_dir()
1548 file->system = dir; event_subsystem_dir()
1550 entry = tracefs_create_file("filter", 0644, dir->entry, dir, event_subsystem_dir()
1558 trace_create_file("enable", 0644, dir->entry, dir, event_subsystem_dir()
1561 list_add(&dir->list, &tr->systems); event_subsystem_dir()
1563 return dir->entry; event_subsystem_dir()
1566 kfree(dir); event_subsystem_dir()
1569 if (!dir || !system) event_subsystem_dir()
1596 file->dir = tracefs_create_dir(name, d_events); event_create_dir()
1597 if (!file->dir) { event_create_dir()
1603 trace_create_file("enable", 0644, file->dir, file, event_create_dir()
1608 trace_create_file("id", 0444, file->dir, event_create_dir()
1626 trace_create_file("filter", 0644, file->dir, file, event_create_dir()
1634 trace_create_file("trigger", 0644, file->dir, file, event_create_dir()
1637 trace_create_file("format", 0444, file->dir, call, event_create_dir()
2763 struct ftrace_subsystem_dir *dir; event_trace_self_tests() local
2819 list_for_each_entry(dir, &tr->systems, list) { event_trace_self_tests()
2821 system = dir->subsystem; event_trace_self_tests()
/linux-4.1.27/drivers/crypto/
H A Dixp4xx_crypto.c111 enum dma_data_direction dir; member in struct:buffer_desc
327 dma_unmap_single(dev, buf->phys_next, buf->buf_len, buf->dir); free_buf_chain()
531 static void reset_sa_dir(struct ix_sa_dir *dir) reset_sa_dir() argument
533 memset(dir->npe_ctx, 0, NPE_CTX_LEN); reset_sa_dir()
534 dir->npe_ctx_idx = 0; reset_sa_dir()
535 dir->npe_mode = 0; reset_sa_dir()
538 static int init_sa_dir(struct ix_sa_dir *dir) init_sa_dir() argument
540 dir->npe_ctx = dma_pool_alloc(ctx_pool, GFP_KERNEL, &dir->npe_ctx_phys); init_sa_dir()
541 if (!dir->npe_ctx) { init_sa_dir()
544 reset_sa_dir(dir); init_sa_dir()
548 static void free_sa_dir(struct ix_sa_dir *dir) free_sa_dir() argument
550 memset(dir->npe_ctx, 0, NPE_CTX_LEN); free_sa_dir()
551 dma_pool_free(ctx_pool, dir->npe_ctx, dir->npe_ctx_phys); free_sa_dir()
652 struct ix_sa_dir *dir; setup_auth() local
656 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; setup_auth()
657 cinfo = dir->npe_ctx + dir->npe_ctx_idx; setup_auth()
672 itarget = dir->npe_ctx_phys + dir->npe_ctx_idx setup_auth()
675 init_len = cinfo - (dir->npe_ctx + dir->npe_ctx_idx); setup_auth()
676 npe_ctx_addr = dir->npe_ctx_phys + dir->npe_ctx_idx; setup_auth()
678 dir->npe_ctx_idx += init_len; setup_auth()
679 dir->npe_mode |= NPE_OP_HASH_ENABLE; setup_auth()
682 dir->npe_mode |= NPE_OP_HASH_VERIFY; setup_auth()
696 struct ix_sa_dir *dir = &ctx->decrypt; gen_rev_aes_key() local
702 *(u32*)dir->npe_ctx |= cpu_to_be32(CIPH_ENCR); gen_rev_aes_key()
708 crypt->crypto_ctx = dir->npe_ctx_phys; gen_rev_aes_key()
709 crypt->icv_rev_aes = dir->npe_ctx_phys + sizeof(u32); gen_rev_aes_key()
711 crypt->init_len = dir->npe_ctx_idx; gen_rev_aes_key()
726 struct ix_sa_dir *dir; setup_cipher() local
730 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; setup_cipher()
731 cinfo = dir->npe_ctx; setup_cipher()
735 dir->npe_mode |= NPE_OP_CRYPT_ENCRYPT; setup_cipher()
774 dir->npe_ctx_idx = sizeof(cipher_cfg) + key_len; setup_cipher()
775 dir->npe_mode |= NPE_OP_CRYPT_ENABLE; setup_cipher()
785 enum dma_data_direction dir) chainup_buffers()
800 sg_dma_address(sg) = dma_map_single(dev, ptr, len, dir); chainup_buffers()
807 buf->dir = dir; chainup_buffers()
871 struct ix_sa_dir *dir; ablk_perform() local
886 dir = encrypt ? &ctx->encrypt : &ctx->decrypt; ablk_perform()
893 crypt->crypto_ctx = dir->npe_ctx_phys; ablk_perform()
894 crypt->mode = dir->npe_mode; ablk_perform()
895 crypt->init_len = dir->npe_ctx_idx; ablk_perform()
996 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()
782 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.1.27/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.1.27/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.1.27/drivers/crypto/qce/
H A Ddma.c58 enum dma_data_direction dir, bool chained) qce_mapsg()
64 err = dma_map_sg(dev, sg, 1, dir); qce_mapsg()
70 err = dma_map_sg(dev, sg, nents, dir); qce_mapsg()
79 enum dma_data_direction dir, bool chained) qce_unmapsg()
83 dma_unmap_sg(dev, sg, 1, dir); qce_unmapsg()
87 dma_unmap_sg(dev, sg, nents, dir); qce_unmapsg()
136 enum dma_transfer_direction dir, qce_dma_prep_sg()
145 desc = dmaengine_prep_slave_sg(chan, sg, nents, dir, flags); qce_dma_prep_sg()
57 qce_mapsg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, bool chained) qce_mapsg() argument
78 qce_unmapsg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir, bool chained) qce_unmapsg() argument
134 qce_dma_prep_sg(struct dma_chan *chan, struct scatterlist *sg, int nents, unsigned long flags, enum dma_transfer_direction dir, dma_async_tx_callback cb, void *cb_param) qce_dma_prep_sg() argument
/linux-4.1.27/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.1.27/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.1.27/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.1.27/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.1.27/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.1.27/fs/jffs2/
H A DMakefile8 jffs2-y := compr.o dir.o file.o ioctl.o nodelist.o malloc.o
/linux-4.1.27/arch/mips/include/asm/
H A Dtxx9pio.h17 __u32 dir; member in struct:txx9_pio_reg
/linux-4.1.27/drivers/gpu/drm/exynos/
H A Dexynos_drm_dmabuf.c22 enum dma_data_direction dir; member in struct:exynos_drm_dmabuf_attachment
41 exynos_attach->dir = DMA_NONE; exynos_gem_attach_dma_buf()
58 if (exynos_attach->dir != DMA_NONE) exynos_gem_detach_dma_buf()
60 exynos_attach->dir); exynos_gem_detach_dma_buf()
69 enum dma_data_direction dir) exynos_gem_map_dma_buf()
81 if (exynos_attach->dir == dir && exynos_attach->is_mapped) exynos_gem_map_dma_buf()
108 if (dir != DMA_NONE) { exynos_gem_map_dma_buf()
109 nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); exynos_gem_map_dma_buf()
119 exynos_attach->dir = dir; exynos_gem_map_dma_buf()
131 enum dma_data_direction dir) exynos_gem_unmap_dma_buf()
68 exynos_gem_map_dma_buf(struct dma_buf_attachment *attach, enum dma_data_direction dir) exynos_gem_map_dma_buf() argument
129 exynos_gem_unmap_dma_buf(struct dma_buf_attachment *attach, struct sg_table *sgt, enum dma_data_direction dir) exynos_gem_unmap_dma_buf() argument

Completed in 4173 milliseconds

12345678