linux/fs/nfs/filelayout/filelayout.c

/*
 *  Module for the pnfs nfs4 file layout driver.
 *  Defines all I/O and Policy interface operations, plus code
 *  to register itself with the pNFS client.
 *
 *  Copyright (c) 2002
 *  The Regents of the University of Michigan
 *  All Rights Reserved
 *
 *  Dean Hildebrand <[email protected]>
 *
 *  Permission is granted to use, copy, create derivative works, and
 *  redistribute this software and such derivative works for any purpose,
 *  so long as the name of the University of Michigan is not used in
 *  any advertising or publicity pertaining to the use or distribution
 *  of this software without specific, written prior authorization. If
 *  the above copyright notice or any other identification of the
 *  University of Michigan is included in any copy of any portion of
 *  this software, then the disclaimer below must also be included.
 *
 *  This software is provided as is, without representation or warranty
 *  of any kind either express or implied, including without limitation
 *  the implied warranties of merchantability, fitness for a particular
 *  purpose, or noninfringement.  The Regents of the University of
 *  Michigan shall not be liable for any damages, including special,
 *  indirect, incidental, or consequential damages, with respect to any
 *  claim arising out of or in connection with the use of the software,
 *  even if it has been or is hereafter advised of the possibility of
 *  such damages.
 */

#include <linux/nfs_fs.h>
#include <linux/nfs_page.h>
#include <linux/module.h>
#include <linux/backing-dev.h>

#include <linux/sunrpc/metrics.h>

#include "../nfs4session.h"
#include "../internal.h"
#include "../delegation.h"
#include "filelayout.h"
#include "../nfs4trace.h"

#define NFSDBG_FACILITY

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();

#define FILELAYOUT_POLL_RETRY_MAX
static const struct pnfs_commit_ops filelayout_commit_ops;

static loff_t
filelayout_get_dense_offset(struct nfs4_filelayout_segment *flseg,
			    loff_t offset)
{}

/* This function is used by the layout driver to calculate the
 * offset of the file on the dserver based on whether the
 * layout type is STRIPE_DENSE or STRIPE_SPARSE
 */
static loff_t
filelayout_get_dserver_offset(struct pnfs_layout_segment *lseg, loff_t offset)
{}

static void filelayout_reset_write(struct nfs_pgio_header *hdr)
{}

static void filelayout_reset_read(struct nfs_pgio_header *hdr)
{}

static int filelayout_async_handle_error(struct rpc_task *task,
					 struct nfs4_state *state,
					 struct nfs_client *clp,
					 struct pnfs_layout_segment *lseg)
{}

/* NFS_PROTO call done callback routines */

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

/*
 * We reference the rpc_cred of the first WRITE that triggers the need for
 * a LAYOUTCOMMIT, and use it to send the layoutcommit compound.
 * rfc5661 is not clear about which credential should be used.
 */
static void
filelayout_set_layoutcommit(struct nfs_pgio_header *hdr)
{}

bool
filelayout_test_devid_unavailable(struct nfs4_deviceid_node *node)
{}

static bool
filelayout_reset_to_mds(struct pnfs_layout_segment *lseg)
{}

/*
 * Call ops for the async read/write cases
 * In the case of dense layouts, the offset needs to be reset to its
 * original value.
 */
static void filelayout_read_prepare(struct rpc_task *task, void *data)
{}

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

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

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

static int filelayout_commit_done_cb(struct rpc_task *task,
				     struct nfs_commit_data *data)
{}

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

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

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

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

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

static const struct rpc_call_ops filelayout_read_call_ops =;

static const struct rpc_call_ops filelayout_write_call_ops =;

static const struct rpc_call_ops filelayout_commit_call_ops =;

static enum pnfs_try_status
filelayout_read_pagelist(struct nfs_pgio_header *hdr)
{}

/* Perform async writes. */
static enum pnfs_try_status
filelayout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
{}

