Paul Jackson wrote:
> This doesn't compile for me, against 2.6.18 using sn2_defconfig.
> 
> I get the following warnings and failures.  Most of the warnings
> involve various *_file_write() functions, so I show a grep of those
> as well:
> 

Hi, Paul,

I posted a fix to this problem
http://marc.theaimsgroup.com/?l=ckrm-tech&m=116047142507304&w=2. I hope it fixes
your build too.

The posted patch fixes the resource groups compile error and resource groups
warnings. I suspect one additional change to make cpuset_common_file_write
return an int instead of ssize_t would fix the cpuset warnings.

I am also including the patch inline, with the warnings fix for cpusets as well.


Signed-off-by: Balbir Singh <[EMAIL PROTECTED]>
---

 kernel/cpuset.c              |    2 +-
 kernel/res_group/local.h     |    2 +-
 kernel/res_group/res_group.c |    6 ------
 kernel/res_group/rgcs.c      |    8 ++++----
 4 files changed, 6 insertions(+), 12 deletions(-)

diff -puN kernel/res_group/res_group.c~container-res-group-fix-link-failure
kernel/res_group/res_group.c
---
linux-2.6.18/kernel/res_group/res_group.c~container-res-group-fix-link-failure
2006-10-10 14:03:40.000000000 +0530
+++ linux-2.6.18-balbir/kernel/res_group/res_group.c    2006-10-10
14:04:58.000000000 +0530
@@ -158,10 +158,4 @@ int unregister_controller(struct res_con

 EXPORT_SYMBOL_GPL(register_controller);
 EXPORT_SYMBOL_GPL(unregister_controller);
-EXPORT_SYMBOL_GPL(get_controller_by_name);
-EXPORT_SYMBOL_GPL(get_controller_by_id);
-EXPORT_SYMBOL_GPL(put_controller);
-EXPORT_SYMBOL_GPL(alloc_res_group);
-EXPORT_SYMBOL_GPL(free_res_group);
-EXPORT_SYMBOL_GPL(default_res_group);
 EXPORT_SYMBOL_GPL(set_controller_shares);
diff -puN kernel/res_group/local.h~container-res-group-fix-link-failure
kernel/res_group/local.h
--- linux-2.6.18/kernel/res_group/local.h~container-res-group-fix-link-failure
2006-10-10 14:19:21.000000000 +0530
+++ linux-2.6.18-balbir/kernel/res_group/local.h        2006-10-10 
14:19:35.000000000 +0530
@@ -26,7 +26,7 @@ ssize_t res_group_file_read(struct conta
                            struct file *file,
                            char __user *buf,
                            size_t nbytes, loff_t *ppos);
-ssize_t res_group_file_write(struct container *cont,
+int res_group_file_write(struct container *cont,
                             struct cftype *cft,
                             struct file *file,
                             const char __user *userbuf,
diff -puN kernel/res_group/rgcs.c~container-res-group-fix-link-failure
kernel/res_group/rgcs.c
--- linux-2.6.18/kernel/res_group/rgcs.c~container-res-group-fix-link-failure
2006-10-10 14:19:24.000000000 +0530
+++ linux-2.6.18-balbir/kernel/res_group/rgcs.c 2006-10-10 14:20:50.000000000 
+0530
@@ -217,7 +217,7 @@ static ssize_t show_shares(struct resour
        return rc;
 }

-ssize_t res_group_file_write(struct container *cont,
+int res_group_file_write(struct container *cont,
                                   struct cftype *cft,
                                   struct file *file,
                                   const char __user *userbuf,
@@ -226,13 +226,13 @@ ssize_t res_group_file_write(struct cont
        struct res_group_cft *rgcft = container_of(cft, struct res_group_cft, 
cft);
        struct res_controller *ctlr = rgcft->ctlr;

-       if (nbytes >= PAGE_SIZE)
-               return -E2BIG;
-
        char *buf;
        ssize_t retval;
        int filetype = cft->private;

+       if (nbytes >= PAGE_SIZE)
+               return -E2BIG;
+
        buf = kmalloc(nbytes + 1, GFP_USER);
        if (!buf) return -ENOMEM;
        if (copy_from_user(buf, userbuf, nbytes)) {
diff -puN kernel/cpuset.c~container-res-group-fix-link-failure kernel/cpuset.c
--- linux-2.6.18/kernel/cpuset.c~container-res-group-fix-link-failure   
2006-10-11
09:12:29.000000000 +0530
+++ linux-2.6.18-balbir/kernel/cpuset.c 2006-10-11 09:12:47.000000000 +0530
@@ -843,7 +843,7 @@ typedef enum {
        FILE_SPREAD_SLAB,
 } cpuset_filetype_t;

-static ssize_t cpuset_common_file_write(struct container *cont,
+static int cpuset_common_file_write(struct container *cont,
                                        struct cftype *cft,
                                        struct file *file,
                                        const char __user *userbuf,
_


-- 

        Balbir Singh,
        Linux Technology Center,
        IBM Software Labs

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to