nfs-ganesha 1.4
Functions

cache_inode_remove.c File Reference

Removes an entry of any type. More...

#include "log.h"
#include "HashData.h"
#include "HashTable.h"
#include "fsal.h"
#include "cache_inode.h"
#include "cache_inode_lru.h"
#include "cache_inode_weakref.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
#include <time.h>
#include <pthread.h>
#include <assert.h>

Go to the source code of this file.

Functions

cache_inode_status_t cache_inode_is_dir_empty (cache_entry_t *entry)
 Checks if a directory is empty without a lock.
cache_inode_status_t cache_inode_is_dir_empty_WithLock (cache_entry_t *entry)
 Checks if a directory is empty, acquiring lock.
cache_inode_status_t cache_inode_clean_internal (cache_entry_t *entry)
 Clean resources associated with entry.
cache_inode_status_t cache_inode_remove (cache_entry_t *entry, fsal_name_t *name, fsal_attrib_list_t *attr, fsal_op_context_t *context, cache_inode_status_t *status)
 Public function to remove a name from a directory.
cache_inode_status_t cache_inode_remove_impl (cache_entry_t *entry, fsal_name_t *name, fsal_op_context_t *context, cache_inode_status_t *status, uint32_t flags)
 Implement actual work of removing file.

Detailed Description

Removes an entry of any type.

Author:
Author:
leibovic
Date:
Date:
2006/01/31 10:18:58
Version:
Revision:
1.32

Definition in file cache_inode_remove.c.


Function Documentation

cache_inode_status_t cache_inode_clean_internal ( cache_entry_t entry)

Clean resources associated with entry.

This function frees the various resources associated wiith a cache entry.

Parameters:
[in]entryEntry to be cleaned
Returns:
CACHE_INODE_SUCCESS or various errors

Definition at line 106 of file cache_inode_remove.c.

cache_inode_status_t cache_inode_is_dir_empty ( cache_entry_t entry)

Checks if a directory is empty without a lock.

This function checks if the supplied directory is empty. The caller must hold the content lock.

Parameters:
[in]entryEntry to be checked (should be of type DIRECTORY)
Return values:
CACHE_INODE_SUCCESSis directory is empty
CACHE_INODE_BAD_TYPEis pentry is not of type DIRECTORY
CACHE_INODE_DIR_NOT_EMPTYif pentry is not empty

Definition at line 51 of file cache_inode_remove.c.

cache_inode_status_t cache_inode_is_dir_empty_WithLock ( cache_entry_t entry)

Checks if a directory is empty, acquiring lock.

This function checks if the supplied cache entry represents an empty directory. This function acquires the content lock, which must not be held by the caller.

Parameters:
[in]entryEntry to be checked (should be of type DIRECTORY)
Return values:
CACHE_INODE_SUCCESSis directory is empty
CACHE_INODE_BAD_TYPEis pentry is not of type DIRECTORY
CACHE_INODE_DIR_NOT_EMPTYif pentry is not empty

Definition at line 84 of file cache_inode_remove.c.

cache_inode_status_t cache_inode_remove ( cache_entry_t entry,
fsal_name_t name,
fsal_attrib_list_t attr,
fsal_op_context_t context,
cache_inode_status_t status 
)

Public function to remove a name from a directory.

Removes a name from the supplied directory. The caller should hold no locks on the directory.

Parameters:
[in]entryEntry for the parent directory to be managed
[in]nameName to be removed
[out]attrAttributes of the directory on success
[in]contextFSAL credentials
[out]statusReturned status
Return values:
CACHE_INODE_SUCCESSif operation is a success

Definition at line 164 of file cache_inode_remove.c.

cache_inode_status_t cache_inode_remove_impl ( cache_entry_t entry,
fsal_name_t name,
fsal_op_context_t context,
cache_inode_status_t status,
uint32_t  flags 
)

Implement actual work of removing file.

Actually remove an entry from the directory. Assume that the directory contents and attributes are locked for writes. The attribute lock is released unless keep_md_lock is TRUE.

Parameters:
[in]entryEntry for the parent directory to be managed.
[in]nameName of the entry that we are looking for in the cache.
[in]contextFSAL credentials
[in]statusReturned status
[in]flagsFlags to control lock retention
Returns:
CACHE_INODE_SUCCESS if operation is a success

Definition at line 231 of file cache_inode_remove.c.