The NetBSD Project

CVS log for src/sys/ufs/ufs/ufs_quota2.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / ufs / ufs

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.34.6.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:45 2014 UTC (2 months ago) by tls
Branch: tls-maxphys
Changes since 1.34.6.1: +14 -14 lines
Diff to previous 1.34.6.1 (colored) to branchpoint 1.34 (colored) next main 1.35 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.38.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:56:58 2014 UTC (2 months, 2 weeks ago) by tls
Branch: tls-earlyentropy
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored) next main 1.39 (colored)

Rebase.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jun 28 22:27:51 2014 UTC (3 months, 3 weeks ago) by dholland
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base, netbsd-7, HEAD
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

Revert the following changes:

   src/sys/sys/quotactl.h 1.37
   src/sys/compat/netbsd32/netbsd32.h 1.101
   src/sys/compat/netbsd32/netbsd32_netbsd.c 1.188, 1.189
   src/sys/kern/vfs_quotactl.c 1.39
   src/sys/kern/vfs_syscalls.c 1.483
   src/sys/ufs/lfs/ulfs_quota.c 1.11
   src/sys/ufs/ufs/ufs_quota.c 1.116
   src/lib/libquota/quota_kernel.c 1.5

and do them correctly.

If you're going to change the name of something, you need to change
the name of *all* the things with the same name, not just a handful,
and you should change it to something similar so it still matches the
rest of the system rather than just picking an arbitrarily different
name.

Hi, Joerg.

To wit, rename the quotactl "delete" operation to "del", because
"delete" is a reserved word in C++ and for some reason Joerg wants to
run internal interfaces used only by C code through his C++ compiler.
Do not rename it to "remove" instead, because this doesn't match
libquota or the rest of the usage throughout the system; and rename
all the related identifiers, not just the ones that blew the mind of
Joerg's C++ compiler.

Because this is not a user-facing API (the only userland consumer
sys/quotactl.h is libquota) it is sort of ok to make arbitrary
source-incompatible changes; however, by the same token it's completely
unnecessary. If it *were* a user-facing API that someone might have a
semi-rational reason to want to run a C++ compiler on, it would be
incorrect to change it at this point.

