About this list Date view Thread view Subject view Author view Attachment view

From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Mon 29 Mar 2004 - 14:18:13 BST

On Mon, Mar 29, 2004 at 01:58:57PM +0200, Lars Braeuer wrote:
> Herbert Poetzl wrote:
> >
> >>What would be the right formula for reassembling the id's for vs1.27 +
> >>quota?
> >
> >
> >currently the best format would probably be UID24/GID24
> >
> >#define XIDINO_UID(uid, xid) (((uid) & 0xFFFFFF) | (((xid) & 0xFF00) <<
> >16))
> >#define XIDINO_GID(gid, xid) (((gid) & 0xFFFFFF) | (((xid) & 0x00FF) <<
> >24))
> >
> >which basically means that the upper 8 bit of (16 bit) xid
> >go into the upper 8 bit of the (32 bit) uid, and the lower
> >8 bit of the xid, into the upper 8 bit of the (32 bit) gid
> >
> >but probably simpler would be the transition to UID32/GID16
> >because in this setup, you only have to mask the 'old' uid
> >to 16 bit, and leave the gid untouched ...
> You mean the uid will remain untouched, since the xid goes
> into the upper 16 bit of the gid, correct or am I making a
> mistake here?

no, in the old format, both uid and gid contain redundant
information, where GID16 is equivalent for gid, it doesn't
touch the uid, so removing the upper 16 bit from the uid
would be sufficient, which might be easier than getting all
the math right ...

best would be to have a tool which does the conversion on
a non xid tagging filesystem, but it is at the lower end
of my todo list ...

> Well if UID24/GID24 is the recommended format, then converting
> both values (uid/gid) should be as easy as converting a single
> one (gid), I hope. ;)

well, you have to split up the xid, combine the parts with
the uid/gid, and store both back, where in the other case,
a masking of the uid to 16 bit is sufficient, YMMV


> Thanks for your help.
> Regards,
> Lars
Vserver mailing list

About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 29 Mar 2004 - 14:18:52 BST by hypermail 2.1.3