#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)
{ … }
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)
{ … }
static int filelayout_read_done_cb(struct rpc_task *task,
struct nfs_pgio_header *hdr)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
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)
{ … }
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);