[Ocfs2-tools-devel] [PATCH 1/8] Update ocfs2_fs.h to contain all necessary quota structures and constants
Jan Kara
jack at suse.cz
Wed Jul 29 02:43:02 PDT 2009
On Tue 28-07-09 14:45:07, Joel Becker wrote:
> On Mon, Jul 27, 2009 at 07:53:29PM +0200, Jan Kara wrote:
> > diff --git a/include/ocfs2-kernel/ocfs2_fs.h b/include/ocfs2-kernel/ocfs2_fs.h
> > index 2140bb3..ad655dc 100644
> > --- a/include/ocfs2-kernel/ocfs2_fs.h
> > +++ b/include/ocfs2-kernel/ocfs2_fs.h
> > @@ -344,6 +344,8 @@ enum {
> > #define OCFS2_FIRST_ONLINE_SYSTEM_INODE SLOT_MAP_SYSTEM_INODE
> > HEARTBEAT_SYSTEM_INODE,
> > GLOBAL_BITMAP_SYSTEM_INODE,
> > + USER_QUOTA_SYSTEM_INODE,
> > + GROUP_QUOTA_SYSTEM_INODE,
> > #define OCFS2_LAST_GLOBAL_SYSTEM_INODE GLOBAL_BITMAP_SYSTEM_INODE
>
> You need to redefine OCFS2_LAST_GLOBAL_SYSTEM_INODE like it is
> in the kernel.
Ah, right. Will fix.
> > #define OCFS2_GLOBAL_INFO_OFF (sizeof(struct ocfs2_disk_dqheader))
> > +#define OCFS2_GLOBAL_TREE_BLK 1
>
> I don't see GLOBAL_TREE_BLK in the kernel.
They are in the generic quota header fs/quota/quota_tree.h defining quota
file format. For global quota files we use generic quota code which also
defines some parts of the disk format...
> > /* Information header of global quota file (immediately follows the generic
> > * header) */
> > @@ -977,6 +986,16 @@ struct ocfs2_global_disk_dqinfo {
> > * file */
> > };
> >
> > +/* Header of leaf tree block */
> > +struct ocfs2_global_disk_dqdbheader {
> > + __le32 dqdh_next_free; /* Number of next block with free entry */
> > + __le32 dqdh_prev_free; /* Number of previous block with free entry */
> > + __le16 dqdh_entries; /* Number of valid entries in block */
> > + __le16 dqdh_pad1;
> > + __le32 dqdh_pad2;
> > +};
>
> Nor do I see ocfs2_global_disk_dqdbheader.
>
> > +static inline int ocfs2_global_dqstr_in_blk(int blocksize)
> > +{
> > + return (blocksize - OCFS2_QBLK_RESERVED_SPACE -
> > + sizeof(struct ocfs2_global_disk_dqdbheader)) /
> > + sizeof(struct ocfs2_global_disk_dqblk);
> > +}
> > +
>
> Nor ocfs2_global_dqstr_in_blk.
These are the same cases. I can split them into a separate header file if
you like it better. But from the tools point of view, I felt that keeping
all disk-format related things in one header makes sence.
Honza
--
Jan Kara <jack at suse.cz>
SUSE Labs, CR
More information about the Ocfs2-tools-devel
mailing list