Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ntfs Fix compilation problems.
details: https://anonhg.NetBSD.org/src/rev/cfcab71b4cd0
branches: trunk
changeset: 472758:cfcab71b4cd0
user: christos <christos%NetBSD.org@localhost>
date: Thu May 06 15:43:17 1999 +0000
description:
Fix compilation problems.
diffstat:
sys/ntfs/ntfs.h | 28 ++++++++++++
sys/ntfs/ntfs_compr.c | 4 +
sys/ntfs/ntfs_compr.h | 2 +
sys/ntfs/ntfs_extern.h | 2 +
sys/ntfs/ntfs_ihash.c | 5 +-
sys/ntfs/ntfs_ihash.h | 2 +
sys/ntfs/ntfs_inode.h | 12 +++-
sys/ntfs/ntfs_subr.c | 22 +++++---
sys/ntfs/ntfs_subr.h | 10 +++-
sys/ntfs/ntfs_vfsops.c | 111 +++++++++++++++++++++++++++++++++++++++++++++---
sys/ntfs/ntfs_vfsops.h | 2 +
sys/ntfs/ntfs_vnops.c | 67 ++++++++++++++++++++++-------
sys/ntfs/ntfsmount.h | 2 +
13 files changed, 227 insertions(+), 42 deletions(-)
diffs (truncated from 725 to 300 lines):
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs.h
--- a/sys/ntfs/ntfs.h Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs.h Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs.h,v 1.2 1999/05/06 15:43:17 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
@@ -286,6 +288,32 @@
MALLOC_DECLARE(M_NTFSNTHASH);
#endif
+#ifdef __NetBSD__
+#define MALLOC_DEFINE(a, b, c)
+#define M_NTFSNTHASH M_TEMP
+#define M_NTFSNTVATTR M_TEMP
+#define M_NTFSRDATA M_TEMP
+#define M_NTFSRUN M_TEMP
+#define M_NTFSDECOMP M_TEMP
+#define M_NTFSMNT M_TEMP
+#define M_NTFSNTNODE M_TEMP
+#define M_NTFSFNODE M_TEMP
+#define M_NTFSDIR M_TEMP
+typedef int (vop_t) __P((void *));
+#define HASHINIT(a, b, c, d) hashinit((a), (b), (c), (d))
+#define bqrelse(bp) brelse(bp)
+#define VOP__LOCK(a, b, c) VOP_LOCK((a), (b) ? LK_EXCLUSIVE : LK_SHARED)
+#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), 0)
+#define VGET(a, b, c) vget((a), LK_EXCLUSIVE)
+#define VN_LOCK(a, b, c) vn_lock((a), LK_EXCLUSIVE)
+#else
+#define HASHINIT(a, b, c, d) hashinit((a), (b), (d))
+#define VOP__LOCK(a, b, c) VOP_LOCK((a), (b), (c))
+#define VOP__UNLOCK(a, b, c) VOP_UNLOCK((a), (b), (c))
+#define VGET(a, b, c) vget((a), (b), (c))
+#define VN_LOCK(a, b, c) vn_lock((a), (b), (c))
+#endif
+
#if defined(NTFS_DEBUG)
#define dprintf(a) printf a
#if NTFS_DEBUG > 1
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_compr.c
--- a/sys/ntfs/ntfs_compr.c Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_compr.c Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_compr.c,v 1.2 1999/05/06 15:43:18 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
@@ -36,7 +38,9 @@
#include <sys/buf.h>
#include <sys/file.h>
#include <sys/malloc.h>
+#ifdef __FreeBSD__
#include <machine/clock.h>
+#endif
#include <miscfs/specfs/specdev.h>
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_compr.h
--- a/sys/ntfs/ntfs_compr.h Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_compr.h Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_compr.h,v 1.2 1999/05/06 15:43:18 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_extern.h
--- a/sys/ntfs/ntfs_extern.h Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_extern.h Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_extern.h,v 1.2 1999/05/06 15:43:18 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_ihash.c
--- a/sys/ntfs/ntfs_ihash.c Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_ihash.c Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_ihash.c,v 1.2 1999/05/06 15:43:19 christos Exp $ */
+
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993, 1995
* The Regents of the University of California. All rights reserved.
@@ -65,7 +67,8 @@
ntfs_nthashinit()
{
- ntfs_nthashtbl = hashinit(desiredvnodes, M_NTFSNTHASH, &ntfs_nthash);
+ ntfs_nthashtbl = HASHINIT(desiredvnodes, M_NTFSNTHASH, M_WAITOK,
+ &ntfs_nthash);
simple_lock_init(&ntfs_nthash_slock);
}
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_ihash.h
--- a/sys/ntfs/ntfs_ihash.h Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_ihash.h Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_ihash.h,v 1.2 1999/05/06 15:43:19 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_inode.h
--- a/sys/ntfs/ntfs_inode.h Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_inode.h Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_inode.h,v 1.2 1999/05/06 15:43:19 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
@@ -35,8 +37,7 @@
#define IN_RENAME 0x0010 /* Inode is being renamed. */
#define IN_SHLOCK 0x0020 /* File has shared lock. */
#define IN_EXLOCK 0x0040 /* File has exclusive lock. */
-#define IN_HASHED 0x0080 /* Inode is on hash list */
-#define IN_LAZYMOD 0x0100 /* Modified, but don't write yet. */
+#define IN_LAZYMOD 0x0080 /* Modified, but don't write yet. */
#else
#define IN_ACCESS 0x0001 /* Access time update request. */
#define IN_CHANGE 0x0002 /* Inode change time update request. */
@@ -51,6 +52,7 @@
#define IN_RECURSE 0x0400 /* Recursion expected */
#endif
+#define IN_HASHED 0x0800 /* Inode is on hash list */
#define IN_LOADED 0x8000 /* ntvattrs loaded */
#define IN_PRELOADED 0x4000 /* loaded from directory entry */
@@ -64,7 +66,11 @@
u_int32_t i_flag;
int i_lock;
int i_usecount;
-
+#if __FreeBSD_version < 300000
+ pid_t i_lockholder;
+ pid_t i_lockwaiter;
+ int i_lockcount;
+#endif
LIST_HEAD(,fnode) i_fnlist;
LIST_HEAD(,ntvattr) i_valist;
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_subr.c
--- a/sys/ntfs/ntfs_subr.c Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_subr.c Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_subr.c,v 1.2 1999/05/06 15:43:19 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko (semenu%FreeBSD.org@localhost)
* All rights reserved.
@@ -37,7 +39,9 @@
#include <sys/buf.h>
#include <sys/file.h>
#include <sys/malloc.h>
+#ifdef __FreeBSD__
#include <machine/clock.h>
+#endif
#include <miscfs/specfs/specdev.h>
@@ -684,9 +688,9 @@
int
ntfs_uastricmp(
struct ntfsmount * ntmp,
- wchar * str1,
+ const wchar *str1,
int str1len,
- char *str2,
+ const char *str2,
int str2len)
{
int i;
@@ -706,10 +710,10 @@
*/
int
ntfs_uastrcmp(
- struct ntfsmount * ntmp,
- wchar * str1,
+ struct ntfsmount *ntmp,
+ const wchar *str1,
int str1len,
- char *str2,
+ const char *str2,
int str2len)
{
int i;
@@ -810,13 +814,13 @@
int
ntfs_ntlookupattr(
struct ntfsmount * ntmp,
- char * name,
+ const char * name,
int namelen,
int *attrtype,
char **attrname)
{
- char *sys;
- int syslen,i;
+ const char *sys;
+ size_t syslen, i;
struct ntvattrdef *adp;
if (namelen == 0)
@@ -882,7 +886,7 @@
u_int32_t rdsize; /* Length of data to read from current block */
struct attr_indexentry *iep;
int error, res, anamelen, fnamelen;
- char *fname,*aname;
+ const char *fname,*aname;
u_int32_t aoff;
error = ntfs_ntget(ip);
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_subr.h
--- a/sys/ntfs/ntfs_subr.h Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_subr.h Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_subr.h,v 1.2 1999/05/06 15:43:20 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
@@ -92,8 +94,10 @@
int ntfs_ntreaddir __P(( struct ntfsmount *, struct fnode *, u_int32_t, struct attr_indexentry **));
wchar ntfs_toupper __P(( struct ntfsmount *, wchar ));
int ntfs_uustricmp __P(( struct ntfsmount *, wchar *, int, wchar *, int ));
-int ntfs_uastricmp __P(( struct ntfsmount *, wchar *, int, char *, int ));
-int ntfs_uastrcmp __P(( struct ntfsmount *, wchar *, int, char *, int ));
+int ntfs_uastricmp __P(( struct ntfsmount *, const wchar *, int, const char *,
+ int ));
+int ntfs_uastrcmp __P(( struct ntfsmount *, const wchar *, int, const char *,
+ int ));
int ntfs_runtovrun __P(( cn_t **, cn_t **, u_long *, u_int8_t *));
int ntfs_attrtontvattr __P(( struct ntfsmount *, struct ntvattr **, struct attr * ));
void ntfs_freentvattr __P(( struct ntvattr * ));
@@ -108,6 +112,6 @@
void ntfs_ntrele __P((struct ntnode *));
void ntfs_ntput __P((struct ntnode *));
int ntfs_loadntnode __P(( struct ntfsmount *, struct ntnode * ));
-int ntfs_ntlookupattr(struct ntfsmount *, char *, int, int *, char **);
+int ntfs_ntlookupattr(struct ntfsmount *, const char *, int, int *, char **);
int ntfs_writentvattr_plain(struct ntfsmount *, struct ntnode *, struct ntvattr *, off_t, size_t, void *, size_t *);
int ntfs_writeattr_plain(struct ntfsmount *, struct ntnode *, u_int32_t, char *, off_t, size_t, void *, size_t *);
diff -r 26d5cb367cd5 -r cfcab71b4cd0 sys/ntfs/ntfs_vfsops.c
--- a/sys/ntfs/ntfs_vfsops.c Thu May 06 15:36:39 1999 +0000
+++ b/sys/ntfs/ntfs_vfsops.c Thu May 06 15:43:17 1999 +0000
@@ -1,3 +1,5 @@
+/* $NetBSD: ntfs_vfsops.c,v 1.2 1999/05/06 15:43:20 christos Exp $ */
+
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
* All rights reserved.
@@ -64,8 +66,13 @@
MALLOC_DEFINE(M_NTFSDIR,"NTFS dir", "NTFS dir buffer");
#endif
+#ifdef __FreeBSD__
static int ntfs_mount __P((struct mount *, char *, caddr_t,
struct nameidata *, struct proc *));
+#else
+static int ntfs_mount __P((struct mount *, const char *, void *,
+ struct nameidata *, struct proc *));
+#endif
static int ntfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int ntfs_root __P((struct mount *, struct vnode **));
@@ -86,6 +93,15 @@
static int ntfs_fhtovp __P((struct mount *, struct fid *,
struct sockaddr *, struct vnode **,
int *, struct ucred **));
+#elif defined(__NetBSD__)
+static void ntfs_init __P((void));
+static int ntfs_fhtovp __P((struct mount *, struct fid *,
+ struct vnode **));
+static int ntfs_checkexp __P((struct mount *, struct mbuf *,
+ int *, struct ucred **));
+static int ntfs_mountroot __P((void));
+static int ntfs_sysctl __P((int *, u_int, void *, size_t *, void *,
+ size_t, struct proc *));
#else
static int ntfs_init __P((void));
static int ntfs_fhtovp __P((struct mount *, struct fid *,
@@ -93,25 +109,68 @@
int *, struct ucred **));
#endif
+#ifdef __NetBSD__
+/*ARGSUSED*/
+static int
+ntfs_checkexp(mp, nam, exflagsp, credanonp)
+ register struct mount *mp;
+ struct mbuf *nam;
+ int *exflagsp;
+ struct ucred **credanonp;
+{
Home |
Main Index |
Thread Index |
Old Index