linux/fs/nfs/blocklayout/blocklayout.c

/*
 *  linux/fs/nfs/blocklayout/blocklayout.c
 *
 *  Module for the NFSv4.1 pNFS block layout driver.
 *
 *  Copyright (c) 2006 The Regents of the University of Michigan.
 *  All rights reserved.
 *
 *  Andy Adamson <[email protected]>
 *  Fred Isaman <[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 from the
 * university of michigan as to its fitness for any purpose, and without
 * warranty by the university of michigan of any kind, either express
 * or implied, including without limitation the implied warranties of
 * merchantability and fitness for a particular purpose.  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 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/module.h>
#include <linux/init.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/bio.h>		/* struct bio */
#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)
{}

/* The data we are handed might be spread across several bios.  We need
 * to track when the last one is finished.
 */
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)
{}

/* Function scheduled for call during bl_end_par_io_write,
 * it marks sectors as written and extends the commitlist.
 */
static void bl_write_cleanup(struct work_struct *work)
{}

/* Called when last of bios associated with a bl_write_pagelist call finishes */
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)
{}

/* Tracks info needed to ensure extents in layout obey constraints of spec */
struct layout_verification {};

/* Verify the extent meets the layout requirements of the pnfs-block draft,
 * section 2.3.1.
 */
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)
{}

/*
 * 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
bl_pg_test_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
		struct nfs_page *req)
{}

/*
 * Return the number of contiguous bytes for a given inode
 * starting at page frame idx.
 */
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)
{}

/*
 * 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
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);