Linux Kernel
3.7.1
|
#include <linux/atomic.h>
#include <linux/list.h>
#include <linux/rculist.h>
#include <linux/rculist_bl.h>
#include <linux/spinlock.h>
#include <linux/seqlock.h>
#include <linux/cache.h>
#include <linux/rcupdate.h>
Go to the source code of this file.
Data Structures | |
struct | qstr |
struct | dentry_stat_t |
struct | dentry |
struct | dentry_operations |
Macros | |
#define | IS_ROOT(x) ((x) == (x)->d_parent) |
#define | HASH_LEN_DECLARE u32 len; u32 hash; |
#define | QSTR_INIT(n, l) { { { .len = l } }, .name = n } |
#define | hashlen_hash(hashlen) ((u32) (hashlen)) |
#define | hashlen_len(hashlen) ((u32)((hashlen) >> 32)) |
#define | init_name_hash() 0 |
#define | DNAME_INLINE_LEN 40 /* 128 bytes */ |
#define | DCACHE_OP_HASH 0x0001 |
#define | DCACHE_OP_COMPARE 0x0002 |
#define | DCACHE_OP_REVALIDATE 0x0004 |
#define | DCACHE_OP_DELETE 0x0008 |
#define | DCACHE_OP_PRUNE 0x0010 |
#define | DCACHE_DISCONNECTED 0x0020 |
#define | DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */ |
#define | DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */ |
#define | DCACHE_CANT_MOUNT 0x0100 |
#define | DCACHE_GENOCIDE 0x0200 |
#define | DCACHE_SHRINK_LIST 0x0400 |
#define | DCACHE_NFSFS_RENAMED 0x1000 |
#define | DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */ |
#define | DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000 |
#define | DCACHE_MOUNTED 0x10000 /* is a mountpoint */ |
#define | DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ |
#define | DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ |
#define | DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */ |
#define | DCACHE_MANAGED_DENTRY (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
#define | DCACHE_DENTRY_KILLED 0x100000 |
Enumerations | |
enum | dentry_d_lock_class { DENTRY_D_LOCK_NORMAL, DENTRY_D_LOCK_NESTED } |
Variables | |
struct dentry_stat_t | dentry_stat |
struct dentry_operations | ____cacheline_aligned |
seqlock_t | rename_lock |
int | sysctl_vfs_cache_pressure |
#define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */ |
#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ |
#define DCACHE_MANAGED_DENTRY (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ |
#define DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */ |
#define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */ |
#define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */ |
enum dentry_d_lock_class |
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.
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.
void shrink_dcache_for_umount | ( | struct super_block * | ) |
void shrink_dcache_sb | ( | struct super_block * | sb | ) |
struct dentry_stat_t dentry_stat |
seqlock_t rename_lock |
int sysctl_vfs_cache_pressure |