Permalink
Browse files

kernel/ntfs - Cleanup.

- Remove NetBSD specific code.
- Removed few whitespaces.
  • Loading branch information...
tuxillo committed Feb 25, 2014
1 parent 3928528 commit 0249ae38fed761655a5bd2037bf7737fdc553132
Showing with 32 additions and 324 deletions.
  1. +1 −7 sys/vfs/ntfs/ntfs_compr.c
  2. +0 −15 sys/vfs/ntfs/ntfs_inode.h
  3. +14 −34 sys/vfs/ntfs/ntfs_subr.c
  4. +17 −226 sys/vfs/ntfs/ntfs_vfsops.c
  5. +0 −42 sys/vfs/ntfs/ntfs_vnops.c
@@ -39,19 +39,13 @@
#include <sys/file.h>
#include <sys/malloc.h>
-#if defined(__NetBSD__)
-#include <miscfs/specfs/specdev.h>
-#endif
-
#include "ntfs.h"
#include "ntfs_compr.h"
#define GET_UINT16(addr) (*((u_int16_t *)(addr)))
int
-ntfs_uncompblock(
- u_int8_t * buf,
- u_int8_t * cbuf)
+ntfs_uncompblock(u_int8_t * buf, u_int8_t * cbuf)
{
u_int32_t ctag;
int len, dshift, lmask;
View
@@ -29,7 +29,6 @@
*/
/* These flags are kept in i_flag. */
-#if defined(__DragonFly__)
#define IN_ACCESS 0x0001 /* Access time update request. */
#define IN_CHANGE 0x0002 /* Inode change time update request. */
#define IN_UPDATE 0x0004 /* Modification time update request. */
@@ -38,20 +37,6 @@
#define IN_SHLOCK 0x0020 /* File has shared lock. */
#define IN_EXLOCK 0x0040 /* File has exclusive lock. */
#define IN_LAZYMOD 0x0080 /* Modified, but don't write yet. */
-#else /* defined(__NetBSD__) */
-#define IN_ACCESS 0x0001 /* Access time update request. */
-#define IN_CHANGE 0x0002 /* Inode change time update request. */
-#define IN_EXLOCK 0x0004 /* File has exclusive lock. */
-#define IN_LOCKED 0x0008 /* Inode lock. */
-#define IN_LWAIT 0x0010 /* Process waiting on file lock. */
-#define IN_MODIFIED 0x0020 /* Inode has been modified. */
-#define IN_RENAME 0x0040 /* Inode is being renamed. */
-#define IN_SHLOCK 0x0080 /* File has shared lock. */
-#define IN_UPDATE 0x0100 /* Modification time update request. */
-#define IN_WANTED 0x0200 /* Inode is wanted by a process. */
-#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 */
View
@@ -48,10 +48,6 @@
#include <sys/buf2.h>
#include <sys/spinlock2.h>
-#if defined(__NetBSD__)
-#include <miscfs/specfs/specdev.h>
-#endif
-
#include "ntfs.h"
#include "ntfsmount.h"
#include "ntfs_inode.h"
@@ -60,12 +56,10 @@
#include "ntfs_compr.h"
#include "ntfs_ihash.h"
-#if defined(__DragonFly__)
MALLOC_DEFINE(M_NTFSNTVATTR, "NTFS vattr", "NTFS file attribute information");
MALLOC_DEFINE(M_NTFSRDATA, "NTFS res data", "NTFS resident data");
MALLOC_DEFINE(M_NTFSRUN, "NTFS vrun", "NTFS vrun storage");
MALLOC_DEFINE(M_NTFSDECOMP, "NTFS decomp", "NTFS decompression temporary");
-#endif
static int ntfs_ntlookupattr (struct ntfsmount *, const char *, int, int *, char **);
static int ntfs_findvattr (struct ntfsmount *, struct ntnode *, struct ntvattr **, struct ntvattr **, u_int32_t, const char *, size_t, cn_t);
@@ -86,7 +80,7 @@ extern struct iconv_functions *ntfs_iconv;
!NTFS_UASTRCMP(aalp->al_name,aalp->al_namelen,name,namelen) )
/*
- *
+ *
*/
int
ntfs_ntvattrrele(struct ntvattr *vap)
@@ -311,7 +305,7 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip)
ap = (struct attr *) ((caddr_t)mfrp + off);
LIST_INIT(&ip->i_valist);
-
+
while (ap->a_hdr.a_type != -1) {
error = ntfs_attrtontvattr(ntmp, &nvap, ap);
if (error)
@@ -339,7 +333,7 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip)
kfree(mfrp, M_TEMP);
return (error);
}
-
+
/*
* Routine locks ntnode and increase usecount, just opposite of
* ntfs_ntput().
@@ -463,7 +457,7 @@ ntfs_ntput(struct ntnode *ip)
}
/*
- * increment usecount of ntnode
+ * increment usecount of ntnode
*/
void
ntfs_ntref(struct ntnode *ip)
@@ -472,7 +466,6 @@ ntfs_ntref(struct ntnode *ip)
dprintf(("ntfs_ntref: ino %"PRId64", usecount: %d\n",
ip->i_number, ip->i_usecount));
-
}
/*
@@ -711,7 +704,7 @@ ntfs_uastrcmp(struct ntfsmount *ntmp, const wchar *ustr, size_t ustrlen,
return (ustrlen - mbstrlen);
}
-/*
+/*
* Search fnode in ntnode, if not found allocate and preinitialize.
*
* ntnode should be locked on entry.
@@ -729,7 +722,7 @@ ntfs_fget(struct ntfsmount *ntmp, struct ntnode *ip, int attrtype,
dprintf(("ntfs_fget: fnode: attrtype: %d, attrname: %s\n",
fp->f_attrtype, fp->f_attrname?fp->f_attrname:""));
- if ((attrtype == fp->f_attrtype) &&
+ if ((attrtype == fp->f_attrtype) &&
((!attrname && !fp->f_attrname) ||
(attrname && fp->f_attrname &&
!strcmp(attrname,fp->f_attrname)))){
@@ -786,7 +779,7 @@ ntfs_frele(struct fnode *fp)
}
/*
- * Lookup attribute name in format: [[:$ATTR_TYPE]:$ATTR_NAME],
+ * Lookup attribute name in format: [[:$ATTR_TYPE]:$ATTR_NAME],
* $ATTR_TYPE is searched in attrdefs read from $AttrDefs.
* If $ATTR_TYPE nott specifed, ATTR_A_DATA assumed.
*/
@@ -815,7 +808,7 @@ ntfs_ntlookupattr(struct ntfsmount *ntmp, const char *name, int namelen,
adp = ntmp->ntm_ad;
for (i = 0; i < ntmp->ntm_adnum; i++, adp++){
- if (syslen != adp->ad_namelen ||
+ if (syslen != adp->ad_namelen ||
strncmp(sys, adp->ad_name, syslen) != 0)
continue;
@@ -1419,19 +1412,13 @@ ntfs_writentvattr_plain(struct ntfsmount *ntmp, struct ntnode *ip,
off = ntfs_btocnoff(off);
while (left && ccl) {
-#if defined(__DragonFly__)
tocopy = min(left,
min(ntfs_cntob(ccl) - off, MAXBSIZE - off));
-#else
- /* under NetBSD, bread() can read
- * maximum one block worth of data */
- tocopy = min(left, ntmp->ntm_bps - off);
-#endif
cl = ntfs_btocl(tocopy + off);
ddprintf(("ntfs_writentvattr_plain: write: " \
"cn: 0x%x cl: %d, off: %d len: %d, left: %d\n",
- (u_int32_t) cn, (u_int32_t) cl,
- (u_int32_t) off, (u_int32_t) tocopy,
+ (u_int32_t) cn, (u_int32_t) cl,
+ (u_int32_t) off, (u_int32_t) tocopy,
(u_int32_t) left));
if (off == 0 && tocopy == ntfs_cntob(cl) &&
uio->uio_segflg != UIO_NOCOPY) {
@@ -1518,24 +1505,17 @@ ntfs_readntvattr_plain(struct ntfsmount *ntmp, struct ntnode *ip,
off = ntfs_btocnoff(off);
while (left && ccl) {
-#if defined(__DragonFly__)
tocopy = min(left,
min(ntfs_cntob(ccl) - off,
MAXBSIZE - off));
-#else
- /* under NetBSD, bread() can read
- * maximum one block worth of data */
- tocopy = min(left,
- ntmp->ntm_bps - off);
-#endif
cl = ntfs_btocl(tocopy + off);
ddprintf(("ntfs_readntvattr_plain: " \
"read: cn: 0x%x cl: %d, " \
"off: %d len: %d, left: %d\n",
- (u_int32_t) cn,
- (u_int32_t) cl,
- (u_int32_t) off,
- (u_int32_t) tocopy,
+ (u_int32_t) cn,
+ (u_int32_t) cl,
+ (u_int32_t) off,
+ (u_int32_t) tocopy,
(u_int32_t) left));
error = bread(ntmp->ntm_devvp,
ntfs_cntodoff(cn),
Oops, something went wrong.

0 comments on commit 0249ae3

Please sign in to comment.