Lines Matching refs:to

123 /*!	\brief Structure to manage a mounted file system
128 (e.g. by holding a reference to a vnode of that mount) (read) access
129 to those fields is always safe, even without additional locking. Morever
130 while mounted the mount holds a reference to the root_vnode->covers vnode,
132 safe if a reference to vnode is held (note that for the root mount
216 The holder is allowed to read/write access the sMountsTable.
231 The thread trying to lock the lock must not hold sVnodeLock or
238 The holder is allowed read/write access to sVnodeTable and to
239 any unbusy vnode in that table, save to the immutable fields (device, id,
240 private_node, mount) to which only read-only access is allowed.
243 write accessed when holding a read lock to sVnodeLock *and* having the vnode
244 locked. Write access to covered_by and covers requires to write lock
247 The thread trying to acquire the lock must not hold sMountLock.
346 // How long to wait for busy vnodes (10s)
748 /*! Tries to open the specified file system module.
750 Returns a pointer to file system module interface, or NULL if it
774 The name is allocated for you, and you have to free() it when you're
784 // the name already seems to be the module's file name
791 // this doesn't seem to be a valid name, but well...
808 The name is allocated for you, and you have to free() it when you're
890 // vnode doesn't seem to become unbusy
908 \param _vnode Will be set to the new vnode on success.
909 \param _nodeCreated Will be set to \c true when the returned vnode has
954 // add the vnode to the mount's node list and the hash table
987 // references to that cache at this point. The last one belongs to the vnode
988 // itself (cf. vfs_get_vnode_cache()) and one belongs to the node's file
989 // cache. Each but the last reference to a cache also includes a reference
990 // to the vnode. The file cache, however, released its reference (cf.
991 // file_cache_create()), so that this vnode's ref count has the chance to
992 // ever drop to 0. Deleting the file cache now, will cause the next to last
993 // cache reference to be released, which will also release a (no longer
1005 // If the vnode has a VMCache attached, make sure that it won't try to get
1032 if the counter dropped to 0.
1034 The caller must, of course, own a reference to the vnode to call this
1042 a file system. This will be passed to file system hooks only.
1068 // to delete it
1092 - by ensuring that a reference to the node exists and remains in existence,
1139 \param _vnode Pointer to a vnode* variable into which the pointer to the
1178 TRACE(("get_vnode: tried to lookup vnode, got %p\n", vnode));
1192 // we need to create a new vnode and read it in
1258 if the counter dropped to 0.
1260 The caller must, of course, own a reference to the vnode to call this
1285 // determine how many nodes to free
1323 // Check whether the node is still unused -- since we only append to the
1359 The function returns a reference to the retrieved vnode (if any), the caller
1360 is responsible to free.
1386 The function returns a reference to the retrieved vnode (if any), the caller
1387 is responsible to free.
1408 The function returns a reference to the retrieved vnode (if any), the caller
1409 is responsible to free.
1435 The function returns a reference to the retrieved vnode (if any), the caller
1436 is responsible to free.
1480 You have to call put_advisory_locking() when you're done with
1510 /*! Creates a locked advisory_locking object, and attaches it to the
1717 will wait for the lock to become available, if there are any collisions
1722 in question (we even allow parents to remove the lock, though, but that
1723 seems to be in line to what the BSD's are doing).
1761 // we need to wait
1771 // We need to wait. Do that or fail now, if we've been asked not to.
1783 // We have been notified, but we need to re-lock the locking object. So
1810 /*! Normalizes the \a flock structure to make it easier to compare the
1811 structure with others. The l_start and l_len fields are set to absolute
1812 values according to the l_whence field.
1878 // redirect the vnode to the covered vnode
1909 TODO: there is currently no means to stop a blocking read/write!
1942 // need to disconnect it to be able to unmount
1959 The caller obtains a reference to the returned node.
1991 The supplied \a path is transformed to refer to the directory part of
1994 Neither the returned path nor the leaf name can be expected to be
1997 \param path The path to be analyzed. Must be able to store at least one
2031 // This path points to the root of the file system
2036 // rewind to the start of the leaf before the '/'
2072 On success a reference to the vnode is acquired for the caller.
2090 // have a reference and just need to look the node up.
2113 component. This function clobbers the buffer pointed to by \a path only
2117 the caller has the responsibility to call put_vnode() on it.
2122 \param[out] _vnode If the function returns B_OK, points to the found node.
2123 \param[out] _vnode If the function returns something else and leafname is not NULL: set to the
2124 last existing directory in the path. The caller has responsibility to release it using
2155 // walk to find the next path component ("path" will point to a single
2169 // See if the '..' is at a covering vnode move to the covered
2170 // vnode so we pass the '..' path to the underlying filesystem.
2187 // Check if we have the right to search the current directory vnode.
2193 // Tell the filesystem to get the vnode of this path component (if we
2211 // to do it)
2243 // directory ("vnode" still points to that one).
2326 // figure out if we need to start at root or at cwd
2360 /*! Returns the vnode in the next to last segment of the path, and returns
2362 The path buffer must be able to store at least one additional character.
2377 to by a FD + path pair.
2380 case \a path is either an absolute path or one relative to the current
2382 of the directory referred to by \a fd. If \a path is absolute \a fd is
2385 The caller has the responsibility to call put_vnode() on the returned
2392 \param _vnode A pointer to a variable the directory vnode shall be written
2420 to by a vnode + path pair.
2423 case \a path is either an absolute path or one relative to the current
2425 of the directory referred to by \a vnode. If \a path is absolute \a vnode is
2428 The caller has the responsibility to call put_vnode() on the returned
2438 \param _vnode A pointer to a variable the directory vnode shall be written
2477 // See if the vnode is covering another vnode and move to the covered
2505 // want the entries to be fixed. We have already resolved vnode to
2548 /*! Gets the full path to a given directory vnode.
2549 It uses the fs_get_vnode_name() call to get the name of a vnode; if a
2550 file system doesn't support this call, it will fall back to iterating
2551 through the parent directory to get the name of the child.
2557 It doesn't use any locking to prevent returning the correct path, as
2558 paths aren't safe anyway: the path to a file can change at any time.
2560 It might be a good idea, though, to check if the returned path exists
2587 // the path is filled right to left
2627 // TODO: add an explicit check for loops in about 10 levels to do
2630 // don't go deeper as 'maxLevel' to prevent circular loops
2654 // move the path to the start of the buffer
2666 The given path buffer must be able to store at least one
2670 check_path(char* to)
2676 while (*to) {
2678 if (*to == '/')
2679 to++, length++;
2681 begin = to;
2682 while (*to != '/' && *to)
2683 to++, length++;
2685 if (to - begin > B_FILE_NAME_LENGTH)
2694 if (*(to - 1) == '/') {
2698 to[0] = '.';
2699 to[1] = '\0';
2721 // if this is still valid to do (accessing the vnode without ref_count
2778 // there is no relative path to take into account
2876 /*! In-place normalizes \a path. It's otherwise semantically equivalent to
2965 // ".." is guaranteed not to be clobbered by this call
3104 // Failed to resolve the name -- prepend "<dev,node>/".
3161 kprintf("Failed to resolve vnode path.\n");
3165 kprintf("Failed to allocate memory for constructing the path.\n");
3285 // restrict dumped nodes to a certain device if requested
3321 // restrict dumped nodes to a certain device if requested
3441 and calls the file system hooks to read/write the request to disk.
3451 // to access the file outside of its bounds
3497 // first, find out where we have to continue in our iovecs
3530 // (fileLeft) has been assigned to tempVecs
3533 // assign what is left of the current fileVec to the tempVecs
3536 // try to satisfy one iovec per iteration (or as much as
3839 // If this is a layered FS, we need to get the node cookie for the requested
3846 panic("get_vnode(): Failed to get super node for vnode %p, "
4089 // lookup mount -- the caller is required to make sure that the mount
4104 // lookup mount -- the caller is required to make sure that the mount
4119 // lookup mount -- the caller is required to make sure that the mount
4135 /*! Acquires another reference to the vnode that has to be released
4236 vnode-pointer to a fs_vnode-pointer.
4259 to the node.
4302 // vnode_path_to_vnode() releases a reference to the starting vnode
4317 // Use get_vnode() to resolve the cookie for the right layer.
4331 // path given: get the stat of the node referred to by (fd, path)
4355 /*! Finds the full path to the file that contains the module \a moduleName,
4361 \a basePath and \a pathBuffer must not point to the same space.
4428 // if we got here, the moduleName just pointed to a directory, not to
4436 The path must refer to an existing or non-existing entry in an existing
4438 refer to an existing directory.
4444 Any two paths referring to the same entry, will result in the same
4448 \param path The path to be normalized.
4454 otherwise that of the team this thread belongs to. Only relevant,
4455 if the path is relative (to get the CWD).
4489 The caller gets a reference to the newly created node (which is passed
4492 \param path The path where to create the entry for the node. Can be \c NULL,
4499 \param mode The type and permissions for the node to be created.
4500 \param flags Flags to be passed to the creating FS.
4503 \param _superVnode Pointer to a pre-allocated structure to be filled by the
4506 \param _createVnode Pointer to pre-allocated storage where to store the
4507 pointer to the newly created node.
4694 In case it's successful, it will also grab a reference to the cache
4714 // TODO: actually the vnode needs to be busy already here, or
4743 /*! Sets the vnode's VMCache object, for subsystems that want to manage
4745 In case it's successful, it will also grab a reference to the cache
5062 // store pointers to the old tables
5103 /*! \brief Resolves a vnode to the vnode it is covered by, if any.
5116 \param resolvedMountID Pointer to storage for the resolved mount ID.
5117 \param resolvedNodeID Pointer to storage for the resolved node ID.
5321 "constructed and printed. It might not be possible to construct a\n"
5390 // the node the entry refers to (e.g. in case of mount points or FIFOs). So
5392 // try to look the entry up first. If it already exists, we just open the
5396 // error code and retry (up to 3 times) again.
5411 // If the node is a symlink, we have to follow it, unless
5426 // there. In that case, vnode_path_to_vnode has set vnode to the latest
5451 // it doesn't exist yet -- try to create it
5559 // get directory to put the new file in
5578 // get directory to put the new file in
5617 // The vnode reference has been transferred to the FD
5650 // The vnode reference has been transferred to the FD
5949 // The vnode reference has been transferred to the FD
5977 // The vnode reference has been transferred to the FD
6031 // we need to replace d_dev and d_ino with the actual values.
6066 // we need to adjust the read dirents
6100 // we need to make sure our path name doesn't stop with "/", ".",
6208 // we only accept changes to certain flags
6265 // we were given except change type to F_UNLCK
6368 // We need to set the locking atomically - someone
6388 // We need to set the locking atomically - someone
6462 // path validity checks have to be in the calling function!
6489 // path validity checks have to be in the calling function!
7003 FUNCTION(("attr_rename: from fd = %d, from name = \"%s\", to fd = %d, to "
7342 // The path is always safe, we just have to make sure that fsName is
7354 // Helper to delete a newly created file device on failure.
7355 // Not exactly beautiful, but helps to keep the code below cleaner.
7367 // point to a real file/device (if given at all).
7384 // an invalid path, or the path refers to an image file. We try
7385 // to let the DDM create a file device for the path.
7402 // correct path to file device
7414 TRACE(("fs_mount(): Failed to lock disk device!\n"));
7446 // the partition has a reference to it), so this is safe.
7590 // the root node is supposed to be owned by the file system - it must
7708 TRACE(("fs_unmount(): Failed to lock disk device!\n"));
7722 // grab the vnode master mutex to keep someone from creating
7769 // from getting back to zero, this will fall into an endless loop...
7774 // the file system is still busy - but we're forced to unmount it,
7795 // Remove all covers/covered_by links from other mounts' nodes to this
7797 // references to the external vnodes below.
7811 // We only have a covered vnode. Remove its link to us.
7825 // We only have a covering vnode. Remove its link to us.
7847 // we don't have to do this.
7849 // Put the references to external covered/covering vnodes we kept above.
7901 // since it's a relatively rare call and doesn't need to allow for
7903 // also more involved, since we had to lock the individual nodes
7904 // and take care of the locking order, which we might not want to
7907 // synchronize access to vnode list
7980 // fill in info the file system doesn't (have to) know about
8113 // nope, can't cwd to here
8117 // We need to have the permission to enter the directory, too
8142 user_copy_name(char* to, const char* from, size_t length)
8144 ssize_t len = user_strlcpy(to, from, length);
8293 \return A FD referring to the newly opened node, or an error code,
8314 \a inode identify the parent directory of the directory to be opened
8318 directory of the directory to be opened resides on, otherwise
8321 directory of the directory to be opened, otherwise node ID of the
8323 \param name The entry name of the directory to be opened. If \c NULL,
8324 the \a device + \a inode pair identify the node to be opened.
8345 \return A FD referring to the newly opened directory, or an error code,
8438 /*! \brief Reads the contents of a symlink referred to by a FD + path pair.
8441 If only \a fd is given, the function the symlink to be read is the node
8443 symlink to be read. If both are given and the path is absolute, \a fd is
8447 will still be updated to reflect the required buffer size.
8453 \param _bufferSize A pointer to the size of the supplied buffer.
8511 to be deleted). If only a path is given, this path identifies the entry
8532 /*! \brief Moves an entry specified by a FD + path pair to a an entry specified
8579 given, this path identifies the entry for whose node to retrieve the
8588 function shall not stick to symlinks, but traverse them.
8624 given, this path identifies the entry for whose node to write the
8633 function shall not stick to symlinks, but traverse them.
8634 \param stat The buffer containing the stat data to be written.
8661 // path given: write the stat of the node referred to by (fd, path)
8761 // Call vfs to get current working directory
9032 // copy back to userland
9132 equivalent to \code _user_open_dir(fd, "..") \endcode. It really is
9138 \param fd A FD referring to a directory.
9176 // copy the name to the userland buffer
9506 // the underlying FS needs to support creating FIFOs
9539 // We've got one reference to the node and need another one.
9544 dprintf("_user_create_pipe(): Failed to lookup vnode (%" B_PRIdDEV ", "
9560 // copy FDs to userland
9611 // path given: get the stat of the node referred to by (fd, path)
9666 // path given: write the stat of the node referred to by (fd, path)
9760 // Try to support the BeOS typical truncation as well as the position
10017 // only root is allowed to chroot()
10026 // copy userland path to kernel