OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 2/3] SUNRPC: traverse clients tree on PipeFS event
Re: [PATCH 2/3] SUNRPC: traverse clients tree on PipeFS event [message #46124 is a reply to message #45966] Thu, 26 April 2012 18:11 Go to previous messageGo to previous message
Myklebust, Trond is currently offline  Myklebust, Trond
Messages: 52
Registered: November 2011
Member
On Fri, 2012-04-20 at 18:19 +0400, Stanislav Kinsbursky wrote:

> +static int __rpc_pipefs_event(struct rpc_clnt *clnt, unsigned long event,
> + struct super_block *sb)
> +{
> + int error;
> +
> + if (!rpc_clnt_skip_event(clnt, event)) {
> + error = __rpc_clnt_handle_event(clnt, event, sb);
> + if (error)
> + return error;
> + }
> + if (clnt != clnt->cl_parent)
> + return __rpc_pipefs_event(clnt->cl_parent, event, sb);
> + return 0;
> +}

Hi Stanislav,

Recursion in the kernel is generally frowned upon due to the stack size
limits. Could you please rewrite the above into a simple loop. Something
along the lines of:

for(;;) {
...

if (clnt == clnt->cl_parent)
break;
clnt = clnt->cl_parent;
}

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH v3 2/2] decrement static keys on real destroy time
Next Topic: [PATCH v4 0/3] fix problem with static_branch() for sock memcg
Goto Forum:
  


Current Time: Sun Oct 12 23:55:07 GMT 2025

Total time taken to generate the page: 0.21199 seconds