Linux Kernel
3.7.1
|
#include <linux/syscalls.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/fsnotify.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/hash.h>
#include <linux/cache.h>
#include <linux/export.h>
#include <linux/mount.h>
#include <linux/file.h>
#include <asm/uaccess.h>
#include <linux/security.h>
#include <linux/seqlock.h>
#include <linux/swap.h>
#include <linux/bootmem.h>
#include <linux/fs_struct.h>
#include <linux/hardirq.h>
#include <linux/bit_spinlock.h>
#include <linux/rculist_bl.h>
#include <linux/prefetch.h>
#include <linux/ratelimit.h>
#include "internal.h"
#include "mount.h"
Go to the source code of this file.
Macros | |
#define | D_HASHBITS d_hash_shift |
#define | D_HASHMASK d_hash_mask |
Variables | |
struct dentry_stat_t | dentry_stat |
: the case-exact name to be associated with the returned dentry | |
d_add_ci - lookup or allocate new dentry with case-exact name : the inode case-insensitive lookup has found : the negative dentry that was passed to the parent's lookup func This is to avoid filling the dcache with case-insensitive names to the same inode, only the actual correct case is stored in the dcache for case-insensitive filesystems. For a case-insensitive lookup match and if the the case-exact dentry already exists in in the dcache, use it and return it. If no entry exists with the exact case name, allocate new dentry with the exact case, and return the spliced entry. | |
enum | slow_d_compare { D_COMP_OK, D_COMP_NOMATCH, D_COMP_SEQRETRY } |
struct dentry * | d_add_ci (struct dentry *dentry, struct inode *inode, struct qstr *name) |
EXPORT_SYMBOL (d_add_ci) | |
: Name to find. | |
Check whether a dentry already exists for the given name, and return the inode number if it has an inode. Otherwise 0 is returned. This routine is used to post-process directory listings for filesystems using synthetic inode numbers, and is necessary to keep getcwd() working. | |
int sysctl_vfs_cache_pressure | __read_mostly = 100 |
ino_t | find_inode_number (struct dentry *dir, struct qstr *name) |
EXPORT_SYMBOL (find_inode_number) | |
__setup ("dhash_entries=", set_dhash_entries) | |
EXPORT_SYMBOL (names_cachep) | |
EXPORT_SYMBOL (d_genocide) | |
void __init | vfs_caches_init_early (void) |
void __init | vfs_caches_init (unsigned long mempages) |
enum slow_d_compare |
d_drop - drop a dentry : dentry to drop
d_drop() unhashes the entry from the parent dentry hashes, so that it won't be found through a VFS lookup any more. Note that this is different from deleting the dentry - d_delete will try to mark the dentry negative if possible, giving a successful negative lookup, while d_drop will just make the cache lookup fail.
d_drop() is used mainly for stuff that wants to invalidate a dentry for some reason (NFS timeouts or autofs deletes).
__d_drop requires dentry->d_lock.
__d_path - return the path of a dentry : the dentry/vfsmount to report : root vfsmnt/dentry : buffer to return value in : buffer length
Convert a dentry into an ASCII path name.
Returns a pointer into the buffer or an error code if the path was too long.
"buflen" should be positive.
If the path is not reachable from the supplied root, return NULL.
__setup | ( | ) |
d_instantiate - fill in inode information for a dentry : dentry to complete : inode to attach to this dentry
Fill in inode information in the entry.
This turns negative dentries into productive full members of society.
NOTE! This assumes that the inode count has been incremented (or otherwise set) by the caller to indicate that it is now in use by the dcache.
d_invalidate - invalidate a dentry : dentry to invalidate
Try to invalidate the dentry if it turns out to be possible. If there are other dentries that can be reached through this one we can't delete it and we return -EBUSY. On success we return 0.
no dcache lock.
d_materialise_unique - introduce an inode into the tree : candidate dentry : inode to bind to the dentry, to which aliases may be attached
Introduces an dentry into the tree, substituting an extant disconnected root directory alias in its place if there is one. Caller must hold the i_mutex of the parent directory.
d_obtain_alias - find or allocate a dentry for a given inode : inode to allocate the dentry for
Obtain a dentry for an inode resulting from NFS filehandle conversion or similar open by handle operations. The returned dentry may be anonymous, or may have a full name (if the inode was already in the cache).
When called on a directory inode, we must ensure that the inode only ever has one dentry. If a dentry is found, that is returned instead of allocating a new one.
On successful return, the reference to the inode has been transferred to the dentry. In case of an error the reference on the inode is released. To make it easier to use in export operations a NULL or IS_ERR inode may be passed in and will be the error will be propagate to the return value, with a NULL replaced by ERR_PTR(-ESTALE).
d_path - return the path of a dentry : path to report : buffer to return value in : buffer length
Convert a dentry into an ASCII path name. If the entry has been deleted the string " (deleted)" is appended. Note that this is ambiguous.
Returns a pointer into the buffer or an error code if the path was too long. Note: Callers should use the returned pointer, not the passed in buffer, to use the name! The implementation often starts at an offset into the buffer, and may leave 0 bytes at the start.
"buflen" should be positive.
d_splice_alias - splice a disconnected dentry into the tree if one exists : the inode which may have a disconnected dentry : a negative dentry which we want to point to the inode.
If inode is a directory and has a 'disconnected' dentry (i.e. IS_ROOT and DCACHE_DISCONNECTED), then d_move that in place of the given dentry and return it, else simply d_add the inode to the dentry and return NULL.
This is needed in the lookup routine of any filesystem that is exportable (via knfsd) so that we can build dcache paths to directories effectively.
If a dentry was found and moved, then it is returned. Otherwise NULL is returned. This matches the expected return value of ->lookup.
d_validate - verify dentry provided from insecure source (deprecated) : The dentry alleged to be valid child of : The parent dentry (known to be valid)
An insecure source has sent us a dentry, here we verify it and dget() it. This is used by ncpfs in its readdir implementation. Zero is returned in the dentry is invalid.
This function is slow for big directories, and deprecated, do not use it.
__cacheline_aligned_in_smp DEFINE_SEQLOCK | ( | rename_lock | ) |
EXPORT_SYMBOL | ( | rename_lock | ) |
EXPORT_SYMBOL | ( | __d_drop | ) |
EXPORT_SYMBOL | ( | d_drop | ) |
EXPORT_SYMBOL | ( | d_clear_need_lookup | ) |
EXPORT_SYMBOL | ( | dput | ) |
EXPORT_SYMBOL | ( | d_invalidate | ) |
EXPORT_SYMBOL | ( | dget_parent | ) |
EXPORT_SYMBOL | ( | d_find_alias | ) |
EXPORT_SYMBOL | ( | d_prune_aliases | ) |
EXPORT_SYMBOL | ( | shrink_dcache_sb | ) |
EXPORT_SYMBOL | ( | have_submounts | ) |
EXPORT_SYMBOL | ( | shrink_dcache_parent | ) |
EXPORT_SYMBOL | ( | d_alloc | ) |
EXPORT_SYMBOL | ( | d_alloc_pseudo | ) |
EXPORT_SYMBOL | ( | d_alloc_name | ) |
EXPORT_SYMBOL | ( | d_set_d_op | ) |
EXPORT_SYMBOL | ( | d_instantiate | ) |
EXPORT_SYMBOL | ( | d_instantiate_unique | ) |
EXPORT_SYMBOL | ( | d_make_root | ) |
EXPORT_SYMBOL | ( | d_find_any_alias | ) |
EXPORT_SYMBOL | ( | d_obtain_alias | ) |
EXPORT_SYMBOL | ( | d_splice_alias | ) |
EXPORT_SYMBOL | ( | d_add_ci | ) |
EXPORT_SYMBOL | ( | d_lookup | ) |
EXPORT_SYMBOL | ( | d_validate | ) |
EXPORT_SYMBOL | ( | d_delete | ) |
EXPORT_SYMBOL | ( | d_rehash | ) |
EXPORT_SYMBOL | ( | dentry_update_name_case | ) |
EXPORT_SYMBOL | ( | d_move | ) |
EXPORT_SYMBOL | ( | d_path | ) |
EXPORT_SYMBOL | ( | dentry_path_raw | ) |
EXPORT_SYMBOL | ( | find_inode_number | ) |
EXPORT_SYMBOL | ( | names_cachep | ) |
EXPORT_SYMBOL | ( | d_genocide | ) |
EXPORT_SYMBOL_GPL | ( | sysctl_vfs_cache_pressure | ) |
EXPORT_SYMBOL_GPL | ( | d_materialise_unique | ) |
is_subdir - is new dentry a subdirectory of old_dentry : new dentry : old dentry
Returns 1 if new_dentry is a subdirectory of the parent (at any depth). Returns 0 otherwise. Caller must ensure that "new_dentry" is pinned before calling is_subdir()
void prune_dcache_sb | ( | struct super_block * | sb, |
int | count | ||
) |
prune_dcache_sb - shrink the dcache : superblock : number of entries to try to free
Attempt to shrink the superblock dcache LRU by entries. This is done when we need more memory an called from the superblock shrinker function.
This function may fail to free any resources if all the dentries are in use.
void shrink_dcache_for_umount | ( | struct super_block * | sb | ) |
void shrink_dcache_sb | ( | struct super_block * | sb | ) |
struct kmem_cache* names_cachep __read_mostly = 100 |
struct dentry_stat_t dentry_stat |