Lines Matching defs:file
2 * include/fs/file.h
70 /* minimal fd allocated for file */
75 /* file mapped in VMM pages */
86 /* This is the underlying representation of an open file. A file
88 * the file descriptor to the file state and to a set of vnode operations.
91 struct file
93 unsigned int f_magicnum; /* file magic number. -- to be deleted */
99 void *f_priv; /* Per file driver private data */
101 struct page_mapping *f_mapping; /* mapping file to memory */
107 /* This defines a list of files indexed by the file descriptor */
112 sem_t fl_sem; /* Manage access to the file list */
113 struct file fl_files[CONFIG_NFILE_DESCRIPTORS];
127 int (*open)(struct file *filep);
134 int (*close)(struct file *filep);
135 ssize_t (*read)(struct file *filep, char *buffer, size_t buflen);
136 ssize_t (*write)(struct file *filep, const char *buffer, size_t buflen);
137 off_t (*seek)(struct file *filep, off_t offset, int whence);
138 int (*ioctl)(struct file *filep, int cmd, unsigned long arg);
139 int (*mmap)(struct file* filep, struct VmMapRegion *region);
142 int (*poll)(struct file *filep, poll_table *fds);
143 int (*stat)(struct file *filep, struct stat* st);
144 int (*fallocate)(struct file* filep, int mode, off_t offset, off_t len);
145 int (*fallocate64)(struct file *filep, int mode, off64_t offset, off64_t len);
146 int (*fsync)(struct file *filep);
147 ssize_t (*readpage)(struct file *filep, char *buffer, size_t buflen);
151 void file_hold(struct file *filep);
152 void file_release(struct file *filep);
170 * Release a reference to the file list
186 * accepts struct file instances instead of file descriptors and it does
196 int file_dup2(struct file *filep1, struct file *filep2);
203 * Clone a file descriptor 'fd' to an arbitrary descriptor number (any value
205 * implemented, then this is called by dup() for the case of file
209 * This alternative naming is used when dup could operate on both file and
228 * accepts a struct file instance instead of a file descriptor and does
237 int file_dup(struct file *filep, int minfd);
243 * Clone a file descriptor to a specific descriptor number. If socket
245 * case of file descriptors. If socket descriptors are not implemented,
248 * This alternative naming is used when dup2 could operate on both file and
298 * Transfer a file
310 * Given a file descriptor, return the corresponding instance of struct
311 * file. NOTE that this function will currently fail if it is provided
315 * fd - The file descriptor
316 * filep - The location to return the struct file instance
325 int fs_getfilep(int fd, struct file **filep);
338 * - It accepts a file structure instance instead of file descriptor.
347 * end-of-file condition, or a negated errno value on any failure.
352 ssize_t file_read(struct file *filep, void *buf, size_t nbytes);
360 * struct file instance instead of a file descriptor. Currently used
366 ssize_t file_write(struct file *filep, const void *buf, size_t nbytes);
374 * struct file instance instead of a file descriptor. Currently used
380 ssize_t file_pread(struct file *filep, void *buf, size_t nbytes,
389 * struct file instance instead of a file descriptor. Currently used
395 ssize_t file_pwrite(struct file *filep, const void *buf,
404 * struct file instance instead of a file descriptor. Currently used
410 off_t file_seek(struct file *filep, off_t offset, int whence);
418 * struct file instance instead of a file descriptor and it does not set
424 int file_fsync(struct file *filep);
432 * struct file instance instead of a file descriptor.
435 * filep - Instance for struct file for the opened file.
447 int file_vfcntl(struct file *filep, int cmd, va_list ap);
455 * struct file instance instead of a file descriptor. Currently used
461 off64_t file_seek64(struct file *filep, off64_t offset, int whence);
469 * Returns the file descriptor pointer.
473 struct file *files_allocate(const struct Vnode *vnode_ptr, int oflags, off_t pos, const void *priv, int minfd);
482 * Caller holds the list semaphore because the file descriptor will be freed.
519 * Copy data between one file descriptor and another.
526 * @brief get the path by a given file fd.
529 * The function is used for getting the path by a given file fd.
533 * <li>Only support file fd, not any dir fd.</li>
536 * @param fd [IN] Type #int file fd.
543 * <ul><li>fs.h: the header file that contains the API declaration.</li></ul>
583 void poll_wait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p);