From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: [PATCH 12/13] vfs: Mobs creation and mgmt API Date: Tue, 03 May 2011 16:20:06 +0400 Message-ID: <4DBFF2F6.30306@parallels.com> References: <4DBFF1AD.90303@parallels.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel To: Hugh Dickins , Nick Piggin , Andrea Arcangeli , Rik van Riel , Dave Hansen , Alexa Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:20755 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600Ab1ECMTy (ORCPT ); Tue, 3 May 2011 08:19:54 -0400 In-Reply-To: <4DBFF1AD.90303@parallels.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: These are ioctl-s, sorry. I've spent many time thinking which API for that would be better, but didn't find any perfect solutions, so this is to be discussed. The cgroups as they are implemented now are not suitable as they work for controllers, that controll the per-task-groups resources. The dcache is obviously not such. Signed-off-by: Pavel Emelyanov --- fs/ioctl.c | 9 +++++++++ include/linux/fs.h | 3 +++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/fs/ioctl.c b/fs/ioctl.c index 1eebeb7..e0c1e77 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -596,6 +597,14 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, return put_user(inode->i_sb->s_blocksize, p); } + case FIMOBROOT: + return dcache_new_mob(filp->f_path.dentry); + case FIMOBSIZE: + return dcache_set_mob_size(filp->f_path.dentry, arg); + case FIMOBSTAT: + return dcache_get_mob_stat(filp->f_path.dentry, + (struct dentry_mob_stat __user *)arg); + default: if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) error = file_ioctl(filp, cmd, arg); diff --git a/include/linux/fs.h b/include/linux/fs.h index a236ea3..4bf54bb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -327,6 +327,9 @@ struct inodes_stat_t { #define FIFREEZE _IOWR('X', 119, int) /* Freeze */ #define FITHAW _IOWR('X', 120, int) /* Thaw */ #define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */ +#define FIMOBROOT _IO('X', 122) +#define FIMOBSIZE _IOW('X', 123, unsigned long) +#define FIMOBSTAT _IOR('X', 124, struct dentry_mob_stat) #define FS_IOC_GETFLAGS _IOR('f', 1, long) #define FS_IOC_SETFLAGS _IOW('f', 2, long) -- 1.5.5.6