2 * Copyright (C) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 #include <sys/systm.h>
24 #include <sys/kernel.h>
26 #include <sys/dirent.h>
28 #include <sys/mount.h>
29 #include <sys/vnode.h>
30 #include <sys/malloc.h>
32 #include <sys/quota.h>
34 #include <sys/kdebug.h>
37 #include "hfs_catalog.h"
38 #include "hfs_cnode.h"
40 #include "hfs_mount.h"
41 #include "hfs_quota.h"
42 #include "hfs_endian.h"
44 #include "hfscommon/headers/BTreesInternal.h"
45 #include "hfscommon/headers/FileMgrInternal.h"
49 void hfs_generate_volume_notifications(struct hfsmount
*hfsmp
) {
50 ExtendedVCB
*vcb
= HFSTOVCB(hfsmp
);
53 fsid
.val
[0] = (long)hfsmp
->hfs_raw_dev
;
54 fsid
.val
[1] = (long)vfs_typenum(HFSTOVFS(hfsmp
));
56 if (hfsmp
->hfs_notification_conditions
& VQ_LOWDISK
) {
57 /* Check to see whether the free space is back above the minimal level: */
58 if (hfs_freeblks(hfsmp
, 1) > hfsmp
->hfs_freespace_notify_desiredlevel
) {
59 hfsmp
->hfs_notification_conditions
&= ~VQ_LOWDISK
;
60 vfs_event_signal(&fsid
, hfsmp
->hfs_notification_conditions
, NULL
);
63 /* Check to see whether the free space fell below the requested limit: */
64 if (hfs_freeblks(hfsmp
, 1) < hfsmp
->hfs_freespace_notify_warninglimit
) {
65 hfsmp
->hfs_notification_conditions
|= VQ_LOWDISK
;
66 vfs_event_signal(&fsid
, hfsmp
->hfs_notification_conditions
, NULL
);