/fs/hfsplus/ |
D | bfind.c | 15 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument 19 fd->tree = tree; in hfs_find_init() 20 fd->bnode = NULL; in hfs_find_init() 24 fd->search_key = ptr; in hfs_find_init() 25 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init() 44 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument 46 hfs_bnode_put(fd->bnode); in hfs_find_exit() 47 kfree(fd->search_key); in hfs_find_exit() 49 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit() 50 mutex_unlock(&fd->tree->tree_lock); in hfs_find_exit() [all …]
|
D | brec.c | 15 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd); 16 static int hfs_brec_update_parent(struct hfs_find_data *fd); 63 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) in hfs_brec_insert() argument 72 tree = fd->tree; in hfs_brec_insert() 73 if (!fd->bnode) { in hfs_brec_insert() 79 fd->bnode = node; in hfs_brec_insert() 80 fd->record = -1; in hfs_brec_insert() 83 key_len = be16_to_cpu(fd->search_key->key_len) + 2; in hfs_brec_insert() 86 rec = fd->record + 1; in hfs_brec_insert() 89 node = fd->bnode; in hfs_brec_insert() [all …]
|
D | attributes.c | 138 const char *name, struct hfs_find_data *fd) in hfsplus_find_attr() argument 150 err = hfsplus_attr_build_key(sb, fd->search_key, cnid, name); in hfsplus_find_attr() 153 err = hfs_brec_find(fd, hfs_find_rec_by_key); in hfsplus_find_attr() 157 err = hfsplus_attr_build_key(sb, fd->search_key, cnid, NULL); in hfsplus_find_attr() 160 err = hfs_brec_find(fd, hfs_find_1st_rec_by_cnid); in hfsplus_find_attr() 173 struct hfs_find_data fd; in hfsplus_attr_exists() local 178 err = hfs_find_init(HFSPLUS_SB(sb)->attr_tree, &fd); in hfsplus_attr_exists() 182 err = hfsplus_find_attr(sb, inode->i_ino, name, &fd); in hfsplus_attr_exists() 186 hfs_find_exit(&fd); in hfsplus_attr_exists() 190 hfs_find_exit(&fd); in hfsplus_attr_exists() [all …]
|
D | catalog.c | 195 struct hfs_find_data *fd) in hfsplus_find_cat() argument 201 hfsplus_cat_build_key_with_cnid(sb, fd->search_key, cnid); in hfsplus_find_cat() 202 err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry)); in hfsplus_find_cat() 217 hfsplus_cat_build_key_uni(fd->search_key, in hfsplus_find_cat() 220 return hfs_brec_find(fd, hfs_find_rec_by_key); in hfsplus_find_cat() 257 struct hfs_find_data fd; in hfsplus_create_cat() local 264 err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); in hfsplus_create_cat() 272 err = hfs_bmap_reserve(fd.tree, 2 * fd.tree->depth); in hfsplus_create_cat() 276 hfsplus_cat_build_key_with_cnid(sb, fd.search_key, cnid); in hfsplus_create_cat() 286 err = hfs_brec_find(&fd, hfs_find_rec_by_key); in hfsplus_create_cat() [all …]
|
D | extents.c | 88 struct hfs_find_data *fd) in __hfsplus_ext_write_extent() argument 95 hfsplus_ext_build_key(fd->search_key, inode->i_ino, hip->cached_start, in __hfsplus_ext_write_extent() 99 res = hfs_brec_find(fd, hfs_find_rec_by_key); in __hfsplus_ext_write_extent() 104 res = hfs_bmap_reserve(fd->tree, fd->tree->depth + 1); in __hfsplus_ext_write_extent() 107 hfs_brec_insert(fd, hip->cached_extents, in __hfsplus_ext_write_extent() 113 hfs_bnode_write(fd->bnode, hip->cached_extents, in __hfsplus_ext_write_extent() 114 fd->entryoffset, fd->entrylength); in __hfsplus_ext_write_extent() 134 struct hfs_find_data fd; in hfsplus_ext_write_extent_locked() local 136 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->ext_tree, &fd); in hfsplus_ext_write_extent_locked() 139 res = __hfsplus_ext_write_extent(inode, &fd); in hfsplus_ext_write_extent_locked() [all …]
|
D | dir.c | 34 struct hfs_find_data fd; in hfsplus_lookup() local 44 err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd); in hfsplus_lookup() 47 err = hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, in hfsplus_lookup() 52 err = hfs_brec_read(&fd, &entry, sizeof(entry)); in hfsplus_lookup() 55 hfs_find_exit(&fd); in hfsplus_lookup() 64 if (fd.entrylength < sizeof(struct hfsplus_cat_folder)) { in hfsplus_lookup() 71 if (fd.entrylength < sizeof(struct hfsplus_cat_file)) { in hfsplus_lookup() 103 err = hfsplus_cat_build_key(sb, fd.search_key, in hfsplus_lookup() 117 hfs_find_exit(&fd); in hfsplus_lookup() 126 hfs_find_exit(&fd); in hfsplus_lookup() [all …]
|
D | xattr.c | 444 struct hfs_find_data fd; in hfsplus_getxattr_finder_info() local 453 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd); in hfsplus_getxattr_finder_info() 458 res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd); in hfsplus_getxattr_finder_info() 461 entry_type = hfs_bnode_read_u16(fd.bnode, fd.entryoffset); in hfsplus_getxattr_finder_info() 464 hfs_bnode_read(fd.bnode, folder_finder_info, in hfsplus_getxattr_finder_info() 465 fd.entryoffset + in hfsplus_getxattr_finder_info() 471 hfs_bnode_read(fd.bnode, file_finder_info, in hfsplus_getxattr_finder_info() 472 fd.entryoffset + in hfsplus_getxattr_finder_info() 486 hfs_find_exit(&fd); in hfsplus_getxattr_finder_info() 493 struct hfs_find_data fd; in __hfsplus_getxattr() local [all …]
|
D | inode.c | 488 int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) in hfsplus_cat_read_inode() argument 494 type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset); in hfsplus_cat_read_inode() 500 if (fd->entrylength < sizeof(struct hfsplus_cat_folder)) { in hfsplus_cat_read_inode() 505 hfs_bnode_read(fd->bnode, &entry, fd->entryoffset, in hfsplus_cat_read_inode() 524 if (fd->entrylength < sizeof(struct hfsplus_cat_file)) { in hfsplus_cat_read_inode() 529 hfs_bnode_read(fd->bnode, &entry, fd->entryoffset, in hfsplus_cat_read_inode() 566 struct hfs_find_data fd; in hfsplus_cat_write_inode() local 576 if (hfs_find_init(HFSPLUS_SB(main_inode->i_sb)->cat_tree, &fd)) in hfsplus_cat_write_inode() 580 if (hfsplus_find_cat(main_inode->i_sb, main_inode->i_ino, &fd)) in hfsplus_cat_write_inode() 587 if (fd.entrylength < sizeof(struct hfsplus_cat_folder)) { in hfsplus_cat_write_inode() [all …]
|
/fs/hfs/ |
D | bfind.c | 15 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument 19 fd->tree = tree; in hfs_find_init() 20 fd->bnode = NULL; in hfs_find_init() 24 fd->search_key = ptr; in hfs_find_init() 25 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init() 44 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument 46 hfs_bnode_put(fd->bnode); in hfs_find_exit() 47 kfree(fd->search_key); in hfs_find_exit() 49 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit() 50 mutex_unlock(&fd->tree->tree_lock); in hfs_find_exit() [all …]
|
D | brec.c | 14 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd); 15 static int hfs_brec_update_parent(struct hfs_find_data *fd); 65 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) in hfs_brec_insert() argument 74 tree = fd->tree; in hfs_brec_insert() 75 if (!fd->bnode) { in hfs_brec_insert() 81 fd->bnode = node; in hfs_brec_insert() 82 fd->record = -1; in hfs_brec_insert() 85 key_len = (fd->search_key->key_len | 1) + 1; in hfs_brec_insert() 88 rec = fd->record + 1; in hfs_brec_insert() 91 node = fd->bnode; in hfs_brec_insert() [all …]
|
D | catalog.c | 84 struct hfs_find_data fd; in hfs_cat_create() local 96 err = hfs_find_init(HFS_SB(sb)->cat_tree, &fd); in hfs_cat_create() 104 err = hfs_bmap_reserve(fd.tree, 2 * fd.tree->depth); in hfs_cat_create() 108 hfs_cat_build_key(sb, fd.search_key, cnid, NULL); in hfs_cat_create() 112 err = hfs_brec_find(&fd); in hfs_cat_create() 118 err = hfs_brec_insert(&fd, &entry, entry_size); in hfs_cat_create() 122 hfs_cat_build_key(sb, fd.search_key, dir->i_ino, str); in hfs_cat_create() 124 err = hfs_brec_find(&fd); in hfs_cat_create() 131 err = hfs_brec_insert(&fd, &entry, entry_size); in hfs_cat_create() 138 hfs_find_exit(&fd); in hfs_cat_create() [all …]
|
D | dir.c | 24 struct hfs_find_data fd; in hfs_lookup() local 28 res = hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); in hfs_lookup() 31 hfs_cat_build_key(dir->i_sb, fd.search_key, dir->i_ino, &dentry->d_name); in hfs_lookup() 32 res = hfs_brec_read(&fd, &rec, sizeof(rec)); in hfs_lookup() 37 inode = hfs_iget(dir->i_sb, &fd.search_key->cat, &rec); in hfs_lookup() 41 hfs_find_exit(&fd); in hfs_lookup() 55 struct hfs_find_data fd; in hfs_readdir() local 62 err = hfs_find_init(HFS_SB(sb)->cat_tree, &fd); in hfs_readdir() 65 hfs_cat_build_key(sb, fd.search_key, inode->i_ino, NULL); in hfs_readdir() 66 err = hfs_brec_find(&fd); in hfs_readdir() [all …]
|
D | extent.c | 110 static int __hfs_ext_write_extent(struct inode *inode, struct hfs_find_data *fd) in __hfs_ext_write_extent() argument 114 hfs_ext_build_key(fd->search_key, inode->i_ino, HFS_I(inode)->cached_start, in __hfs_ext_write_extent() 116 res = hfs_brec_find(fd); in __hfs_ext_write_extent() 121 res = hfs_bmap_reserve(fd->tree, fd->tree->depth + 1); in __hfs_ext_write_extent() 124 hfs_brec_insert(fd, HFS_I(inode)->cached_extents, sizeof(hfs_extent_rec)); in __hfs_ext_write_extent() 129 hfs_bnode_write(fd->bnode, HFS_I(inode)->cached_extents, fd->entryoffset, fd->entrylength); in __hfs_ext_write_extent() 137 struct hfs_find_data fd; in hfs_ext_write_extent() local 141 res = hfs_find_init(HFS_SB(inode->i_sb)->ext_tree, &fd); in hfs_ext_write_extent() 144 res = __hfs_ext_write_extent(inode, &fd); in hfs_ext_write_extent() 145 hfs_find_exit(&fd); in hfs_ext_write_extent() [all …]
|
D | attr.c | 25 struct hfs_find_data fd; in __hfs_setxattr() local 33 res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); in __hfs_setxattr() 36 fd.search_key->cat = HFS_I(inode)->cat_key; in __hfs_setxattr() 37 res = hfs_brec_find(&fd); in __hfs_setxattr() 40 hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, in __hfs_setxattr() 61 hfs_bnode_write(fd.bnode, &rec, fd.entryoffset, in __hfs_setxattr() 64 hfs_find_exit(&fd); in __hfs_setxattr() 71 struct hfs_find_data fd; in __hfs_getxattr() local 80 res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); in __hfs_getxattr() 83 fd.search_key->cat = HFS_I(inode)->cat_key; in __hfs_getxattr() [all …]
|
/fs/ |
D | file.c | 36 kvfree(fdt->fd); in __free_fdtable() 84 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable() 85 memset((char *)nfdt->fd + cpy, 0, set); in copy_fdtable() 139 fdt->fd = data; in alloc_fdtable() 155 kvfree(fdt->fd); in alloc_fdtable() 249 static inline void __set_close_on_exec(unsigned int fd, struct fdtable *fdt) in __set_close_on_exec() argument 251 __set_bit(fd, fdt->close_on_exec); in __set_close_on_exec() 254 static inline void __clear_close_on_exec(unsigned int fd, struct fdtable *fdt) in __clear_close_on_exec() argument 256 if (test_bit(fd, fdt->close_on_exec)) in __clear_close_on_exec() 257 __clear_bit(fd, fdt->close_on_exec); in __clear_close_on_exec() [all …]
|
D | read_write.c | 304 static off_t ksys_lseek(unsigned int fd, off_t offset, unsigned int whence) in ksys_lseek() argument 307 struct fd f = fdget_pos(fd); in ksys_lseek() 322 SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, whence) in SYSCALL_DEFINE3() argument 324 return ksys_lseek(fd, offset, whence); in SYSCALL_DEFINE3() 328 COMPAT_SYSCALL_DEFINE3(lseek, unsigned int, fd, compat_off_t, offset, unsigned int, whence) in COMPAT_SYSCALL_DEFINE3() argument 330 return ksys_lseek(fd, offset, whence); in COMPAT_SYSCALL_DEFINE3() 336 SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, in SYSCALL_DEFINE5() argument 341 struct fd f = fdget_pos(fd); in SYSCALL_DEFINE5() 623 ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count) in ksys_read() argument 625 struct fd f = fdget_pos(fd); in ksys_read() [all …]
|
D | sync.c | 163 SYSCALL_DEFINE1(syncfs, int, fd) in SYSCALL_DEFINE1() argument 165 struct fd f = fdget(fd); in SYSCALL_DEFINE1() 220 static int do_fsync(unsigned int fd, int datasync) in do_fsync() argument 222 struct fd f = fdget(fd); in do_fsync() 233 SYSCALL_DEFINE1(fsync, unsigned int, fd) in SYSCALL_DEFINE1() argument 235 return do_fsync(fd, 0); in SYSCALL_DEFINE1() 238 SYSCALL_DEFINE1(fdatasync, unsigned int, fd) in SYSCALL_DEFINE1() argument 240 return do_fsync(fd, 1); in SYSCALL_DEFINE1() 370 int ksys_sync_file_range(int fd, loff_t offset, loff_t nbytes, in ksys_sync_file_range() argument 374 struct fd f; in ksys_sync_file_range() [all …]
|
D | fcntl.c | 35 static int setfl(int fd, struct file * filp, unsigned long arg) in setfl() argument 73 error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0); in setfl() 330 static long do_fcntl(int fd, unsigned int cmd, unsigned long arg, in do_fcntl() argument 345 err = get_close_on_exec(fd) ? FD_CLOEXEC : 0; in do_fcntl() 349 set_close_on_exec(fd, arg & FD_CLOEXEC); in do_fcntl() 355 err = setfl(fd, filp, arg); in do_fcntl() 378 err = fcntl_setlk(fd, filp, cmd, &flock); in do_fcntl() 418 err = fcntl_setlease(fd, filp, arg); in do_fcntl() 421 err = fcntl_dirnotify(fd, filp, arg); in do_fcntl() 456 SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) in SYSCALL_DEFINE3() argument [all …]
|
D | fhandle.c | 115 static struct vfsmount *get_vfsmount_from_fd(int fd) in get_vfsmount_from_fd() argument 119 if (fd == AT_FDCWD) { in get_vfsmount_from_fd() 125 struct fd f = fdget(fd); in get_vfsmount_from_fd() 221 int fd; in do_handle_open() local 227 fd = get_unused_fd_flags(open_flag); in do_handle_open() 228 if (fd < 0) { in do_handle_open() 230 return fd; in do_handle_open() 234 put_unused_fd(fd); in do_handle_open() 237 retval = fd; in do_handle_open() 239 fd_install(fd, file); in do_handle_open()
|
/fs/jffs2/ |
D | build.c | 56 struct jffs2_full_dirent *fd; in jffs2_build_inode_pass1() local 61 for(fd = ic->scan_dents; fd; fd = fd->next) { in jffs2_build_inode_pass1() 63 if (!fd->ino) in jffs2_build_inode_pass1() 68 child_ic = jffs2_get_ino_cache(c, fd->ino); in jffs2_build_inode_pass1() 71 fd->name, fd->ino, ic->ino); in jffs2_build_inode_pass1() 72 jffs2_mark_node_obsolete(c, fd->raw); in jffs2_build_inode_pass1() 74 fd->ic = NULL; in jffs2_build_inode_pass1() 79 fd->ic = child_ic; in jffs2_build_inode_pass1() 83 if (fd->type == DT_DIR) { in jffs2_build_inode_pass1() 89 dbg_fsbuild("increased nlink for child \"%s\" (ino #%u)\n", fd->name, fd->ino); in jffs2_build_inode_pass1() [all …]
|
D | write.c | 209 struct jffs2_full_dirent *fd; in jffs2_write_dirent() local 242 fd = jffs2_alloc_full_dirent(namelen+1); in jffs2_write_dirent() 243 if (!fd) in jffs2_write_dirent() 246 fd->version = je32_to_cpu(rd->version); in jffs2_write_dirent() 247 fd->ino = je32_to_cpu(rd->ino); in jffs2_write_dirent() 248 fd->nhash = full_name_hash(NULL, name, namelen); in jffs2_write_dirent() 249 fd->type = rd->type; in jffs2_write_dirent() 250 memcpy(fd->name, name, namelen); in jffs2_write_dirent() 251 fd->name[namelen]=0; in jffs2_write_dirent() 264 fd->version = je32_to_cpu(rd->version); in jffs2_write_dirent() [all …]
|
D | dir.c | 79 struct jffs2_full_dirent *fd = NULL, *fd_list; in jffs2_lookup() local 99 (!fd || fd_list->version > fd->version) && in jffs2_lookup() 102 fd = fd_list; in jffs2_lookup() 105 if (fd) in jffs2_lookup() 106 ino = fd->ino; in jffs2_lookup() 124 struct jffs2_full_dirent *fd; in jffs2_readdir() local 133 for (fd = f->dents; fd; fd = fd->next) { in jffs2_readdir() 138 fd->name, fd->ino, fd->type, curofs, (unsigned long)ctx->pos); in jffs2_readdir() 141 if (!fd->ino) { in jffs2_readdir() 143 fd->name); in jffs2_readdir() [all …]
|
/fs/hostfs/ |
D | hostfs_user.c | 41 int stat_file(const char *path, struct hostfs_stat *p, int fd) in stat_file() argument 45 if (fd >= 0) { in stat_file() 46 if (fstat64(fd, &buf) < 0) in stat_file() 72 int mode = 0, fd; in open_file() local 84 fd = open64(path, mode); in open_file() 85 if (fd < 0) in open_file() 87 else return fd; in open_file() 124 int read_file(int fd, unsigned long long *offset, char *buf, int len) in read_file() argument 128 n = pread64(fd, buf, len, *offset); in read_file() 135 int write_file(int fd, unsigned long long *offset, const char *buf, int len) in write_file() argument [all …]
|
D | hostfs_kern.c | 24 int fd; member 226 hi->fd = -1; in hostfs_alloc_inode() 237 if (HOSTFS_I(inode)->fd != -1) { in hostfs_evict_inode() 238 close_file(&HOSTFS_I(inode)->fd); in hostfs_evict_inode() 239 HOSTFS_I(inode)->fd = -1; in hostfs_evict_inode() 301 int r, w, fd; in hostfs_open() local 321 fd = open_file(name, r, w, append); in hostfs_open() 323 if (fd < 0) in hostfs_open() 324 return fd; in hostfs_open() 330 close_file(&fd); in hostfs_open() [all …]
|
/fs/proc/ |
D | fd.c | 36 unsigned int fd = proc_fd(m->private); in seq_show() local 39 file = fcheck_files(files, fd); in seq_show() 44 if (close_on_exec(fd, fdt)) in seq_show() 108 static bool tid_fd_mode(struct task_struct *task, unsigned fd, fmode_t *mode) in tid_fd_mode() argument 117 file = fcheck_files(files, fd); in tid_fd_mode() 145 unsigned int fd; in tid_fd_revalidate() local 152 fd = proc_fd(inode); in tid_fd_revalidate() 156 if (tid_fd_mode(task, fd, &f_mode)) { in tid_fd_revalidate() 184 unsigned int fd = proc_fd(d_inode(dentry)); in proc_fd_link() local 188 fd_file = fcheck_files(files, fd); in proc_fd_link() [all …]
|