OpenBSD CVS

CVS log for src/sys/ntfs/ntfs_subr.c


[BACK] Up to [local] / src / sys / ntfs

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.52 / (download) - annotate - [select for diffs], Tue Jan 11 03:13:59 2022 UTC (2 years, 4 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

spelling
ok jmc@

Revision 1.51 / (download) - annotate - [select for diffs], Thu Feb 27 09:10:31 2020 UTC (4 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.50: +13 -14 lines
Diff to previous 1.50 (colored)

Remove unused "struct proc *" argument from the following functions:

- ufs_chown() & ufs_chmod()
- ufs_reclaim()
- ext2fs_chown() & ext2fs_chmod()
- ntfs_ntget() & ntfs_ntput()
- ntfs_vgetex(), ntfs_ntlookup() & ntfs_ntlookupfile()

While here use `ap->a_p' directly when it is only required to re-enter
the VFS layer in order to help reducing the loop.

ok visa@

Revision 1.50 / (download) - annotate - [select for diffs], Tue Apr 11 14:43:49 2017 UTC (7 years, 2 months ago) by dhill
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Partially revert previous mallocarray conversions that contain
constants.

The consensus is that if both operands are constant, we don't need
mallocarray.  Reminded by tedu@

ok deraadt@

Revision 1.49 / (download) - annotate - [select for diffs], Sun Apr 9 18:15:09 2017 UTC (7 years, 2 months ago) by dhill
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

Convert a malloc(9) to mallocarray(9)

ok deraadt@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Sep 1 08:40:39 2016 UTC (7 years, 9 months ago) by natano
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.47: +1 -147 lines
Diff to previous 1.47 (colored)

Remove the unused ntfs write code. ok benno beck

Revision 1.47 / (download) - annotate - [select for diffs], Wed Aug 31 15:13:57 2016 UTC (7 years, 9 months ago) by tom
Branch: MAIN
Changes since 1.46: +3 -6 lines
Diff to previous 1.46 (colored)

Remove some unnecessary assignments in ntfs_subr.c, and move one
assignment into the for() loop where it looks better

ok otto@ krw@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jun 1 15:44:07 2016 UTC (8 years ago) by natano
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.45: +15 -9 lines
Diff to previous 1.45 (colored)

mkdir() on ntfs should return EROFS, not ENOENT.
issue found by landry
ok kettenis millert

Revision 1.45 / (download) - annotate - [select for diffs], Sun Feb 7 09:31:14 2016 UTC (8 years, 4 months ago) by stefan
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.44: +31 -32 lines
Diff to previous 1.44 (colored)

Convert to uiomove. While there, use size_t consistently for
variables 'left' and 'tocopy' and adapt printf and DPRINTF format
strings accordingly.

From Martin Natano.

Revision 1.44 / (download) - annotate - [select for diffs], Sat Mar 14 03:38:52 2015 UTC (9 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.43: +1 -2 lines
Diff to previous 1.43 (colored)

Remove some includes include-what-you-use claims don't
have any direct symbols used.  Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@

Revision 1.43 / (download) - annotate - [select for diffs], Tue Feb 10 22:04:00 2015 UTC (9 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

Convert uiomovei() with a constant size argument to uiomove().

Revision 1.42 / (download) - annotate - [select for diffs], Tue Feb 10 21:56:10 2015 UTC (9 years, 4 months ago) by miod
Branch: MAIN
Changes since 1.41: +8 -8 lines
Diff to previous 1.41 (colored)

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Dec 16 19:56:33 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

must include lock.h if you want to play with locks

Revision 1.40 / (download) - annotate - [select for diffs], Tue Dec 9 07:16:41 2014 UTC (9 years, 6 months ago) by doug
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

Sprinkle in a little more mallocarray().

ok deraadt@ tedu@

Revision 1.39 / (download) - annotate - [select for diffs], Sun Sep 14 14:17:26 2014 UTC (9 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.38 / (download) - annotate - [select for diffs], Sat Jul 12 18:43:52 2014 UTC (9 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.37: +21 -21 lines
Diff to previous 1.37 (colored)

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jan 19 18:35:45 2014 UTC (10 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.36: +1 -12 lines
Diff to previous 1.36 (colored)

lazy init nthash to save some memory when it's not used. ok jsing

Revision 1.36 / (download) - annotate - [select for diffs], Mon Dec 2 16:23:16 2013 UTC (10 years, 6 months ago) by jsing
Branch: MAIN
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored)

Stop trying to put an off_t into an int, which results in a 2GB limit.

From NetBSD.

ok krw@

Revision 1.35 / (download) - annotate - [select for diffs], Mon Dec 2 16:19:08 2013 UTC (10 years, 6 months ago) by jsing
Branch: MAIN
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored)

Avoid truncating 64-bit on disk attribute values to 32-bits. Otherwise an
attribute's data length value wraps at 4GB.

ok krw@

Revision 1.34 / (download) - annotate - [select for diffs], Mon Dec 2 16:05:07 2013 UTC (10 years, 6 months ago) by jsing
Branch: MAIN
Changes since 1.33: +75 -84 lines
Diff to previous 1.33 (colored)

Use appropriate format specifiers in debug messages. In particular, avoid
casting almost everything to u_int32_t, then formatting as a signed int
(which really helps when you're trying to debug based on 64-bit values).

Looked over by krw@

Revision 1.33 / (download) - annotate - [select for diffs], Sun Nov 24 16:02:30 2013 UTC (10 years, 6 months ago) by jsing
Branch: MAIN
Changes since 1.32: +126 -138 lines
Diff to previous 1.32 (colored)

Clean up the NTFS debug code - use uppercase names for the debug macros,
especially since 'dprintf' now has another meaning (at least outside of
the kernel). Tweak the macro syntax so we can avoid having to double
bracket all invocations. Also apply a good dose of style(9).

ok krw@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Jun 11 16:42:17 2013 UTC (11 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

final removal of daddr64_t.  daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others

Revision 1.31 / (download) - annotate - [select for diffs], Thu May 30 20:11:06 2013 UTC (11 years ago) by guenther
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

More of the same: ntfs doesn't do inode numbers >2^32, so use a smaller type
internally, only using ino_t in the VFS layer APIs: vget, readdir, getattr

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jan 18 05:09:21 2013 UTC (11 years, 4 months ago) by jsing
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.29: +47 -13 lines
Diff to previous 1.29 (colored)

Constrain the amount of kernel memory used by NTFS. Keep a small cache of
loaded ntnodes and once the maximum is reached, unload the least recently
used ntnode before loading a new one. This avoids leaving large data
structures hanging around, which only get cleaned up when the vnode is
reclaimed. Additionally, the buffer cache should contain the data needed
to reload the ntnode.

ok beck@

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jan 14 02:41:03 2013 UTC (11 years, 4 months ago) by jsing
Branch: MAIN
Changes since 1.28: +58 -170 lines
Diff to previous 1.28 (colored)

Ansify and apply style(9) to function definitions.

ok krw@

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jan 13 04:07:49 2013 UTC (11 years, 4 months ago) by jsing
Branch: MAIN
Changes since 1.27: +9 -9 lines
Diff to previous 1.27 (colored)

Destatic.

ok krw@

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jan 3 16:13:16 2013 UTC (11 years, 5 months ago) by jsing
Branch: MAIN
Changes since 1.26: +15 -10 lines
Diff to previous 1.26 (colored)

Correct error handling in two hard to hit ENOTDIR error cases. These would
previously leave the ntnode locked and neglect to decrement the use count.

ok krw@ miod@

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jan 2 08:12:13 2013 UTC (11 years, 5 months ago) by jsing
Branch: MAIN
Changes since 1.25: +1 -8 lines
Diff to previous 1.25 (colored)

Remove code that is not used on OpenBSD.

ok miod@ krw@

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jul 4 20:35:35 2011 UTC (12 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.24: +2 -3 lines
Diff to previous 1.24 (colored)

move the specfs code to a place people can see it; ok guenther thib krw

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jul 4 04:30:41 2011 UTC (12 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.23: +5 -6 lines
Diff to previous 1.23 (colored)

bread does nothing with its ucred argument.  remove it.  ok matthew

Revision 1.23 / (download) - annotate - [select for diffs], Thu Sep 9 11:31:40 2010 UTC (13 years, 9 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

nessesary -> necessary.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Sep 4 21:35:58 2010 UTC (13 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.21: +67 -18 lines
Diff to previous 1.21 (colored)

revert previous "simplification".  kcornies at gmail says it doesn't work.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Aug 22 21:23:07 2010 UTC (13 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.20: +18 -67 lines
Diff to previous 1.20 (colored)

the upper case table code was a lot more complicated than it needed to be.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Aug 12 04:05:03 2010 UTC (13 years, 10 months ago) by tedu
Branch: MAIN
Changes since 1.19: +14 -16 lines
Diff to previous 1.19 (colored)

clean up some macro obfuscation and assorted styling problems.
fix a bonus off by one bug.  ok matthew

Revision 1.19 / (download) - annotate - [select for diffs], Fri Aug 6 00:00:41 2010 UTC (13 years, 10 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.18: +28 -14 lines
Diff to previous 1.18 (colored)

Every time you ignore uiomove() return value, $DEITY kills a little
$ADORABLE_FELINE.

ok deraadt@ matthew@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Aug 13 16:00:53 2009 UTC (14 years, 10 months ago) by jasper
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.17: +3 -96 lines
Diff to previous 1.17 (colored)

- remove super-obvious comments from vnodeop_entries[]
- remove #ifdef someos blocks, makes this a tad easier to read

agreed by art@ and thib@

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 9 22:29:56 2009 UTC (14 years, 11 months ago) by thib
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Remove the VREF() macro and replaces all instances with a call to verf(),
which is exactly what the macro does.

Macro's that are nothing more then:
#define FUNCTION(arg) function(arg)
are almost always pointless and should go away.

OK blambert@
Agreed by many.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Mar 25 20:39:47 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.15: +12 -13 lines
Diff to previous 1.15 (colored)

convert lockmgr over to rwlock in ntfs, mostly trivial.

Tested by a couple of people, no regressions.

Revision 1.15 / (download) - annotate - [select for diffs], Tue May 13 02:24:08 2008 UTC (16 years, 1 month ago) by brad
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.14: +1 -6 lines
Diff to previous 1.14 (colored)

Remove commented out NetBSD __KERNEL_RCSID macro usage.

ok dlg@

Revision 1.14 / (download) - annotate - [select for diffs], Sun Dec 9 21:28:53 2007 UTC (16 years, 6 months ago) by hshoexer
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.13: +18 -19 lines
Diff to previous 1.13 (colored)

MALLOC/FREE -> malloc/free

ok gilles

Revision 1.13 / (download) - annotate - [select for diffs], Sat Oct 6 02:18:39 2007 UTC (16 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.12: +5 -5 lines
Diff to previous 1.12 (colored)

Oops. Forgot to do FREE -> free when I did MALLOC -> malloc.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Oct 3 10:52:11 2007 UTC (16 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.11: +4 -9 lines
Diff to previous 1.11 (colored)

MALLOC+bzero -> malloc+M_ZERO.

In ip_esp.c all allocated memory is now zero'd in the
"malloc(sizeof(*tc) + alen ..." case. The +alen memory was not
initialized by the bzero() call. Noticed by chl@.

"Looks good" art@ "seems ok" chl@

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jun 2 01:02:56 2007 UTC (17 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

do the daddr_t -> daddr64_t or int32_t dance here as well
"this code sucks -- pedro", "just put it in -- tom".

Revision 1.10 / (download) - annotate - [select for diffs], Thu Apr 12 22:02:57 2007 UTC (17 years, 2 months ago) by thib
Branch: MAIN
Changes since 1.9: +3 -10 lines
Diff to previous 1.9 (colored)

Remove the i_interlock simplelock from struct ntnode

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 5 21:48:57 2006 UTC (18 years, 3 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

Use more queue macros rather than doing it by hand; ok otto@ krw@

Revision 1.8 / (download) - annotate - [select for diffs], Sat Nov 19 02:18:01 2005 UTC (18 years, 6 months ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.7: +4 -35 lines
Diff to previous 1.7 (colored)

Remove unnecessary lockmgr() archaism that was costing too much in terms
of panics and bugfixes. Access curproc directly, do not expect a process
pointer as an argument. Should fix many "process context required" bugs.
Incentive and okay millert@, okay marc@. Various testing, thanks.

Revision 1.7 / (download) - annotate - [select for diffs], Tue May 24 05:43:31 2005 UTC (19 years ago) by brad
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.6: +4 -4 lines
Diff to previous 1.6 (colored)

Fix our NTFS readdir function.

To check a directory's in-use bitmap bit by bit, we use
a pointer to an 8 bit wide unsigned value.

The index used to dereference this pointer is calculated
by shifting the bit index right 3 bits.  Then we do a
logical AND with the bit# represented by the lower 3
bits of the bit index.

This is an idiomatic way of iterating through a bit map
with simple bitwise operations.

This commit fixes the bug that we only checked bits
3:0 of each 8 bit chunk, because we only used bits 1:0
of the bit index for the bit# in the current 8 bit value.
This resulted in files not being returned by getdirentries(2).

Change the type of the bit map pointer from `char *' to
`u_int8_t *'.

From FreeBSD

ok pedro

Revision 1.6 / (download) - annotate - [select for diffs], Sun May 22 04:38:54 2005 UTC (19 years ago) by brad
Branch: MAIN
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

The printf(9) `%p' conversion specifier puts an "0x" in
front of the pointer value.  Therefore, remove the "0x"
from the format string.

From FreeBSD

ok millert@

Revision 1.5 / (download) - annotate - [select for diffs], Sat May 21 18:05:58 2005 UTC (19 years ago) by brad
Branch: MAIN
Changes since 1.4: +28 -30 lines
Diff to previous 1.4 (colored)

- use MIN()/MAX() rather than min()/max(), to avoid possible truncation
  of 64bit values to 'int'
- read always single cluster of data, to avoid confusing the buffer
  cache; this appears to fix the random file content corruption which
  happens when more than one cluster is read at the same time, i.e. for
  files > 3*cluster_size
- fix some questionable pointer arithmetics; gcc-3.4.x didn't like it
- g/c redundant debug printf
- remove all traces of non-working quota support
  add quota support to TODO - makes sense only once writing support
  would be implemented, and only once NTFS would support notion of file 'owner'
- use 64bit local variable for free space computation

From NetBSD

- Comment fixes from joris@

ok millert@ joris@ pedro@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Mar 8 15:45:20 2005 UTC (19 years, 3 months ago) by pat
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.3: +18 -16 lines
Diff to previous 1.3 (colored)

fix a page fault that occurs when a reclaimed vnode is then reused.
from FreeBSD

ok pedro tedu miod, tested by millert and myself

Revision 1.3.2.1 / (download) - annotate - [select for diffs], Sat Jun 7 10:47:03 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

add file to SMP branch

Revision 1.3 / (download) - annotate - [select for diffs], Tue May 20 03:36:42 2003 UTC (21 years ago) by tedu
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Branch point for: SMP
Changes since 1.2: +5 -5 lines
Diff to previous 1.2 (colored)

un __P

Revision 1.2 / (download) - annotate - [select for diffs], Tue May 20 03:23:12 2003 UTC (21 years ago) by mickey
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

fix the tags

Revision 1.1 / (download) - annotate - [select for diffs], Tue May 20 03:03:27 2003 UTC (21 years ago) by tedu
Branch: MAIN

by popular request, NTFS support.  read only.
The code comes from NetBSD and was ported by Julian Bordet.
ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.