Remove unused MMAP functions
The following functions were required for the OpenSolaris mmap implementation. Because the Linux VFS does most the most heavy lifting for us they are not required and are being removed to keep the code clean and easy to understand. * zfs_null_putapage() * zfs_frlock() * zfs_no_putpage() Signed-off-by: Brian Behlendorf <behlendorf@llnl.gov>
This commit is contained in:
parent
dde471ef5a
commit
f0b2486034
@ -3712,21 +3712,6 @@ zfs_link(struct inode *tdip, struct inode *sip, char *name, cred_t *cr)
|
||||
}
|
||||
EXPORT_SYMBOL(zfs_link);
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
/*
|
||||
* zfs_null_putapage() is used when the file system has been force
|
||||
* unmounted. It just drops the pages.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zfs_null_putapage(vnode_t *vp, page_t *pp, u_offset_t *offp,
|
||||
size_t *lenp, int flags, cred_t *cr)
|
||||
{
|
||||
pvn_write_done(pp, B_INVAL|B_FORCE|B_ERROR);
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_MMAP */
|
||||
|
||||
/*
|
||||
* Push a page out to disk
|
||||
*
|
||||
@ -3925,36 +3910,6 @@ zfs_seek(struct inode *ip, offset_t ooff, offset_t *noffp)
|
||||
}
|
||||
EXPORT_SYMBOL(zfs_seek);
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
/*
|
||||
* Pre-filter the generic locking function to trap attempts to place
|
||||
* a mandatory lock on a memory mapped file.
|
||||
*/
|
||||
static int
|
||||
zfs_frlock(vnode_t *vp, int cmd, flock64_t *bfp, int flag, offset_t offset,
|
||||
flk_callback_t *flk_cbp, cred_t *cr)
|
||||
{
|
||||
znode_t *zp = VTOZ(vp);
|
||||
zfsvfs_t *zfsvfs = zp->z_zfsvfs;
|
||||
|
||||
ZFS_ENTER(zfsvfs);
|
||||
ZFS_VERIFY_ZP(zp);
|
||||
|
||||
/*
|
||||
* We are following the UFS semantics with respect to mapcnt
|
||||
* here: If we see that the file is mapped already, then we will
|
||||
* return an error, but we don't worry about races between this
|
||||
* function and zfs_map().
|
||||
*/
|
||||
if (zp->z_mapcnt > 0 && MANDMODE(zp->z_mode)) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (EAGAIN);
|
||||
}
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (fs_frlock(vp, cmd, bfp, flag, offset, flk_cbp, cr, ct));
|
||||
}
|
||||
#endif /* HAVE_MMAP */
|
||||
|
||||
/*
|
||||
* Fill pages with data from the disk.
|
||||
*/
|
||||
|
@ -1119,22 +1119,6 @@ zfs_grow_blocksize(znode_t *zp, uint64_t size, dmu_tx_t *tx)
|
||||
dmu_object_size_from_db(sa_get_db(zp->z_sa_hdl), &zp->z_blksz, &dummy);
|
||||
}
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
/*
|
||||
* This is a dummy interface used when pvn_vplist_dirty() should *not*
|
||||
* be calling back into the fs for a putpage(). E.g.: when truncating
|
||||
* a file, the pages being "thrown away* don't need to be written out.
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zfs_no_putpage(vnode_t *vp, page_t *pp, u_offset_t *offp, size_t *lenp,
|
||||
int flags, cred_t *cr)
|
||||
{
|
||||
ASSERT(0);
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_MMAP */
|
||||
|
||||
/*
|
||||
* Increase the file length
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user