linux/fs/coda/dir.c

// SPDX-License-Identifier: GPL-2.0

/*
 * Directory operations for Coda filesystem
 * Original version: (C) 1996 P. Braam and M. Callahan
 * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
 * 
 * Carnegie Mellon encourages users to contribute improvements to
 * the Coda project. Contact Peter Braam ([email protected]).
 */

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/file.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/namei.h>
#include <linux/uaccess.h>

#include <linux/coda.h>
#include "coda_psdev.h"
#include "coda_linux.h"
#include "coda_cache.h"

#include "coda_int.h"

/* same as fs/bad_inode.c */
static int coda_return_EIO(void)
{}
#define CODA_EIO_ERROR

/* inode operations for directories */
/* access routines: lookup, readlink, permission */
static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsigned int flags)
{}


int coda_permission(struct mnt_idmap *idmap, struct inode *inode,
		    int mask)
{}


static inline void coda_dir_update_mtime(struct inode *dir)
{}

/* we have to wrap inc_nlink/drop_nlink because sometimes userspace uses a
 * trick to fool GNU find's optimizations. If we can't be sure of the link
 * (because of volume mount points) we set i_nlink to 1 which forces find
 * to consider every child as a possible directory. We should also never
 * see an increment or decrement for deleted directories where i_nlink == 0 */
static inline void coda_dir_inc_nlink(struct inode *dir)
{}

static inline void coda_dir_drop_nlink(struct inode *dir)
{}

/* creation routines: create, mknod, mkdir, link, symlink */
static int coda_create(struct mnt_idmap *idmap, struct inode *dir,
		       struct dentry *de, umode_t mode, bool excl)
{}

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

/* try to make de an entry in dir_inodde linked to source_de */ 
static int coda_link(struct dentry *source_de, struct inode *dir_inode, 
	  struct dentry *de)
{}


static int coda_symlink(struct mnt_idmap *idmap,
			struct inode *dir_inode, struct dentry *de,
			const char *symname)
{}

/* destruction routines: unlink, rmdir */
static int coda_unlink(struct inode *dir, struct dentry *de)
{}

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

/* rename */
static int coda_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 inline unsigned int CDT2DT(unsigned char cdt)
{}

/* support routines */
static int coda_venus_readdir(struct file *coda_file, struct dir_context *ctx)
{}

/* file operations for directories */
static int coda_readdir(struct file *coda_file, struct dir_context *ctx)
{}

/* called when a cache lookup succeeds */
static int coda_dentry_revalidate(struct dentry *de, unsigned int flags)
{}

/*
 * This is the callback from dput() when d_count is going to 0.
 * We use this to unhash dentries with bad inodes.
 */
static int coda_dentry_delete(const struct dentry * dentry)
{}



/*
 * This is called when we want to check if the inode has
 * changed on the server.  Coda makes this easy since the
 * cache manager Venus issues a downcall to the kernel when this 
 * happens 
 */
int coda_revalidate_inode(struct inode *inode)
{}

const struct dentry_operations coda_dentry_operations =;

const struct inode_operations coda_dir_inode_operations =;

WRAP_DIR_ITER() // FIXME!
const struct file_operations coda_dir_operations =;