On Wed 05-05-10 06:39:39, Christoph Hellwig wrote: > Pass the larger struct fs_disk_quota to the ->get_dqblk operation so > that the Q_GETQUOTA and Q_XGETQUOTA operations can be implemented > with a single filesystem operation and we can retire the ->get_xquota > operation. The additional information (RT-subvolume accounting and > warn counts) are left zero for the VFS quota implementation. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > Index: linux-2.6/fs/quota/quota.c > =================================================================== > --- linux-2.6.orig/fs/quota/quota.c 2010-05-05 11:57:38.000000000 +0200 > +++ linux-2.6/fs/quota/quota.c 2010-05-05 11:58:46.681263382 +0200 > @@ -136,19 +136,32 @@ static int quota_setinfo(struct super_bl > return sb->s_qcop->set_info(sb, type, &info); > } > > +static void copy_to_if_dqblk(struct if_dqblk *dst, struct fs_disk_quota *src) Could you move fs_disk_quota declaration from an XFS-specific header to a generic one? > Index: linux-2.6/fs/quota/dquot.c > =================================================================== > --- linux-2.6.orig/fs/quota/dquot.c 2010-05-05 11:57:47.000000000 +0200 > +++ linux-2.6/fs/quota/dquot.c 2010-05-05 11:59:07.614022286 +0200 > @@ -2286,28 +2286,36 @@ static inline qsize_t stoqb(qsize_t spac > } > > /* Generic routine for getting common part of quota structure */ > -static void do_get_dqblk(struct dquot *dquot, struct if_dqblk *di) > +static void do_get_dqblk(struct dquot *dquot, struct fs_disk_quota *di) > { > struct mem_dqblk *dm = &dquot->dq_dqb; > > + memset(di, 0, sizeof(*di)); > + di->d_version = FS_DQUOT_VERSION; > + di->d_flags = dquot->dq_type == USRQUOTA ? > + XFS_USER_QUOTA : XFS_GROUP_QUOTA; > + di->d_id = dquot->dq_id; XFS_USER_QUOTA and XFS_GROUP_QUOTA looks awkward in the generic code... ... > int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, > - struct if_dqblk *di) > + struct fs_disk_quota *di) > { > struct dquot *dquot; > > + if (!sb_has_quota_active(sb, type)) > + return -ESRCH; > + dqget() already does this check so you can just remove it.... > dquot = dqget(sb, id, type); > if (!dquot) > return -ESRCH; > -- Jan Kara <jack@xxxxxxx> SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html