Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_intent-reduce-stack-usage-2.6-suse-newer.patch
1 ---
2  fs/namei.c            |    5 +----
3  include/linux/namei.h |    7 +++++++
4  2 files changed, 8 insertions(+), 4 deletions(-)
5
6 --- linux-2.6.5-7.282.orig/fs/namei.c
7 +++ linux-2.6.5-7.282/fs/namei.c
8 @@ -2369,7 +2369,6 @@ static inline int
9  __vfs_follow_link(struct nameidata *nd, const char *link)
10  {
11         int res = 0;
12 -       struct lookup_intent it = nd->intent;
13         char *name;
14  
15         if (IS_ERR(link))
16 @@ -2382,9 +2381,7 @@ __vfs_follow_link(struct nameidata *nd, 
17                         goto out;
18         }
19  
20 -       intent_init(&nd->intent, it.it_op);
21 -       nd->intent.it_flags = it.it_flags;
22 -       nd->intent.it_create_mode = it.it_create_mode;
23 +       intent_reset_fs_part(&nd->intent);
24         res = link_path_walk(link, nd);
25  out:
26         if (current->link_count || res || nd->last_type!=LAST_NORM)
27 --- linux-2.6.5-7.282.orig/include/linux/namei.h
28 +++ linux-2.6.5-7.282/include/linux/namei.h
29 @@ -37,6 +37,13 @@ struct lookup_intent {
30         } d;
31  };
32  
33 +static inline void intent_reset_fs_part(struct lookup_intent *it)
34 +{
35 +        memset(&it->d, 0, sizeof(it->d));
36 +        it->it_magic = INTENT_MAGIC;
37 +        it->it_op_release = NULL;
38 +}
39 +
40  static inline void intent_init(struct lookup_intent *it, int op)
41  {
42         memset(it, 0, sizeof(*it));