*
*/
-#include <linux/config.h>
#include <linux/fs.h>
#include <linux/namespace.h>
#include <linux/namei.h>
#include <linux/statfs.h>
#include <linux/compat.h>
-#include <linux/vserver/switch.h>
+#include <linux/vs_base.h>
#include <linux/vs_context.h>
#include <linux/vs_dlimit.h>
+#include <linux/vserver/switch.h>
#include <linux/vserver/dlimit_cmd.h>
#include <asm/errno.h>
{
struct hlist_head *head = &dl_info_hash[__hashval(sb, xid)];
struct hlist_node *pos;
+ struct dl_info *dli;
- hlist_for_each_rcu(pos, head) {
- struct dl_info *dli =
- hlist_entry(pos, struct dl_info, dl_hlist);
+ hlist_for_each_entry_rcu(dli, pos, head, dl_hlist) {
if (dli->dl_xid == xid && dli->dl_sb == sb) {
return dli;
-int do_addrem_dlimit(uint32_t id, const char __user *name,
+static int do_addrem_dlimit(uint32_t id, const char __user *name,
uint32_t flags, int add)
{
struct nameidata nd;
if (buf->f_files > dli->dl_inodes_total)
buf->f_files = dli->dl_inodes_total;
+ /* inode hack for reiserfs */
+ if ((buf->f_files == 0) && (dli->dl_inodes_total > 0)) {
+ buf->f_files = dli->dl_inodes_total;
+ buf->f_ffree = dli->dl_inodes_total;
+ }
+
ifree = dli->dl_inodes_total - dli->dl_inodes_used;
/* reduce free inodes to min */
if (ifree < buf->f_ffree)