linux/fs/nfs/proc.c

// SPDX-License-Identifier: GPL-2.0
/*
 *  linux/fs/nfs/proc.c
 *
 *  Copyright (C) 1992, 1993, 1994  Rick Sladkey
 *
 *  OS-independent nfs remote procedure call functions
 *
 *  Tuned by Alan Cox <[email protected]> for >3K buffers
 *  so at last we can have decent(ish) throughput off a 
 *  Sun server.
 *
 *  Coding optimized and cleaned up by Florian La Roche.
 *  Note: Error returns are optimized for NFS_OK, which isn't translated via
 *  nfs_stat_to_errno(), but happens to be already the right return code.
 *
 *  Also, the code currently doesn't check the size of the packet, when
 *  it decodes the packet.
 *
 *  Feel free to fix it and mail me the diffs if it worries you.
 *
 *  Completely rewritten to support the new RPC call interface;
 *  rewrote and moved the entire XDR stuff to xdr.c
 *  --Olaf Kirch June 1996
 *
 *  The code below initializes all auto variables explicitly, otherwise
 *  it will fail to work as a module (gcc generates a memset call for an
 *  incomplete struct).
 */

#include <linux/types.h>
#include <linux/param.h>
#include <linux/time.h>
#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/in.h>
#include <linux/pagemap.h>
#include <linux/sunrpc/clnt.h>
#include <linux/nfs.h>
#include <linux/nfs2.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
#include <linux/lockd/bind.h>
#include <linux/freezer.h>
#include "internal.h"

#define NFSDBG_FACILITY

/*
 * Bare-bones access to getattr: this is for nfs_read_super.
 */
static int
nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
		  struct nfs_fsinfo *info)
{}

/*
 * One function for each procedure in the NFS protocol.
 */
static int
nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
		struct nfs_fattr *fattr, struct inode *inode)
{}

static int
nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
		 struct iattr *sattr)
{}

static int
nfs_proc_lookup(struct inode *dir, struct dentry *dentry,
		struct nfs_fh *fhandle, struct nfs_fattr *fattr)
{}

static int nfs_proc_readlink(struct inode *inode, struct page *page,
		unsigned int pgbase, unsigned int pglen)
{}

struct nfs_createdata {};

static struct nfs_createdata *nfs_alloc_createdata(struct inode *dir,
		struct dentry *dentry, struct iattr *sattr)
{
	struct nfs_createdata *data;

	data = kmalloc(sizeof(*data), GFP_KERNEL);

	if (data != NULL) {
		data->arg.fh = NFS_FH(dir);
		data->arg.name = dentry->d_name.name;
		data->arg.len = dentry->d_name.len;
		data->arg.sattr = sattr;
		nfs_fattr_init(&data->fattr);
		data->fhandle.size = 0;
		data->res.fh = &data->fhandle;
		data->res.fattr = &data->fattr;
	}
	return data;
};

static void nfs_free_createdata(const struct nfs_createdata *data)
{}

static int
nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
		int flags)
{}

/*
 * In NFSv2, mknod is grafted onto the create call.
 */
static int
nfs_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
	       dev_t rdev)
{}
  
static int
nfs_proc_remove(struct inode *dir, struct dentry *dentry)
{}

static void
nfs_proc_unlink_setup(struct rpc_message *msg,
		struct dentry *dentry,
		struct inode *inode)
{}

static void nfs_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
{}

static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{}

static void
nfs_proc_rename_setup(struct rpc_message *msg,
		struct dentry *old_dentry,
		struct dentry *new_dentry)
{}

static void nfs_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renamedata *data)
{}

static int
nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
		     struct inode *new_dir)
{}

static int
nfs_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
{}

static int
nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct folio *folio,
		 unsigned int len, struct iattr *sattr)
{}

static int
nfs_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
{}

static int
nfs_proc_rmdir(struct inode *dir, const struct qstr *name)
{}

/*
 * The READDIR implementation is somewhat hackish - we pass a temporary
 * buffer to the encode function, which installs it in the receive
 * the receive iovec. The decode function just parses the reply to make
 * sure it is syntactically correct; the entries itself are decoded
 * from nfs_readdir by calling the decode_entry function directly.
 */
static int nfs_proc_readdir(struct nfs_readdir_arg *nr_arg,
			    struct nfs_readdir_res *nr_res)
{}

static int
nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
			struct nfs_fsstat *stat)
{}

static int
nfs_proc_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle,
			struct nfs_fsinfo *info)
{}

static int
nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
		  struct nfs_pathconf *info)
{}

static int nfs_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{}

static void nfs_proc_read_setup(struct nfs_pgio_header *hdr,
				struct rpc_message *msg)
{}

static int nfs_proc_pgio_rpc_prepare(struct rpc_task *task,
				     struct nfs_pgio_header *hdr)
{}

static int nfs_write_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{}

static void nfs_proc_write_setup(struct nfs_pgio_header *hdr,
				 struct rpc_message *msg,
				 struct rpc_clnt **clnt)
{}

static void nfs_proc_commit_rpc_prepare(struct rpc_task *task, struct nfs_commit_data *data)
{}

static void
nfs_proc_commit_setup(struct nfs_commit_data *data, struct rpc_message *msg,
			struct rpc_clnt **clnt)
{}

static int
nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
{}

/* Helper functions for NFS lock bounds checking */
#define NFS_LOCK32_OFFSET_MAX
static int nfs_lock_check_bounds(const struct file_lock *fl)
{}

static int nfs_have_delegation(struct inode *inode, fmode_t type, int flags)
{}

static int nfs_return_delegation(struct inode *inode)
{}

static const struct inode_operations nfs_dir_inode_operations =;

static const struct inode_operations nfs_file_inode_operations =;

const struct nfs_rpc_ops nfs_v2_clientops =;