Messages in this thread | | | Date | Thu, 24 Jun 2004 11:57:04 -0700 | From | Chris Wright <> | Subject | Re: [PATCH] Process Aggregates (PAGG) for 2.6.7 |
| |
* Limin Gu (limin@dbear.engr.sgi.com) wrote: > Job has not received much feedback from the community yet, we welcome > any comments/suggestions/criticism for you.
I recall seeing a bunch of syscall looking pieces in job that seemed odd to be stuck behind a module.
Ah, yes...
> +/* Function prototypes */ > +static int job_sys_create(struct job_create *); > +static int job_sys_getjid(struct job_getjid *); > +static int job_sys_waitjid(struct job_waitjid *); > +static int job_sys_killjid(struct job_killjid *); > +static int job_sys_getjidcnt(struct job_jidcnt *); > +static int job_sys_getjidlst(struct job_jidlst *); > +static int job_sys_getpidcnt(struct job_pidcnt *); > +static int job_sys_getpidlst(struct job_pidlst *); > +static int job_sys_getuser(struct job_user *); > +static int job_sys_getprimepid(struct job_primepid *); > +static int job_sys_sethid(struct job_sethid *); > +static int job_sys_detachjid(struct job_detachjid *); > +static int job_sys_detachpid(struct job_detachpid *); > +static int job_attach(struct task_struct *, struct pagg *, void *); > +static void job_detach(struct task_struct *, struct pagg *); > +static struct job_entry *job_getjob(u64 jid); > +static int job_syscall(unsigned int, unsigned long); > + > +u64 job_getjid(struct task_struct *); > + > +int job_ioctl(struct inode *, struct file *, unsigned int, unsigned long); [snip] > +/* > + * job_syscall > + * > + * Function to handle job syscall requests. > + * > + * Returns 0 on success and -(ERRNO VALUE) upon failure. > + */ > +int > +job_syscall(unsigned int request, unsigned long data)
trivial...declared static above.
> +{ > + int rc=0; > + > + DBG_PRINTINIT("job_syscall"); > + > + DBG_PRINTENTRY(); > + > + switch (request) { > + case JOB_CREATE: > + rc = job_sys_create((struct job_create *)data); > + break; > + case JOB_ATTACH: > + case JOB_DETACH: > + /* RESERVED */ > + rc = -EBADRQC; > + break; > + case JOB_GETJID: > + rc = job_sys_getjid((struct job_getjid *)data); > + break; > + case JOB_WAITJID: > + rc = job_sys_waitjid((struct job_waitjid *)data); > + break; > + case JOB_KILLJID: > + rc = job_sys_killjid((struct job_killjid *)data); > + break; > + case JOB_GETJIDCNT: > + rc = job_sys_getjidcnt((struct job_jidcnt *)data); > + break; > + case JOB_GETJIDLST: > + rc = job_sys_getjidlst((struct job_jidlst *)data); > + break; > + case JOB_GETPIDCNT: > + rc = job_sys_getpidcnt((struct job_pidcnt *)data); > + break; > + case JOB_GETPIDLST: > + rc = job_sys_getpidlst((struct job_pidlst *)data); > + break; > + case JOB_GETUSER: > + rc = job_sys_getuser((struct job_user *)data); > + break; > + case JOB_GETPRIMEPID: > + rc = job_sys_getprimepid((struct job_primepid *)data); > + break; > + case JOB_SETHID: > + rc = job_sys_sethid((struct job_sethid *)data); > + break; > + case JOB_DETACHJID: > + rc = job_sys_detachjid((struct job_detachjid *)data); > + break; > + case JOB_DETACHPID: > + rc = job_sys_detachpid((struct job_detachpid *)data); > + break; > + case JOB_SETJLIMIT: > + case JOB_GETJLIMIT: > + case JOB_GETJUSAGE: > + case JOB_FREE: > + default: > + rc = -EBADRQC; > + break; > + } > + > + DBG_PRINTEXIT(rc); > + return rc; > +} > + > + > +/* > + * job_ioctl > + * > + * Function to handle job ioctl call requests. > + * > + * Returns 0 on success and -(ERRNO VALUE) upon failure. > + */ > +int > +job_ioctl(struct inode *inode, struct file *file, unsigned int request, > + unsigned long data) > +{ > + return job_syscall(request, data); > +}
So, this is really ioctl. This should be exposed in fs interface, or the primitives should be promoted to first class syscalls if others can use this.
thanks, -chris -- Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |