/* adosfsmount.h 930817 Niklas Hallqvist <niklas@appli.se> */

/* Mostly based on ufs/ufsmount.h */

/*
 * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

#ifndef _ADOSFS_ADOSFSMOUNT_H_
#define _ADOSFS_ADOSFSMOUNT_H_

/* This structure describes the AmigaDOS FS specific mount structure data.  */
struct	adosfsmount {
  struct mount *am_mountp;	/* vfs structure for this filesystem */
  dev_t	am_dev;			/* device mounted */
  struct vnode *am_devvp;	/* vnode for block device mounted */
  int am_ronly;			/* write protect notch */
  ados_u_long am_rootblk;
  struct anode *am_forw;
  struct anode *am_back;
  int am_dos;
  int am_nels;
  int am_nelmax;
  ados_long am_bmap;
  ados_long am_nbmap;
  char am_fstr[NAMESIZE];
};

struct adosfs_fid {
  u_short af_len;
  short af_reserved;
  ados_long af_key;
};

#ifdef KERNEL
/*
 * Convert mount ptr to adosfsmount ptr.
 */
#define VFSTOADOSFS(mp)	((struct adosfsmount *)((mp)->mnt_data))
#endif /* KERNEL */

/*
 * Prototypes for ADOSFS mount operations
 */
int adosfs_mount __P((struct mount *mp, char *path, caddr_t data,
		      struct nameidata *ndp, struct proc *p));
int adosfs_start __P((struct mount *mp, int flags, struct proc *p));
int adosfs_unmount __P((struct mount *mp, int mntflags, struct proc *p));
int adosfs_root __P((struct mount *mp, struct vnode **vpp));
int adosfs_quotactl __P((struct mount *mp, int cmds,
			 int uid, /* should be uid_t */
			 caddr_t arg, struct proc *p));
int adosfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p));
int adosfs_sync __P((struct mount *mp, int waitfor));
int adosfs_fhtovp __P((struct mount *mp, struct fid *fhp, struct vnode **vpp));
int adosfs_vptofh __P((struct vnode *vp, struct fid *fhp));
int adosfs_init __P(());

#endif /* !_ADOSFS_ADOSFSMOUNT_H_ */
