Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 75) sorted by relevance

123

/fs/hfsplus/
Dbfind.c14 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument
18 fd->tree = tree; in hfs_find_init()
19 fd->bnode = NULL; in hfs_find_init()
23 fd->search_key = ptr; in hfs_find_init()
24 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init()
30 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument
32 hfs_bnode_put(fd->bnode); in hfs_find_exit()
33 kfree(fd->search_key); in hfs_find_exit()
34 dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n", fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit()
35 up(&fd->tree->tree_lock); in hfs_find_exit()
[all …]
Dbrec.c14 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd);
15 static int hfs_brec_update_parent(struct hfs_find_data *fd);
53 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) in hfs_brec_insert() argument
62 tree = fd->tree; in hfs_brec_insert()
63 if (!fd->bnode) { in hfs_brec_insert()
66 fd->bnode = hfs_bnode_find(tree, tree->leaf_head); in hfs_brec_insert()
67 if (IS_ERR(fd->bnode)) in hfs_brec_insert()
68 return PTR_ERR(fd->bnode); in hfs_brec_insert()
69 fd->record = -1; in hfs_brec_insert()
72 key_len = be16_to_cpu(fd->search_key->key_len) + 2; in hfs_brec_insert()
[all …]
Dcatalog.c154 struct hfs_find_data *fd) in hfsplus_find_cat() argument
160 hfsplus_cat_build_key(sb, fd->search_key, cnid, NULL); in hfsplus_find_cat()
161 err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry)); in hfsplus_find_cat()
176 hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID), in hfsplus_find_cat()
178 return hfs_brec_find(fd); in hfsplus_find_cat()
183 struct hfs_find_data fd; in hfsplus_create_cat() local
191 hfs_find_init(HFSPLUS_SB(sb).cat_tree, &fd); in hfsplus_create_cat()
193 hfsplus_cat_build_key(sb, fd.search_key, cnid, NULL); in hfsplus_create_cat()
197 err = hfs_brec_find(&fd); in hfsplus_create_cat()
203 err = hfs_brec_insert(&fd, &entry, entry_size); in hfsplus_create_cat()
[all …]
Dextents.c86 static void __hfsplus_ext_write_extent(struct inode *inode, struct hfs_find_data *fd) in __hfsplus_ext_write_extent() argument
90 hfsplus_ext_build_key(fd->search_key, inode->i_ino, HFSPLUS_I(inode).cached_start, in __hfsplus_ext_write_extent()
92 res = hfs_brec_find(fd); in __hfsplus_ext_write_extent()
96 hfs_brec_insert(fd, HFSPLUS_I(inode).cached_extents, sizeof(hfsplus_extent_rec)); in __hfsplus_ext_write_extent()
101 hfs_bnode_write(fd->bnode, HFSPLUS_I(inode).cached_extents, fd->entryoffset, fd->entrylength); in __hfsplus_ext_write_extent()
109 struct hfs_find_data fd; in hfsplus_ext_write_extent() local
111 hfs_find_init(HFSPLUS_SB(inode->i_sb).ext_tree, &fd); in hfsplus_ext_write_extent()
112 __hfsplus_ext_write_extent(inode, &fd); in hfsplus_ext_write_extent()
113 hfs_find_exit(&fd); in hfsplus_ext_write_extent()
117 static inline int __hfsplus_ext_read_extent(struct hfs_find_data *fd, in __hfsplus_ext_read_extent() argument
[all …]
Dioctl.c99 struct hfs_find_data fd; in hfsplus_setxattr() local
107 res = hfs_find_init(HFSPLUS_SB(inode->i_sb).cat_tree, &fd); in hfsplus_setxattr()
110 res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd); in hfsplus_setxattr()
113 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, in hfsplus_setxattr()
130 hfs_bnode_write(fd.bnode, &entry, fd.entryoffset, in hfsplus_setxattr()
133 hfs_find_exit(&fd); in hfsplus_setxattr()
141 struct hfs_find_data fd; in hfsplus_getxattr() local
150 res = hfs_find_init(HFSPLUS_SB(inode->i_sb).cat_tree, &fd); in hfsplus_getxattr()
153 res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd); in hfsplus_getxattr()
156 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, in hfsplus_getxattr()
[all …]
Ddir.c31 struct hfs_find_data fd; in hfsplus_lookup() local
42 hfs_find_init(HFSPLUS_SB(sb).cat_tree, &fd); in hfsplus_lookup()
43 hfsplus_cat_build_key(sb, fd.search_key, dir->i_ino, &dentry->d_name); in hfsplus_lookup()
45 err = hfs_brec_read(&fd, &entry, sizeof(entry)); in hfsplus_lookup()
48 hfs_find_exit(&fd); in hfsplus_lookup()
57 if (fd.entrylength < sizeof(struct hfsplus_cat_folder)) { in hfsplus_lookup()
64 if (fd.entrylength < sizeof(struct hfsplus_cat_file)) { in hfsplus_lookup()
89 hfsplus_cat_build_key(sb, fd.search_key, HFSPLUS_SB(sb).hidden_dir->i_ino, &str); in hfsplus_lookup()
99 hfs_find_exit(&fd); in hfsplus_lookup()
109 hfs_find_exit(&fd); in hfsplus_lookup()
[all …]
Dinode.c148 struct hfs_find_data fd; in hfsplus_file_lookup() local
169 hfs_find_init(HFSPLUS_SB(sb).cat_tree, &fd); in hfsplus_file_lookup()
170 err = hfsplus_find_cat(sb, dir->i_ino, &fd); in hfsplus_file_lookup()
172 err = hfsplus_cat_read_inode(inode, &fd); in hfsplus_file_lookup()
173 hfs_find_exit(&fd); in hfsplus_file_lookup()
396 int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) in hfsplus_cat_read_inode() argument
402 type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset); in hfsplus_cat_read_inode()
408 if (fd->entrylength < sizeof(struct hfsplus_cat_folder)) in hfsplus_cat_read_inode()
410 hfs_bnode_read(fd->bnode, &entry, fd->entryoffset, in hfsplus_cat_read_inode()
425 if (fd->entrylength < sizeof(struct hfsplus_cat_file)) in hfsplus_cat_read_inode()
[all …]
/fs/hfs/
Dbfind.c14 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument
18 fd->tree = tree; in hfs_find_init()
19 fd->bnode = NULL; in hfs_find_init()
23 fd->search_key = ptr; in hfs_find_init()
24 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init()
30 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument
32 hfs_bnode_put(fd->bnode); in hfs_find_exit()
33 kfree(fd->search_key); in hfs_find_exit()
34 dprint(DBG_BNODE_REFS, "find_exit: %d (%p)\n", fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit()
35 up(&fd->tree->tree_lock); in hfs_find_exit()
[all …]
Dbrec.c13 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd);
14 static int hfs_brec_update_parent(struct hfs_find_data *fd);
66 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) in hfs_brec_insert() argument
75 tree = fd->tree; in hfs_brec_insert()
76 if (!fd->bnode) { in hfs_brec_insert()
79 fd->bnode = hfs_bnode_find(tree, tree->leaf_head); in hfs_brec_insert()
80 if (IS_ERR(fd->bnode)) in hfs_brec_insert()
81 return PTR_ERR(fd->bnode); 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()
[all …]
Dcatalog.c84 struct hfs_find_data fd; in hfs_cat_create() local
95 hfs_find_init(HFS_SB(sb)->cat_tree, &fd); in hfs_cat_create()
97 hfs_cat_build_key(sb, fd.search_key, cnid, NULL); in hfs_cat_create()
101 err = hfs_brec_find(&fd); in hfs_cat_create()
107 err = hfs_brec_insert(&fd, &entry, entry_size); in hfs_cat_create()
111 hfs_cat_build_key(sb, fd.search_key, dir->i_ino, str); in hfs_cat_create()
113 err = hfs_brec_find(&fd); in hfs_cat_create()
120 err = hfs_brec_insert(&fd, &entry, entry_size); in hfs_cat_create()
127 hfs_find_exit(&fd); in hfs_cat_create()
131 hfs_cat_build_key(sb, fd.search_key, cnid, NULL); in hfs_cat_create()
[all …]
Dattr.c20 struct hfs_find_data fd; in hfs_setxattr() local
28 res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); in hfs_setxattr()
31 fd.search_key->cat = HFS_I(inode)->cat_key; in hfs_setxattr()
32 res = hfs_brec_find(&fd); in hfs_setxattr()
35 hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, in hfs_setxattr()
52 hfs_bnode_write(fd.bnode, &rec, fd.entryoffset, in hfs_setxattr()
55 hfs_find_exit(&fd); in hfs_setxattr()
63 struct hfs_find_data fd; in hfs_getxattr() local
72 res = hfs_find_init(HFS_SB(inode->i_sb)->cat_tree, &fd); in hfs_getxattr()
75 fd.search_key->cat = HFS_I(inode)->cat_key; in hfs_getxattr()
[all …]
Ddir.c24 struct hfs_find_data fd; in hfs_lookup() local
30 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()
34 hfs_find_exit(&fd); in hfs_lookup()
42 inode = hfs_iget(dir->i_sb, &fd.search_key->cat, &rec); in hfs_lookup()
43 hfs_find_exit(&fd); in hfs_lookup()
61 struct hfs_find_data fd; in hfs_readdir() local
68 hfs_find_init(HFS_SB(sb)->cat_tree, &fd); in hfs_readdir()
69 hfs_cat_build_key(sb, fd.search_key, inode->i_ino, NULL); in hfs_readdir()
[all …]
Dextent.c110 static void __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()
120 hfs_brec_insert(fd, HFS_I(inode)->cached_extents, sizeof(hfs_extent_rec)); in __hfs_ext_write_extent()
125 hfs_bnode_write(fd->bnode, HFS_I(inode)->cached_extents, fd->entryoffset, fd->entrylength); in __hfs_ext_write_extent()
132 struct hfs_find_data fd; in hfs_ext_write_extent() local
135 hfs_find_init(HFS_SB(inode->i_sb)->ext_tree, &fd); in hfs_ext_write_extent()
136 __hfs_ext_write_extent(inode, &fd); in hfs_ext_write_extent()
137 hfs_find_exit(&fd); in hfs_ext_write_extent()
141 static inline int __hfs_ext_read_extent(struct hfs_find_data *fd, struct hfs_extent *extent, in __hfs_ext_read_extent() argument
[all …]
Dinode.c383 struct hfs_find_data fd; in hfs_write_inode() local
411 if (hfs_find_init(HFS_SB(main_inode->i_sb)->cat_tree, &fd)) in hfs_write_inode()
415 fd.search_key->cat = HFS_I(main_inode)->cat_key; in hfs_write_inode()
416 if (hfs_brec_find(&fd)) in hfs_write_inode()
421 if (fd.entrylength < sizeof(struct hfs_cat_dir)) in hfs_write_inode()
423 hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, in hfs_write_inode()
432 hfs_bnode_write(fd.bnode, &rec, fd.entryoffset, in hfs_write_inode()
435 hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, in hfs_write_inode()
439 hfs_bnode_write(fd.bnode, &rec, fd.entryoffset, in hfs_write_inode()
442 if (fd.entrylength < sizeof(struct hfs_cat_file)) in hfs_write_inode()
[all …]
/fs/jffs2/
Dbuild.c51 struct jffs2_full_dirent *fd; in jffs2_build_inode_pass1() local
56 for(fd = ic->scan_dents; fd; fd = fd->next) { in jffs2_build_inode_pass1()
58 if (!fd->ino) in jffs2_build_inode_pass1()
63 child_ic = jffs2_get_ino_cache(c, fd->ino); in jffs2_build_inode_pass1()
66 fd->name, fd->ino, ic->ino); in jffs2_build_inode_pass1()
67 jffs2_mark_node_obsolete(c, fd->raw); in jffs2_build_inode_pass1()
71 if (fd->type == DT_DIR) { in jffs2_build_inode_pass1()
74 fd->name, fd->ino, ic->ino); in jffs2_build_inode_pass1()
82 dbg_fsbuild("increased nlink for child \"%s\" (ino #%u)\n", fd->name, fd->ino); in jffs2_build_inode_pass1()
97 struct jffs2_full_dirent *fd; in jffs2_build_filesystem() local
[all …]
Dwrite.c203 struct jffs2_full_dirent *fd; in jffs2_write_dirent() local
235 fd = jffs2_alloc_full_dirent(namelen+1); in jffs2_write_dirent()
236 if (!fd) in jffs2_write_dirent()
239 fd->version = je32_to_cpu(rd->version); in jffs2_write_dirent()
240 fd->ino = je32_to_cpu(rd->ino); in jffs2_write_dirent()
241 fd->nhash = full_name_hash(name, namelen); in jffs2_write_dirent()
242 fd->type = rd->type; in jffs2_write_dirent()
243 memcpy(fd->name, name, namelen); in jffs2_write_dirent()
244 fd->name[namelen]=0; in jffs2_write_dirent()
257 fd->version = je32_to_cpu(rd->version); in jffs2_write_dirent()
[all …]
Ddir.c78 struct jffs2_full_dirent *fd = NULL, *fd_list; in jffs2_lookup() local
95 (!fd || fd_list->version > fd->version) && in jffs2_lookup()
98 fd = fd_list; in jffs2_lookup()
101 if (fd) in jffs2_lookup()
102 ino = fd->ino; in jffs2_lookup()
123 struct jffs2_full_dirent *fd; in jffs2_readdir() local
149 for (fd = f->dents; fd; fd = fd->next) { in jffs2_readdir()
155 fd->name, fd->ino, fd->type, curofs, offset)); in jffs2_readdir()
158 if (!fd->ino) { in jffs2_readdir()
159 D2(printk(KERN_DEBUG "Skipping deletion dirent \"%s\"\n", fd->name)); in jffs2_readdir()
[all …]
/fs/hostfs/
Dhostfs_user.c26 int *blksize_out, unsigned long long *blocks_out, int fd) in stat_file() argument
30 if (fd >= 0) { in stat_file()
31 if (fstat64(fd, &buf) < 0) in stat_file()
115 int mode = 0, fd; in open_file() local
127 fd = open64(path, mode); in open_file()
128 if (fd < 0) in open_file()
130 else return fd; in open_file()
160 int read_file(int fd, unsigned long long *offset, char *buf, int len) in read_file() argument
164 n = pread64(fd, buf, len, *offset); in read_file()
171 int write_file(int fd, unsigned long long *offset, const char *buf, int len) in write_file() argument
[all …]
Dhostfs_kern.c22 int fd; member
295 .fd = -1, in hostfs_alloc_inode()
304 if (HOSTFS_I(inode)->fd != -1) { in hostfs_delete_inode()
305 close_file(&HOSTFS_I(inode)->fd); in hostfs_delete_inode()
306 HOSTFS_I(inode)->fd = -1; in hostfs_delete_inode()
319 if (HOSTFS_I(inode)->fd != -1) { in hostfs_destroy_inode()
320 close_file(&HOSTFS_I(inode)->fd); in hostfs_destroy_inode()
377 int r = 0, w = 0, fd; in hostfs_file_open() local
387 if (HOSTFS_I(ino)->fd != -1) { in hostfs_file_open()
388 close_file(&HOSTFS_I(ino)->fd); in hostfs_file_open()
[all …]
/fs/
Dfile.c52 kfree(fdt->fd); in free_fdarr()
54 vfree(fdt->fd); in free_fdarr()
77 vfree(fdt->fd); in free_fdtable_work()
101 kfree(fdt->fd); in free_fdtable_rcu()
128 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable()
129 memset((char *)(nfdt->fd) + cpy, 0, set); in copy_fdtable()
172 fdt->fd = (struct file **)data; in alloc_fdtable()
313 new_fdt->fd = &newf->fd_array[0]; in dup_fd()
358 old_fds = old_fdt->fd; in dup_fd()
359 new_fds = new_fdt->fd; in dup_fd()
[all …]
Dfcntl.c28 void set_close_on_exec(unsigned int fd, int flag) in set_close_on_exec() argument
35 FD_SET(fd, fdt->close_on_exec); in set_close_on_exec()
37 FD_CLR(fd, fdt->close_on_exec); in set_close_on_exec()
41 static int get_close_on_exec(unsigned int fd) in get_close_on_exec() argument
48 res = FD_ISSET(fd, fdt->close_on_exec); in get_close_on_exec()
92 tofree = fdt->fd[newfd]; in SYSCALL_DEFINE3()
96 rcu_assign_pointer(fdt->fd[newfd], file); in SYSCALL_DEFINE3()
146 static int setfl(int fd, struct file * filp, unsigned long arg) in setfl() argument
186 error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0); in setfl()
262 static long do_fcntl(int fd, unsigned int cmd, unsigned long arg, in do_fcntl() argument
[all …]
Dopen.c159 SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) in SYSCALL_DEFINE2() argument
166 file = fget(fd); in SYSCALL_DEFINE2()
177 SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) in SYSCALL_DEFINE3() argument
187 file = fget(fd); in SYSCALL_DEFINE3()
296 static long do_sys_ftruncate(unsigned int fd, loff_t length, int small) in do_sys_ftruncate() argument
307 file = fget(fd); in do_sys_ftruncate()
342 SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) in SYSCALL_DEFINE2() argument
344 long ret = do_sys_ftruncate(fd, length, 1); in SYSCALL_DEFINE2()
346 asmlinkage_protect(2, ret, fd, length); in SYSCALL_DEFINE2()
364 SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length) in SYSCALL_DEFINE()
[all …]
Dsync.c134 static int do_fsync(unsigned int fd, int datasync) in do_fsync() argument
139 file = fget(fd); in do_fsync()
147 SYSCALL_DEFINE1(fsync, unsigned int, fd) in SYSCALL_DEFINE1() argument
149 return do_fsync(fd, 0); in SYSCALL_DEFINE1()
152 SYSCALL_DEFINE1(fdatasync, unsigned int, fd) in SYSCALL_DEFINE1() argument
154 return do_fsync(fd, 1); in SYSCALL_DEFINE1()
204 SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, in SYSCALL_DEFINE()
249 file = fget_light(fd, &fput_needed); in SYSCALL_DEFINE()
266 asmlinkage long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes, in SyS_sync_file_range() argument
269 return SYSC_sync_file_range((int) fd, offset, nbytes, in SyS_sync_file_range()
[all …]
Dcompat_ioctl.c117 static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd, in do_ioctl32_pointer() argument
120 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg)); in do_ioctl32_pointer()
123 static int w_long(unsigned int fd, unsigned int cmd, unsigned long arg) in w_long() argument
130 err = sys_ioctl(fd, cmd, (unsigned long)&val); in w_long()
137 static int rw_long(unsigned int fd, unsigned int cmd, unsigned long arg) in rw_long() argument
147 err = sys_ioctl(fd, cmd, (unsigned long)&val); in rw_long()
163 static int do_video_get_event(unsigned int fd, unsigned int cmd, unsigned long arg) in do_video_get_event() argument
170 err = sys_ioctl(fd, cmd, (unsigned long) &kevent); in do_video_get_event()
194 static int do_video_stillpicture(unsigned int fd, unsigned int cmd, unsigned long arg) in do_video_stillpicture() argument
216 err = sys_ioctl(fd, cmd, (unsigned long) up_native); in do_video_stillpicture()
[all …]
/fs/hppfs/
Dhppfs.c111 int extra, fd; in file_removed() local
129 fd = os_open_file(host_file, of_read(OPENFLAGS()), 0); in file_removed()
131 if (fd > 0) { in file_removed()
132 os_close_file(fd); in file_removed()
211 static ssize_t hppfs_read_file(int fd, char __user *buf, ssize_t count) in hppfs_read_file() argument
226 err = os_read_file(fd, new_buf, cur); in hppfs_read_file()
306 int fd; in open_host_sock() local
311 fd = os_connect_socket(host_file); in open_host_sock()
312 if (fd > 0) in open_host_sock()
313 return fd; in open_host_sock()
[all …]

123