Revision 1.4.2.3 / (download) - annotate - [select for diffs], Thu May 22 11:41:19 2014 UTC (5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.4.2.2: +13 -13 lines
Diff to previous 1.4.2.2 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Sun May 18 17:46:22 2014 UTC (5 months, 1 week ago) by rmind
Branch: rmind-smpnet
Changes since 1.35: +13 -13 lines
Diff to previous 1.35 (colored) next main 1.36 (colored)

sync with head

Revision 1.34.2.2 / (download) - annotate - [select for diffs], Tue Mar 18 08:43:33 2014 UTC (7 months, 1 week ago) by msaitoh
Branch: netbsd-6
Changes since 1.34.2.1: +12 -2 lines
Diff to previous 1.34.2.1 (colored) to branchpoint 1.34 (colored) next main 1.35 (colored)

Pull up following revision(s) (requested by bouyer in ticket #1027):
	sys/ufs/ufs/ufs_quota2.c: revision 1.37
Patch from Edgar Fuss on tech-kern:
set grace time if lowering the limit cause the user/group to now be overquota.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Mar 16 01:21:35 2014 UTC (7 months, 1 week ago) by uwe
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

Shut up -Wuninitialized on sh3 with gcc 4.8

Revision 1.37 / (download) - annotate - [select for diffs], Wed Jan 29 20:13:04 2014 UTC (8 months, 3 weeks ago) by bouyer
Branch: MAIN
Changes since 1.36: +12 -2 lines
Diff to previous 1.36 (colored)

Patch from Edgar Fuon tech-kern:
set grace time if lowering the limit cause the user/group to now be overquota.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Oct 20 00:29:10 2013 UTC (12 months ago) by htodd
Branch: MAIN
Changes since 1.35: +2 -12 lines
Diff to previous 1.35 (colored)

Definining needswap where needed.

Revision 1.34.6.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:53 2012 UTC (23 months ago) by tls
Branch: tls-maxphys
Changes since 1.34: +17 -19 lines
Diff to previous 1.34 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.34.4.1 / (download) - annotate - [select for diffs], Thu Nov 1 16:45:05 2012 UTC (23 months, 3 weeks ago) by matt
Branch: matt-nb6-plus
Changes since 1.34: +17 -19 lines
Diff to previous 1.34 (colored) next main 1.35 (colored)

sync with netbsd-6-0-RELEASE.

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:23:01 2012 UTC (23 months, 3 weeks ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.4.2.1: +17 -19 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored)

sync with head

Revision 1.34.2.1 / (download) - annotate - [select for diffs], Mon Oct 1 19:55:22 2012 UTC (2 years ago) by riz
Branch: netbsd-6
CVS Tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base
Changes since 1.34: +17 -19 lines
Diff to previous 1.34 (colored)

Pull up following revision(s) (requested by bouyer in ticket #580):
	tests/fs/ffs/h_quota2_tests.c: revision 1.4
	tests/fs/ffs/t_miscquota.sh: revision 1.7
	sys/ufs/ufs/ufs_quota2.c: revision 1.35
Fix quota2 list corruption issue when defaultquotas are 0 (deny any file
and block allocation).
When quota2_check() is called with an uid not yet in the list,
getinoquota2() will call quota2_q2ealloc() to allocate a new entry for this
uid. quota2_q2ealloc() will remove an entry from the free list and
put it at the head of the corresponding hash list, and flush the block
containing the header if it's not the one also containing the allocated entry.
quota2_q2ealloc() then return the alocated entry and corresponding block
to caller (getinoquota2() here), which returns it to quota2_check().
quota2_check() then checks if the allocation can succeed, and returns and
error if not and calls brelse() on the buffer (because from his POW no
change was made to the entry), effectively discarding changes
to the entry that may have been made by quota2_q2ealloc().
Fix by always bwrite()ing the entry in quota2_q2ealloc(), and re-reading
the entry in caller.
Add test cases for the bug fixed in sys/ufs/ufs/ufs_quota2.c 1.35:
when a on-disk block/inode allocation triggers allocating a new
quota entry, the new quota entry is not in the quota2 header block,
and the allocation will later be denied, the changes to the quota block would
not be flushed to disk, leading to list corruption (detected by fsck).

Revision 1.35 / (download) - annotate - [select for diffs], Thu Sep 27 07:47:56 2012 UTC (2 years ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.34: +17 -19 lines
Diff to previous 1.34 (colored)

Fix quota2 list corruption issue when defaultquotas are 0 (deny any file
and block allocation).

When quota2_check() is called with an uid not yet in the list,
getinoquota2() will call quota2_q2ealloc() to allocate a new entry for this
uid. quota2_q2ealloc() will remove an entry from the free list and
put it at the head of the corresponding hash list, and flush the block
containing the header if it's not the one also containing the allocated entry.
quota2_q2ealloc() then return the alocated entry and corresponding block
to caller (getinoquota2() here), which returns it to quota2_check().
quota2_check() then checks if the allocation can succeed, and returns and
error if not and calls brelse() on the buffer (because from his POW no
change was made to the entry), effectively discarding changes
to the entry that may have been made by quota2_q2ealloc().
Fix by always bwrite()ing the entry in quota2_q2ealloc(), and re-reading
the entry in caller.

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:57 2012 UTC (2 years, 6 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.4: +722 -174 lines
Diff to previous 1.4 (colored)

sync with head

Revision 1.4.6.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:35:56 2012 UTC (2 years, 8 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.4: +722 -174 lines
Diff to previous 1.4 (colored) next main 1.5 (colored)

merge to -current.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Feb 13 06:23:41 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-0-RC2, netbsd-6-0-RC1, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Branch point for: tls-maxphys, netbsd-6, matt-nb6-plus
Changes since 1.33: +10 -7 lines
Diff to previous 1.33 (colored)

Fix another problem with quota cursor iteration. ok riz

Revision 1.33 / (download) - annotate - [select for diffs], Sun Feb 5 14:19:04 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.32: +2 -4 lines
Diff to previous 1.32 (colored)

Migrate one last leftover bit (used only by the kernel now) to
sys/ufs/ufs and remove the old quota headers and no-longer-used shared
code. Ok by releng.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Feb 1 05:43:54 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.31: +5 -5 lines
Diff to previous 1.31 (colored)

Improve the names of some members of struct quotactl_args. These are
effectively function parameter names, but since they need to be
described with the same names in the man page the choices do matter.
Some.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Feb 1 05:10:44 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.30: +17 -6 lines
Diff to previous 1.30 (colored)

Fix problems in cursor iteration that came to light when iterating one
value at a time, instead of in bulk. Yeah, repquota should do bulk get,
but it doesn't yet.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Jan 29 07:21:00 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.29: +371 -206 lines
Diff to previous 1.29 (colored)

Clean up quota2 cursoring, as promised earlier.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jan 29 07:20:27 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.28: +11 -2 lines
Diff to previous 1.28 (colored)

quota2_check_limit() is used in only one place, so don't stuff it in a
header file.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jan 29 07:18:17 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.27: +2 -44 lines
Diff to previous 1.27 (colored)

Remove #if 0'd proplib-related code.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 29 07:16:54 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.26: +2 -3 lines
Diff to previous 1.26 (colored)

Remove references to <quota/quotaprop.h> in src/sys/ufs.
The remaining references in the kernel are in vfs_quotactl.c, the
compat_50 code for the old quotactl (to be fixed up), and the
code compiled from src/common/lib/libquota.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jan 29 07:09:52 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.25: +71 -3 lines
Diff to previous 1.25 (colored)

Add QUOTACTL_CURSORSKIPIDTYPE, QUOTACTL_CURSORATEND, QUOTACTL_CURSORREWIND.

This change requires a kernel version bump.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Jan 29 07:08:58 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.24: +52 -6 lines
Diff to previous 1.24 (colored)

Don't pass the idtype to QUOTACTL_GETALL. Instead, iterate both users
and groups.

This change requires a kernel version bump.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jan 29 07:08:00 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.23: +9 -8 lines
Diff to previous 1.23 (colored)

Fix a preexisting array overrun and a preexisting free twice exposed
by cleanup and testing.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Jan 29 07:07:22 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.22: +44 -61 lines
Diff to previous 1.22 (colored)

Call QUOTACTL_GETALL in a loop to get results 8 at a time. Make
the QUOTACTL_GETALL interface less abusive.

Note: this change requires a kernel version bump.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jan 29 07:06:02 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.21: +51 -12 lines
Diff to previous 1.21 (colored)

Stop treating the default values specially in QUOTACTL_GETALL.

Note: this change requires a kernel version bump.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Jan 29 07:05:12 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.20: +48 -13 lines
Diff to previous 1.20 (colored)

Teach quota2 QUOTACTL_GETALL to acecpt a limit on how much it sends back.
Pass in a dummy limit for now.

Note: this change requires a kernel version bump.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jan 29 07:04:21 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.19: +47 -14 lines
Diff to previous 1.19 (colored)

Teach quota2 QUOTACTL_GETALL to start in the middle, step 2.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jan 29 07:03:47 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.18: +48 -7 lines
Diff to previous 1.18 (colored)

Teach quota2 QUOTACTL_GETALL to start in the middle, step 1.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Jan 29 07:02:06 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.17: +47 -26 lines
Diff to previous 1.17 (colored)

Hack QUOTACTL_GETALL to return results without using proplib.

(this interface is abusive and is going to be cleaned up in the
immediate future)

Note: this change requires a kernel version bump.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jan 29 07:00:40 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.16: +19 -11 lines
Diff to previous 1.16 (colored)

Pass the cursor to QUOTACTL_GETALL. Don't pass unused proplib items.

Note: this change requires a kernel version bump.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jan 29 06:57:15 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.15: +36 -2 lines
Diff to previous 1.15 (colored)

Begin adding quota cursor/iteration interface to VFS_QUOTACTL.

Add struct quotakcursor.
Add QUOTACTL_CURSOROPEN and QUOTACTL_CURSORCLOSE operations.
Implement the plumbing for them.
Add trivial implementations of them for quota2.
(iteration is not supported on quota1 for the time being, just as
getall isn't)
Have the proplib interpreter open and close a cursor around doing
QUOTACTL_GETALL.

Note: this change requires a kernel version bump.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jan 29 06:55:44 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.14: +11 -5 lines
Diff to previous 1.14 (colored)

Package up the args of QUOTACTL_DELETE as a struct quotakey.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jan 29 06:54:34 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

QUOTACTL_CLEAR -> QUOTACTL_DELETE to match intended API and user API.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jan 29 06:53:36 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.12: +33 -15 lines
Diff to previous 1.12 (colored)

Improve the quota2 QUOTACTL_CLEAR code to allow clearing blocks and
files independently.

Note: this change requires a kernel version bump.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 29 06:52:39 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.11: +10 -10 lines
Diff to previous 1.11 (colored)

The handling of QUOTACTL_CLEAR does not use the proplib data
dictionary, so don't pass it.

Note: this change requires a kernel version bump.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jan 29 06:49:44 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Rename QUOTACTL_SET to QUOTACTL_PUT, to match future intended API.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jan 29 06:48:51 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.9: +18 -13 lines
Diff to previous 1.9 (colored)

Combine the miscellaneous QUOTACTL_SET args into a struct quotakey.

Note: this change requires a kernel version bump.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jan 29 06:47:38 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.8: +13 -14 lines
Diff to previous 1.8 (colored)

Pass only one objtype and its quotaval to QUOTACTL_SET at one time.

(The backend code to handle this is a lot tidier than I expected given
that the proplib code doesn't allow setting blocks and files
independently; I was afraid there would turn out to be a reason for
that...)

Note: this change requires a kernel version bump.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jan 29 06:46:50 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.7: +16 -33 lines
Diff to previous 1.7 (colored)

For QUOTACTL_SET in quota2, use the quotaval data instead of proplib.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jan 29 06:41:42 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.6: +17 -16 lines
Diff to previous 1.6 (colored)

Use struct quotakey with QUOTACTL_GET. Tidy up accordingly.

Step 5 of 5 for QUOTACTL_GET.

Note: this change requires a kernel version bump.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jan 29 06:40:58 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.5: +24 -14 lines
Diff to previous 1.5 (colored)

Per the FS-independent schema, get one quotaval at a time from the
filesystem, instead of blocks and files together.

This results in fetching each FS-level quota entry twice and therefore
doing slightly more work, but (1) quota access isn't a critical path
and (2) after fetching the block values the file values will be hot in
the cache, so it won't add much total time.

Also move more of the FS-independent defintions from <quota.h> to
<sys/quota.h> so we can use them internally.

Step 4 of 5 for QUOTACTL_GET.

Note: this change requires a kernel version bump.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jan 29 06:38:24 2012 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.4: +84 -10 lines
Diff to previous 1.4 (colored)

Move second-layer proplib frobbing within ufs quota code up to the
first layer. (Step 2 of several for QUOTACTL_GET.)

Revision 1.3.4.1 / (download) - annotate - [select for diffs], Thu Jun 23 14:20:33 2011 UTC (3 years, 4 months ago) by cherry
Branch: cherry-xenmp
Changes since 1.3: +2 -4 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

Catchup with rmind-uvmplock merge.

Revision 1.3.2.3 / (download) - annotate - [select for diffs], Sun Jun 12 00:24:31 2011 UTC (3 years, 4 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.3.2.2: +0 -2 lines
Diff to previous 1.3.2.2 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

sync with head

Revision 1.4 / (download) - annotate - [select for diffs], Tue Jun 7 14:56:13 2011 UTC (3 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.3: +2 -4 lines
Diff to previous 1.3 (colored)

Fix bad cut'n'paste in copyright. Pointed out by dyoung@

Revision 1.3.6.2 / (download) - annotate - [select for diffs], Mon Jun 6 09:10:19 2011 UTC (3 years, 4 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.3.6.1: +1014 -0 lines
Diff to previous 1.3.6.1 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

Sync with HEAD.

Revision 1.3.2.2 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:21 2011 UTC (3 years, 6 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.3.2.1: +1014 -0 lines
Diff to previous 1.3.2.1 (colored) to branchpoint 1.3 (colored)

sync with head

Revision 1.3.6.1, Thu Mar 24 17:05:46 2011 UTC (3 years, 7 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.3: +0 -1014 lines
FILE REMOVED

file ufs_quota2.c was added on branch jruoho-x86intr on 2011-06-06 09:10:19 +0000

Revision 1.3.2.1, Thu Mar 24 17:05:46 2011 UTC (3 years, 7 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.3: +0 -1014 lines
FILE REMOVED

file ufs_quota2.c was added on branch rmind-uvmplock on 2011-04-21 01:42:21 +0000

Revision 1.3 / (download) - annotate - [select for diffs], Thu Mar 24 17:05:46 2011 UTC (3 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: cherry-xenmp-base
Branch point for: rmind-uvmplock, jruoho-x86intr, cherry-xenmp
Changes since 1.2: +68 -7 lines
Diff to previous 1.2 (colored)

Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)

Revision 1.2 / (download) - annotate - [select for diffs], Sun Mar 6 17:08:39 2011 UTC (3 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.1: +953 -0 lines
Diff to previous 1.1 (colored)

merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.

Revision 1.1.2.16 / (download) - annotate - [select for diffs], Fri Feb 18 11:46:43 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.15: +8 -7 lines
Diff to previous 1.1.2.15 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

Only use B_MODIFY when needed, avoid unecessery copy on write when using
snapshots.

Revision 1.1.2.15 / (download) - annotate - [select for diffs], Sat Feb 12 21:48:09 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.14: +12 -3 lines
Diff to previous 1.1.2.14 (colored) to branchpoint 1.1 (colored)

Don't count snapshot files in inode quota too.
At umount time, chk?q may be called after quota have been shutdown,
as there is a final vflush pass after quota?_umount(); so skip quota
checks if the quota vnode is not there any more.

Revision 1.1.2.14 / (download) - annotate - [select for diffs], Fri Feb 11 16:55:35 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.13: +7 -3 lines
Diff to previous 1.1.2.13 (colored) to branchpoint 1.1 (colored)

walk_list: make sure we don't try to read the same quota disk block again
without releasing it first

Revision 1.1.2.13 / (download) - annotate - [select for diffs], Thu Feb 10 16:16:05 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.12: +25 -13 lines
Diff to previous 1.1.2.12 (colored) to branchpoint 1.1 (colored)

Unless the filestystem is mounted MNT_SYNCHRONOUS, use bdwrite()
to write back updated quota entries.

Revision 1.1.2.12 / (download) - annotate - [select for diffs], Wed Feb 9 21:17:17 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.11: +4 -3 lines
Diff to previous 1.1.2.11 (colored) to branchpoint 1.1 (colored)

Make sure to not try to close the quota vnodes twice.

Revision 1.1.2.11 / (download) - annotate - [select for diffs], Wed Feb 9 11:18:30 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.10: +12 -2 lines
Diff to previous 1.1.2.10 (colored) to branchpoint 1.1 (colored)

Various build fixes

Revision 1.1.2.10 / (download) - annotate - [select for diffs], Tue Feb 8 20:00:53 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.9: +10 -6 lines
Diff to previous 1.1.2.9 (colored) to branchpoint 1.1 (colored)

Minimal hacking to make 'options QUOTA' compile again.

Revision 1.1.2.9 / (download) - annotate - [select for diffs], Mon Feb 7 20:30:39 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.8: +134 -13 lines
Diff to previous 1.1.2.8 (colored) to branchpoint 1.1 (colored)

Implement clear command (quota2 only), which either free the specified
quota2 entry (if both disk and inode usage are 0) or revert its limits to
the default quota entry.

Revision 1.1.2.8 / (download) - annotate - [select for diffs], Mon Feb 7 16:24:13 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.7: +15 -9 lines
Diff to previous 1.1.2.7 (colored) to branchpoint 1.1 (colored)

Create a WAPBL transaction when setting quotas.

Revision 1.1.2.7 / (download) - annotate - [select for diffs], Thu Feb 3 15:56:16 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.6: +61 -48 lines
Diff to previous 1.1.2.6 (colored) to branchpoint 1.1 (colored)

factor out code to chech a quota against its limits.

Revision 1.1.2.6 / (download) - annotate - [select for diffs], Mon Jan 31 15:24:11 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.5: +81 -14 lines
Diff to previous 1.1.2.5 (colored) to branchpoint 1.1 (colored)

Catch up with Q2V -> QL renaming
Enforce limits for quota2.
pass quota type (*QUOTA) and limit type (QL_*) to
KAUTH_REQ_SYSTEM_FS_QUOTA_NOLIMIT, to make it possible to skip
limit checks for some quota type only if a listener wants to.

Revision 1.1.2.5 / (download) - annotate - [select for diffs], Sun Jan 30 00:25:20 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.4: +69 -2 lines
Diff to previous 1.1.2.4 (colored) to branchpoint 1.1 (colored)

Implement 'set' command for quota2.

Revision 1.1.2.4 / (download) - annotate - [select for diffs], Sat Jan 29 23:22:00 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.3: +119 -48 lines
Diff to previous 1.1.2.3 (colored) to branchpoint 1.1 (colored)

Describe how the on-disk structures are protected from concurent access,
and try to implement it.

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Fri Jan 28 18:36:06 2011 UTC (3 years, 8 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.2: +18 -12 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored)

Introduce quota2_ufs_rwq2v() and quota2_ufs_rwq2e() functions, which
byteswap a quota2_val or quota2_entry if needed.
Use this to get quota2_entry in host order before calling q2etoprop().

quota2_walk_list() will byteswap the offset if needed to leave
it in FS byte order in callers.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Fri Jan 21 16:58:06 2011 UTC (3 years, 9 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1.2.1: +178 -40 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored)

Add support for quotactl("getall") command, and convert repquota to new
world.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Thu Jan 20 14:25:03 2011 UTC (3 years, 9 months ago) by bouyer
Branch: bouyer-quota2
Changes since 1.1: +423 -0 lines
Diff to previous 1.1 (colored)

Snapshot of work in progress on a modernised disk quota system:
- new quotactl syscall (versionned for backward compat), which takes
  as parameter a path to a mount point, and a prop_dictionary
  (in plistref format) describing commands and arguments.
  For each command, status and data are returned as a prop_dictionary.
  quota commands features will be added to take advantage of this,
  exporting quota data or getting quota commands as plists.

- new on disk-format storage (all 64bit wide), integrated to metadata for
  ffs (and playing nicely with wapbl).
  Quotas are enabled on a ffs filesystem via superblock flags.
  tunefs(8) can enable or disable quotas.
  On a quota-enabled filesystem, fsck_ffs(8) will track per-uid/gid
  block and inode usages, and will check and update quotas in Pass 6.
  quota usage and limits are stored in unliked files (one for users,
  one for groups)l fsck_ffs(8) will create the files if needed, or
  free them if needed. This means that after enabling or disabling
  quotas on a filesystem; a fsck_ffs(8) run is required.
  quotacheck(8) is not needed any more, on a unclean shutdown
  fsck or journal replay will take care of fixing quotas.
  newfs(8) can create a ready-to-mount quota-enabled filesystem
  (superblock flags are set and quota inodes are created).
  Other new features or semantic changes:
  - default quota datas, applied to users or groups which don't already
    have a quota entry
  - per-user/group grace time (instead of a filesystem global one)
  - 0 really means "nothing allowed at all", not "no limit".
    If you want "no limit", set the limit to UQUAD_MAX (tools will
    understand "unlimited" and "-")

  A quota file is structured as follow:
  it starts with a header, containing a few per-filesystem values,
  and the default quota limits.
  Quota entries are linked together as a simple list, each entry has a
  pointer (as an offset withing the file) to the next.
  The header has a pointer to a list of free quota entries, and
  a hash table of in-use entries. The size of the hash table depends
  on the filesystem block size (header+hash table should fit in the
  first block). The file is not sparse and is a multiple of
  filesystem block size (when the free quota entry list is empty a new
  filesystem block is allocated). quota entries to not cross
  filesystem block boundaries.

  In memory, the kernel keeps a cache of recently used quota entries
  as a reference to the block number, and offset withing the block.
  The quota entry itself is keept in the buf cache.

fsck_ffs(8), tunefs(8) and newfs(8) supports are completed (with
related atf tests :)
The kernel can update disk usage and report it via quotactl(2).

Todo: enforce quotas limits (limits are not checked by kernel yet)
      update repquota, edquota and rpc.rquotad to the new world
      implement compat_50_quotactl ioctl.
      update quotactl(2) man page

fsck_ffs required fixes so that allocating new blocks or inodes will
properly update the superblock and cg sumaries. This was not an issue up
to now because superblock and cg sumaries check happened last, but now
allocations or frees can happen in pass 6.

Revision 1.1, Thu Jan 20 14:25:03 2011 UTC (3 years, 9 months ago) by bouyer
Branch: MAIN
CVS Tags: bouyer-quota2-nbase, bouyer-quota2-base
Branch point for: bouyer-quota2
FILE REMOVED

file ufs_quota2.c was initially added on branch bouyer-quota2.

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.




CVSweb <webmaster@jp.NetBSD.org>