diff options
author | Jan Kara <jack@suse.cz> | 2007-10-17 02:29:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:56 -0400 |
commit | 8e8934695dfd1d5013555a74a9da706a2e301cb0 (patch) | |
tree | edef65302982cbd3e18cf4ef3c88040939886e3a /Documentation | |
parent | fac8b209b1084bc85748bd54e13d00c1262b220f (diff) |
quota: send messages via netlink
Implement sending of quota messages via netlink interface. The advantage
is that in userspace we can better decide what to do with the message - for
example display a dialogue in your X session or just write the message to
the console. As a bonus, we can get rid of problems with console locking
deep inside filesystem code once we remove the old printing mechanism.
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/filesystems/quota.txt | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Documentation/filesystems/quota.txt b/Documentation/filesystems/quota.txt new file mode 100644 index 000000000000..a590c4093eff --- /dev/null +++ b/Documentation/filesystems/quota.txt | |||
@@ -0,0 +1,59 @@ | |||
1 | |||
2 | Quota subsystem | ||
3 | =============== | ||
4 | |||
5 | Quota subsystem allows system administrator to set limits on used space and | ||
6 | number of used inodes (inode is a filesystem structure which is associated | ||
7 | with each file or directory) for users and/or groups. For both used space and | ||
8 | number of used inodes there are actually two limits. The first one is called | ||
9 | softlimit and the second one hardlimit. An user can never exceed a hardlimit | ||
10 | for any resource. User is allowed to exceed softlimit but only for limited | ||
11 | period of time. This period is called "grace period" or "grace time". When | ||
12 | grace time is over, user is not able to allocate more space/inodes until he | ||
13 | frees enough of them to get below softlimit. | ||
14 | |||
15 | Quota limits (and amount of grace time) are set independently for each | ||
16 | filesystem. | ||
17 | |||
18 | For more details about quota design, see the documentation in quota-tools package | ||
19 | (http://sourceforge.net/projects/linuxquota). | ||
20 | |||
21 | Quota netlink interface | ||
22 | ======================= | ||
23 | When user exceeds a softlimit, runs out of grace time or reaches hardlimit, | ||
24 | quota subsystem traditionally printed a message to the controlling terminal of | ||
25 | the process which caused the excess. This method has the disadvantage that | ||
26 | when user is using a graphical desktop he usually cannot see the message. | ||
27 | Thus quota netlink interface has been designed to pass information about | ||
28 | the above events to userspace. There they can be captured by an application | ||
29 | and processed accordingly. | ||
30 | |||
31 | The interface uses generic netlink framework (see | ||
32 | http://lwn.net/Articles/208755/ and http://people.suug.ch/~tgr/libnl/ for more | ||
33 | details about this layer). The name of the quota generic netlink interface | ||
34 | is "VFS_DQUOT". Definitions of constants below are in <linux/quota.h>. | ||
35 | Currently, the interface supports only one message type QUOTA_NL_C_WARNING. | ||
36 | This command is used to send a notification about any of the above mentioned | ||
37 | events. Each message has six attributes. These are (type of the argument is | ||
38 | in parentheses): | ||
39 | QUOTA_NL_A_QTYPE (u32) | ||
40 | - type of quota being exceeded (one of USRQUOTA, GRPQUOTA) | ||
41 | QUOTA_NL_A_EXCESS_ID (u64) | ||
42 | - UID/GID (depends on quota type) of user / group whose limit | ||
43 | is being exceeded. | ||
44 | QUOTA_NL_A_CAUSED_ID (u64) | ||
45 | - UID of a user who caused the event | ||
46 | QUOTA_NL_A_WARNING (u32) | ||
47 | - what kind of limit is exceeded: | ||
48 | QUOTA_NL_IHARDWARN - inode hardlimit | ||
49 | QUOTA_NL_ISOFTLONGWARN - inode softlimit is exceeded longer | ||
50 | than given grace period | ||
51 | QUOTA_NL_ISOFTWARN - inode softlimit | ||
52 | QUOTA_NL_BHARDWARN - space (block) hardlimit | ||
53 | QUOTA_NL_BSOFTLONGWARN - space (block) softlimit is exceeded | ||
54 | longer than given grace period. | ||
55 | QUOTA_NL_BSOFTWARN - space (block) softlimit | ||
56 | QUOTA_NL_A_DEV_MAJOR (u32) | ||
57 | - major number of a device with the affected filesystem | ||
58 | QUOTA_NL_A_DEV_MINOR (u32) | ||
59 | - minor number of a device with the affected filesystem | ||