linux/fs/reiserfs/namei.c

/*
 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
 *
 * Trivial changes by Alan Cox to remove EHASHCOLLISION for compatibility
 *
 * Trivial Changes:
 * Rights granted to Hans Reiser to redistribute under other terms providing
 * he accepts all liability including but not limited to patent, fitness
 * for purpose, and direct or indirect claims arising from failure to perform.
 *
 * NO WARRANTY
 */

#include <linux/time.h>
#include <linux/bitops.h>
#include <linux/slab.h>
#include "reiserfs.h"
#include "acl.h"
#include "xattr.h"
#include <linux/quotaops.h>

#define INC_DIR_INODE_NLINK(i)
#define DEC_DIR_INODE_NLINK(i)

/*
 * directory item contains array of entry headers. This performs
 * binary search through that array
 */
static int bin_search_in_dir_item(struct reiserfs_dir_entry *de, loff_t off)
{}

/*
 * comment?  maybe something like set de to point to what the path points to?
 */
static inline void set_de_item_location(struct reiserfs_dir_entry *de,
					struct treepath *path)
{}

/*
 * de_bh, de_ih, de_deh (points to first element of array), de_item_num is set
 */
inline void set_de_name_and_namelen(struct reiserfs_dir_entry *de)
{}

/* what entry points to */
static inline void set_de_object_key(struct reiserfs_dir_entry *de)
{}

static inline void store_de_entry_key(struct reiserfs_dir_entry *de)
{}

/*
 * We assign a key to each directory item, and place multiple entries in a
 * single directory item.  A directory item has a key equal to the key of
 * the first directory entry in it.

 * This function first calls search_by_key, then, if item whose first entry
 * matches is not found it looks for the entry inside directory item found
 * by search_by_key. Fills the path to the entry, and to the entry position
 * in the item
 */
/* The function is NOT SCHEDULE-SAFE! */
int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
			struct treepath *path, struct reiserfs_dir_entry *de)
{}

/* Keyed 32-bit hash function using TEA in a Davis-Meyer function */

/*
 * The third component is hashed, and you can choose from more than
 * one hash function.  Per directory hashes are not yet implemented
 * but are thought about. This function should be moved to hashes.c
 * Jedi, please do so.  -Hans
 */
static __u32 get_third_component(struct super_block *s,
				 const char *name, int len)
{}

static int reiserfs_match(struct reiserfs_dir_entry *de,
			  const char *name, int namelen)
{}

/* de's de_bh, de_ih, de_deh, de_item_num, de_entry_num are set already */

/* used when hash collisions exist */

static int linear_search_in_dir_item(struct cpu_key *key,
				     struct reiserfs_dir_entry *de,
				     const char *name, int namelen)
{}

/*
 * may return NAME_FOUND, NAME_FOUND_INVISIBLE, NAME_NOT_FOUND
 * FIXME: should add something like IOERROR
 */
static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen,
			       struct treepath *path_to_entry,
			       struct reiserfs_dir_entry *de)
{}

static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
				      unsigned int flags)
{}

/*
 * looks up the dentry of the parent directory for child.
 * taken from ext2_get_parent
 */
struct dentry *reiserfs_get_parent(struct dentry *child)
{}

/* add entry to the directory (entry can be hidden).

insert definition of when hidden directories are used here -Hans

 Does not mark dir   inode dirty, do it after successesfull call to it */

static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
			      struct inode *dir, const char *name, int namelen,
			      struct inode *inode, int visible)
{}

/*
 * quota utility function, call if you've had to abort after calling
 * new_inode_init, and have not called reiserfs_new_inode yet.
 * This should only be called on inodes that do not have stat data
 * inserted into the tree yet.
 */
static int drop_new_inode(struct inode *inode)
{}

/*
 * utility function that does setup for reiserfs_new_inode.
 * dquot_initialize needs lots of credits so it's better to have it
 * outside of a transaction, so we had to pull some bits of
 * reiserfs_new_inode out into this func.
 */
static int new_inode_init(struct inode *inode, struct inode *dir, umode_t mode)
{}

static int reiserfs_create(struct mnt_idmap *idmap, struct inode *dir,
			   struct dentry *dentry, umode_t mode, bool excl)
{}

static int reiserfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
			  struct dentry *dentry, umode_t mode, dev_t rdev)
{}

static int reiserfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
			  struct dentry *dentry, umode_t mode)
{}

static inline int reiserfs_empty_dir(struct inode *inode)
{}

static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
{}

static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
{}

static int reiserfs_symlink(struct mnt_idmap *idmap,
			    struct inode *parent_dir, struct dentry *dentry,
			    const char *symname)
{}

static int reiserfs_link(struct dentry *old_dentry, struct inode *dir,
			 struct dentry *dentry)
{}

/* de contains information pointing to an entry which */
static int de_still_valid(const char *name, int len,
			  struct reiserfs_dir_entry *de)
{}

static int entry_points_to_object(const char *name, int len,
				  struct reiserfs_dir_entry *de,
				  struct inode *inode)
{}

/* sets key of objectid the entry has to point to */
static void set_ino_in_dir_entry(struct reiserfs_dir_entry *de,
				 struct reiserfs_key *key)
{}

/*
 * process, that is going to call fix_nodes/do_balance must hold only
 * one path. If it holds 2 or more, it can get into endless waiting in
 * get_empty_nodes or its clones
 */
static int reiserfs_rename(struct mnt_idmap *idmap,
			   struct inode *old_dir, struct dentry *old_dentry,
			   struct inode *new_dir, struct dentry *new_dentry,
			   unsigned int flags)
{}

static const struct inode_operations reiserfs_priv_dir_inode_operations =;

static const struct inode_operations reiserfs_priv_symlink_inode_operations =;

static const struct inode_operations reiserfs_priv_special_inode_operations =;

void reiserfs_init_priv_inode(struct inode *inode)
{}

/* directories can handle most operations...  */
const struct inode_operations reiserfs_dir_inode_operations =;

/*
 * symlink operations.. same as page_symlink_inode_operations, with xattr
 * stuff added
 */
const struct inode_operations reiserfs_symlink_inode_operations =;

/*
 * special file operations.. just xattr/acl stuff
 */
const struct inode_operations reiserfs_special_inode_operations =;