Re: [PATCH 2/3] quota: unify ->get_dqblk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 05, 2010 at 06:00:53PM +0200, Jan Kara wrote:
> > +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?

The only XFS-specific thing in dqblk_xfs.h is the name.  Feel free to
rename it to whatever better name suits you.

> >  /* 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...

I have a patch renaming the last remaining XFS_ identifiers in
dqblk_xfs.h to FS_ like the rest, but as I've just sent a gfs2 patch
that touches code with these identifiers I'll hold it back until the
gfs2 tree is merged.

> >  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....

Ok, fixed for the next version.

--
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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux