On Sat, Oct 25, 2008 at 12:08:03AM +0200, Jan Kara wrote:
> If filesystem can handle quota files as system files hidden from users, we can
> skip a lot of cache invalidation, syncing, inode flags setting etc. when
> turning quotas on, off and quota_sync. Allow filesystem to indicate that it is
> hiding quota files from users by DQUOT_QUOTA_SYS_FILE flag.
> 
> Signed-off-by: Jan Kara <[EMAIL PROTECTED]>
> ---
>  fs/dquot.c            |   45 ++++++++++++++++++++++++++++++---------------
>  fs/quota.c            |    3 +++
>  include/linux/quota.h |    7 +++++++
>  3 files changed, 40 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/dquot.c b/fs/dquot.c
> index 96ed45b..5b82722 100644
> --- a/fs/dquot.c
> +++ b/fs/dquot.c
> @@ -1627,6 +1627,11 @@ int vfs_quota_disable(struct super_block *sb, int 
> type, unsigned int flags)
>               dqopt->ops[cnt] = NULL;
>       }
>       mutex_unlock(&dqopt->dqonoff_mutex);
> +
> +     /* Skip syncing and setting flags if quota files are hidden */
> +     if (dqopt->flags & DQUOT_QUOTA_SYS_FILE)
> +             goto put_inodes;
> +
>       /* Sync the superblock so that buffers with quota data are written to
>        * disk (and so userspace sees correct data afterwards). */
>       if (sb->s_op->sync_fs)
> @@ -1651,6 +1656,12 @@ int vfs_quota_disable(struct super_block *sb, int 
> type, unsigned int flags)
>                               mark_inode_dirty(toputinode[cnt]);
>                       }
>                       mutex_unlock(&dqopt->dqonoff_mutex);
> +             }
> +     if (sb->s_bdev)
> +             invalidate_bdev(sb->s_bdev);

Is the indentation here weird, or am I just reading this wrong?


Otherwise btw, this patch is a fantastic idea. I hadn't thought of it
before, but this should save Ocfs2 a good amount of pain.
        --Mark

--
Mark Fasheh

_______________________________________________
Ocfs2-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/ocfs2-devel

Reply via email to