[OpenAFS] OpenAFS on Linux 2.5.x

Srikanth Vishwanathan vsrikanth@in.ibm.com
Thu, 17 Apr 2003 14:01:55 -0400


This is a multipart message in MIME format.
--=_alternative 0062DC8085256D0B_=
Content-Type: text/plain; charset="US-ASCII"

FYI, AIX 5.1 introduced these kernel interfaces. Something similar
would be helpful.

/usr/include/sys/cred.h ->

int kcred_getpag (struct ucred *, int, int *);
int kcred_setpag (struct ucred *, int, int);

/* which parameter values */
#define PAG_DFS         0
#define PAG_AFS         1

/* Works on the current process */
int get_pag(int which, int *pag);
int set_pag(int which, int pag);

struct pag_list {
        int pag;
        int active;
        int spare[2];
};

/* Given a pag, checks if there is any process that is using the PAG */
/* Useful for garbage collection of user structures */

int validate_pag(int which, struct pag_list pag[], int npag);

Thanks,

openafs-info-admin@openafs.org wrote on 04/17/2003 01:12:43 PM:

> On 17 Apr 2003, Derek Atkins wrote:
> 
> > Jeffrey Hutzelman <jhutz@cmu.edu> writes:
> >
> > > To reiterate...  Don't conflate PAG's with process groups; they do
> > > different things and need different scoping rules.  Though some may 
have
> > > forgotten, we've learned that lesson already -- it's why there's now 
a
> > > distinction between process groups and sessions.
> > >
> > > PAG scoping is completely orthogonal to sessions.  Many PAGs contain
> > > multiple sessions, due to things like running multiple xterms each 
of
> > > which contains a session leader (as described above).  But 
conversely, I
> > > frequently have xterms which run processes in different PAG's, since 
I
> > > routinely establish new PAG's to do privileged operations.
> >
> > Clearly we just need to write a patch that adds a pag_t type to struct
> > task, copied at fork(), and supplies a pag_create(task_t *) API to
> > create a new PAG in the given task.  I think that would be sufficient.
> > I don't think it would be a lot of code.  Is there some other API(s)
> > that we could need (assuming we could just use task->pag to read the
> > PAG out of a task).
> >
> > I'd also recommend "typedef __u64 pag_t;", but we could use an "__u32"
> > if we wanted.
> >
> > Comments?  Anyone care to write the (small) patch?  I'm willing to 
present
> > it to Linus, Alan, et al.
> 
> Not just an API.  If the OS is going to provide a PAG mechanism, it 
should
> also provide the relevant syscalls.  That way everyone can use the same
> PAG mechanism, and maybe someday the standard tools will do PAG
> management.
> 
> _______________________________________________
> OpenAFS-info mailing list
> OpenAFS-info@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-info

--=_alternative 0062DC8085256D0B_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2><tt>FYI, AIX 5.1 introduced these kernel interfaces. Something
similar</tt></font>
<br><font size=2><tt>would be helpful.</tt></font>
<br>
<br><font size=2><tt>/usr/include/sys/cred.h -&gt;</tt></font>
<br>
<br><font size=2><tt>int kcred_getpag (struct ucred *, int, int *);</tt></font>
<br><font size=2><tt>int kcred_setpag (struct ucred *, int, int);</tt></font>
<br>
<br><font size=2><tt>/* which parameter values */</tt></font>
<br><font size=2><tt>#define PAG_DFS &nbsp; &nbsp; &nbsp; &nbsp; 0</tt></font>
<br><font size=2><tt>#define PAG_AFS &nbsp; &nbsp; &nbsp; &nbsp; 1</tt></font>
<br>
<br><font size=2><tt>/* Works on the current process */</tt></font>
<br><font size=2><tt>int get_pag(int which, int *pag);</tt></font>
<br><font size=2><tt>int set_pag(int which, int pag);</tt></font>
<br>
<br><font size=2><tt>struct pag_list {</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; int pag;</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; int active;</tt></font>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; int spare[2];</tt></font>
<br><font size=2><tt>};</tt></font>
<br>
<br><font size=2><tt>/* Given a pag, checks if there is any process that
is using the PAG */</tt></font>
<br><font size=2><tt>/* Useful for garbage collection of user structures
*/</tt></font>
<br>
<br><font size=2><tt>int validate_pag(int which, struct pag_list pag[],
int npag);</tt></font>
<br>
<br><font size=2><tt>Thanks,</tt></font>
<br>
<br><font size=2><tt>openafs-info-admin@openafs.org wrote on 04/17/2003
01:12:43 PM:<br>
<br>
&gt; On 17 Apr 2003, Derek Atkins wrote:<br>
&gt; <br>
&gt; &gt; Jeffrey Hutzelman &lt;jhutz@cmu.edu&gt; writes:<br>
&gt; &gt;<br>
&gt; &gt; &gt; To reiterate... &nbsp;Don't conflate PAG's with process
groups; they do<br>
&gt; &gt; &gt; different things and need different scoping rules. &nbsp;Though
some may have<br>
&gt; &gt; &gt; forgotten, we've learned that lesson already -- it's why
there's now a<br>
&gt; &gt; &gt; distinction between process groups and sessions.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; PAG scoping is completely orthogonal to sessions. &nbsp;Many
PAGs contain<br>
&gt; &gt; &gt; multiple sessions, due to things like running multiple xterms
each of<br>
&gt; &gt; &gt; which contains a session leader (as described above). &nbsp;But
conversely, I<br>
&gt; &gt; &gt; frequently have xterms which run processes in different
PAG's, since I<br>
&gt; &gt; &gt; routinely establish new PAG's to do privileged operations.<br>
&gt; &gt;<br>
&gt; &gt; Clearly we just need to write a patch that adds a pag_t type
to struct<br>
&gt; &gt; task, copied at fork(), and supplies a pag_create(task_t *) API
to<br>
&gt; &gt; create a new PAG in the given task. &nbsp;I think that would
be sufficient.<br>
&gt; &gt; I don't think it would be a lot of code. &nbsp;Is there some
other API(s)<br>
&gt; &gt; that we could need (assuming we could just use task-&gt;pag to
read the<br>
&gt; &gt; PAG out of a task).<br>
&gt; &gt;<br>
&gt; &gt; I'd also recommend &quot;typedef __u64 pag_t;&quot;, but we could
use an &quot;__u32&quot;<br>
&gt; &gt; if we wanted.<br>
&gt; &gt;<br>
&gt; &gt; Comments? &nbsp;Anyone care to write the (small) patch? &nbsp;I'm
willing to present<br>
&gt; &gt; it to Linus, Alan, et al.<br>
&gt; <br>
&gt; Not just an API. &nbsp;If the OS is going to provide a PAG mechanism,
it should<br>
&gt; also provide the relevant syscalls. &nbsp;That way everyone can use
the same<br>
&gt; PAG mechanism, and maybe someday the standard tools will do PAG<br>
&gt; management.<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; OpenAFS-info mailing list<br>
&gt; OpenAFS-info@openafs.org<br>
&gt; https://lists.openafs.org/mailman/listinfo/openafs-info<br>
</tt></font>
--=_alternative 0062DC8085256D0B_=--