static int
filelayout_check_deviceid(struct pnfs_layout_hdr *lo,
			  struct nfs4_filelayout_segment *fl,
			  gfp_t gfp_flags)
{}

/*
 * filelayout_check_layout()
 *
 * Make sure layout segment parameters are sane WRT the device.
 * At this point no generic layer initialization of the lseg has occurred,
 * and nothing has been added to the layout_hdr cache.
 *
 */
static int
filelayout_check_layout(struct pnfs_layout_hdr *lo,
			struct nfs4_filelayout_segment *fl,
			struct nfs4_layoutget_res *lgr,
			gfp_t gfp_flags)
{}

static void _filelayout_free_lseg(struct nfs4_filelayout_segment *fl)
{}

static int
filelayout_decode_layout(struct pnfs_layout_hdr *flo,
			 struct nfs4_filelayout_segment *fl,
			 struct nfs4_layoutget_res *lgr,
			 gfp_t gfp_flags)
{}

static void
filelayout_free_lseg(struct pnfs_layout_segment *lseg)
{}

static struct pnfs_layout_segment *
filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
		      struct nfs4_layoutget_res *lgr,
		      gfp_t gfp_flags)
{}

static bool
filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg)
{}

/*
 * filelayout_pg_test(). Called by nfs_can_coalesce_requests()
 *
 * Return 0 if @req cannot be coalesced into @pgio, otherwise return the number
 * of bytes (maximum @req->wb_bytes) that can be coalesced.
 */
static size_t
filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
		   struct nfs_page *req)
{}

static struct pnfs_layout_segment *
fl_pnfs_update_layout(struct inode *ino,
		      struct nfs_open_context *ctx,
		      loff_t pos,
		      u64 count,
		      enum pnfs_iomode iomode,
		      bool strict_iomode,
		      gfp_t gfp_flags)
{}

static void
filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
			struct nfs_page *req)
{}

static void
filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
			 struct nfs_page *req)
{}

static const struct nfs_pageio_ops filelayout_pg_read_ops =;

static const struct nfs_pageio_ops filelayout_pg_write_ops =;

static u32 select_bucket_index(struct nfs4_filelayout_segment *fl, u32 j)
{}

static void
filelayout_mark_request_commit(struct nfs_page *req,
			       struct pnfs_layout_segment *lseg,
			       struct nfs_commit_info *cinfo,
			       u32 ds_commit_idx)

{}

static u32 calc_ds_index_from_commit(struct pnfs_layout_segment *lseg, u32 i)
{}

static struct nfs_fh *
select_ds_fh_from_commit(struct pnfs_layout_segment *lseg, u32 i)
{}

static int filelayout_initiate_commit(struct nfs_commit_data *data, int how)
{}

static int
filelayout_commit_pagelist(struct inode *inode, struct list_head *mds_pages,
			   int how, struct nfs_commit_info *cinfo)
{}

static struct nfs4_deviceid_node *
filelayout_alloc_deviceid_node(struct nfs_server *server,
		struct pnfs_device *pdev, gfp_t gfp_flags)
{}

static void
filelayout_free_deviceid_node(struct nfs4_deviceid_node *d)
{}

static struct pnfs_layout_hdr *
filelayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags)
{}

static void
filelayout_free_layout_hdr(struct pnfs_layout_hdr *lo)
{}

static struct pnfs_ds_commit_info *
filelayout_get_ds_info(struct inode *inode)
{}

static void
filelayout_setup_ds_info(struct pnfs_ds_commit_info *fl_cinfo,
		struct pnfs_layout_segment *lseg)
{}

static void
filelayout_release_ds_info(struct pnfs_ds_commit_info *fl_cinfo,
		struct inode *inode)
{}

static const struct pnfs_commit_ops filelayout_commit_ops =;

static struct pnfs_layoutdriver_type filelayout_type =;

static int __init nfs4filelayout_init(void)
{}

static void __exit nfs4filelayout_exit(void)
{}

MODULE_ALIAS();

module_init();
module_exit(nfs4filelayout_exit);