#include <linux/module.h>
#include <linux/init.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/bio.h>
#include <linux/prefetch.h>
#include <linux/pagevec.h>
#include "../pnfs.h"
#include "../nfs4session.h"
#include "../internal.h"
#include "blocklayout.h"
#define NFSDBG_FACILITY …
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
static bool is_hole(struct pnfs_block_extent *be)
{ … }
struct parallel_io { … };
static inline struct parallel_io *alloc_parallel(void *data)
{ … }
static inline void get_parallel(struct parallel_io *p)
{ … }
static void destroy_parallel(struct kref *kref)
{ … }
static inline void put_parallel(struct parallel_io *p)
{ … }
static struct bio *
bl_submit_bio(struct bio *bio)
{ … }
static bool offset_in_map(u64 offset, struct pnfs_block_dev_map *map)
{ … }
static struct bio *
do_add_page_to_bio(struct bio *bio, int npg, enum req_op op, sector_t isect,
struct page *page, struct pnfs_block_dev_map *map,
struct pnfs_block_extent *be, bio_end_io_t end_io,
struct parallel_io *par, unsigned int offset, int *len)
{ … }
static void bl_mark_devices_unavailable(struct nfs_pgio_header *header, bool rw)
{ … }
static void bl_end_io_read(struct bio *bio)
{ … }
static void bl_read_cleanup(struct work_struct *work)
{ … }
static void
bl_end_par_io_read(void *data)
{ … }
static enum pnfs_try_status
bl_read_pagelist(struct nfs_pgio_header *header)
{ … }
static void bl_end_io_write(struct bio *bio)
{ … }
static void bl_write_cleanup(struct work_struct *work)
{ … }
static void bl_end_par_io_write(void *data)
{ … }
static enum pnfs_try_status
bl_write_pagelist(struct nfs_pgio_header *header, int sync)
{ … }
static void bl_free_layout_hdr(struct pnfs_layout_hdr *lo)
{ … }
static struct pnfs_layout_hdr *__bl_alloc_layout_hdr(struct inode *inode,
gfp_t gfp_flags, bool is_scsi_layout)
{ … }
static struct pnfs_layout_hdr *bl_alloc_layout_hdr(struct inode *inode,
gfp_t gfp_flags)
{ … }
static struct pnfs_layout_hdr *sl_alloc_layout_hdr(struct inode *inode,
gfp_t gfp_flags)
{ … }
static void bl_free_lseg(struct pnfs_layout_segment *lseg)
{ … }
struct layout_verification { … };
static int verify_extent(struct pnfs_block_extent *be,
struct layout_verification *lv)
{ … }
static int decode_sector_number(__be32 **rp, sector_t *sp)
{ … }
static struct nfs4_deviceid_node *
bl_find_get_deviceid(struct nfs_server *server,
const struct nfs4_deviceid *id, const struct cred *cred,
gfp_t gfp_mask)
{ … }
static int
bl_alloc_extent(struct xdr_stream *xdr, struct pnfs_layout_hdr *lo,
struct layout_verification *lv, struct list_head *extents,
gfp_t gfp_mask)
{ … }
static struct pnfs_layout_segment *
bl_alloc_lseg(struct pnfs_layout_hdr *lo, struct nfs4_layoutget_res *lgr,
gfp_t gfp_mask)
{ … }
static void
bl_return_range(struct pnfs_layout_hdr *lo,
struct pnfs_layout_range *range)
{ … }
static int
bl_prepare_layoutcommit(struct nfs4_layoutcommit_args *arg)
{ … }
static void
bl_cleanup_layoutcommit(struct nfs4_layoutcommit_data *lcdata)
{ … }
static int
bl_set_layoutdriver(struct nfs_server *server, const struct nfs_fh *fh)
{ … }
static bool
is_aligned_req(struct nfs_pageio_descriptor *pgio,
struct nfs_page *req, unsigned int alignment, bool is_write)
{ … }
static void
bl_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
{ … }
static size_t
bl_pg_test_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
struct nfs_page *req)
{ … }
static u64 pnfs_num_cont_bytes(struct inode *inode, pgoff_t idx)
{ … }
static void
bl_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
{ … }
static size_t
bl_pg_test_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
struct nfs_page *req)
{ … }
static const struct nfs_pageio_ops bl_pg_read_ops = …;
static const struct nfs_pageio_ops bl_pg_write_ops = …;
static struct pnfs_layoutdriver_type blocklayout_type = …;
static struct pnfs_layoutdriver_type scsilayout_type = …;
static int __init nfs4blocklayout_init(void)
{ … }
static void __exit nfs4blocklayout_exit(void)
{ … }
MODULE_ALIAS(…) …;
MODULE_ALIAS(…) …;
module_init(…) …;
module_exit(nfs4blocklayout_exit);