Lines Matching refs:file
5 * contributor license agreements. See the NOTICE file distributed with
7 * ASF licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
36 #include "fs/file.h"
112 int tmpfs_close(struct file *filep);
113 off_t tmpfs_seek(struct file *filep, off_t offset, int whence);
114 int tmpfs_ioctl(struct file *filep, int cmd, unsigned long arg);
115 int tmpfs_sync(struct file *filep);
124 ssize_t tmpfs_write(struct file *filep, const char *buffer, size_t buflen);
125 ssize_t tmpfs_read(struct file *filep, char *buffer, size_t buflen);
305 /* Is this a file object? */
329 /* If there are no longer any references to the file and the file has been
330 * unlinked from its parent directory, then free the file object now.
340 /* Otherwise, just decrement the reference count on the file object */
476 /* Create a new zero length file object */
485 /* Initialize the new file object. NOTE that the initial state is
533 /* Separate the path into the file name and the path to the parent
565 /* Allocate an empty file. The initial state of the file is locked with one
576 /* Then add the new, empty file to the directory */
676 /* Separate the path into the file name and the path to the parent
721 /* Then add the new, empty file to the directory */
792 /* Traverse the file system for any object with the matching name */
921 /* We found it... but is it a regular file? */
940 /* Return the verified file object */
965 /* We found it... but is it a regular file? */
984 /* Return the verified file object */
996 int tmpfs_close(struct file *filep)
1002 /* Recover our private data from the struct file instance */
1008 /* Get exclusive access to the file */
1012 /* Decrement the reference count on the file */
1019 /* If the reference count decremented to zero and the file has been
1020 * unlinked, then free the file allocation now.
1025 /* Free the file object while we hold the lock? Weird but this
1036 /* Release the lock on the file */
1046 ssize_t tmpfs_read(struct file *filep, char *buffer, size_t buflen)
1055 /* Recover our private data from the struct file instance */
1067 /* Get exclusive access to the file */
1071 /* Handle attempts to read beyond the end of the file. */
1096 /* Release the lock on the file */
1127 /* Get exclusive access to the file */
1131 /* Handle attempts to read beyond the end of the file. */
1155 /* Release the lock on the file */
1247 ssize_t tmpfs_write(struct file *filep, const char *buffer, size_t buflen)
1264 /* Recover our private data from the struct file instance */
1270 /* Get exclusive access to the file */
1274 /* Handle attempts to write beyond the end of the file */
1329 /* Release the lock on the file */
1343 off_t tmpfs_seek(struct file *filep, off_t offset, int whence)
1350 /* Recover our private data from the struct file instance */
1370 case SEEK_END: /* The offset is set to the size of the file plus
1379 /* Attempts to set the position beyond the end of file will
1380 * work if the file is open for write access.
1390 /* Save the new file position */
1400 int tmpfs_ioctl(struct file *filep, int cmd, unsigned long arg)
1409 int tmpfs_sync(struct file *filep)
1438 /* Get exclusive access to the file system */
1444 * the file object, adding one to the reference count of both.
1472 /* Release the lock on the file system and return the result */
1597 /* Does this entry refer to a file or a directory object? */
1610 /* A regular file */
1623 ret = 1; // 1 means current file num is 1
1681 /* Create a root file system. This is like a single directory entry in
1682 * the file system structure.
1699 /* Initialize the file system state */
1705 /* Return the new file system handle */
1748 /* Lock the file system */
1765 /* Now we can destroy the root file system and the file system itself. */
1785 // 1. when first time create file, lookup fail, then call tmpfs_create.
1813 // if parent_tdo don't exist, find file in root.
1922 /* Get the file system structure from the inode reference. */
1936 /* Get exclusive access to the file system */
1940 /* Find the file object and parent directory associated with this relative
1941 * path. If successful, tmpfs_find_file will lock both the file object
1968 /* Remove the file from parent directory */
1975 /* If the reference count is not one, then just mark the file as
1981 /* Make the file object as unlinked */
1985 /* Release the reference count on the file object */
2046 /* Get the file system structure from the inode reference. */
2051 /* Get exclusive access to the file system */
2104 /* Get the file system structure from the inode reference. */
2112 /* Get exclusive access to the file system */
2143 * contain references to file system objects. No can we remove the
2227 /* Get the file system structure from the inode reference. */
2249 /* Get exclusive access to the file system */
2253 /* Separate the new path into the new file name and the path to the new
2349 /* Make the file object as unlinked */
2420 /* Is the tmpfs object a regular file? */
2480 /* Get the file system structure from the inode reference. */
2485 /* Get exclusive access to the file system */
2504 /* We found it... Return information about the file object in the stat