diff options
author | Jan Blunck <jblunck@suse.de> | 2008-02-14 22:34:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-15 00:13:33 -0500 |
commit | 4ac9137858e08a19f29feac4e1f4df7c268b0ba5 (patch) | |
tree | f5b5d84fd12fcc2b0ba0e7ce1a79ff381ad8f5dd /fs/xattr.c | |
parent | c5e725f33b733a77de622e91b6ba5645fcf070be (diff) |
Embed a struct path into struct nameidata instead of nd->{dentry,mnt}
This is the central patch of a cleanup series. In most cases there is no good
reason why someone would want to use a dentry for itself. This series reflects
that fact and embeds a struct path into nameidata.
Together with the other patches of this series
- it enforced the correct order of getting/releasing the reference count on
<dentry,vfsmount> pairs
- it prepares the VFS for stacking support since it is essential to have a
struct path in every place where the stack can be traversed
- it reduces the overall code size:
without patch series:
text data bss dec hex filename
5321639 858418 715768 6895825 6938d1 vmlinux
with patch series:
text data bss dec hex filename
5320026 858418 715768 6894212 693284 vmlinux
This patch:
Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere.
[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix cifs]
[akpm@linux-foundation.org: fix smack]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/xattr.c')
-rw-r--r-- | fs/xattr.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xattr.c b/fs/xattr.c index f7c8f87bb390..be0ee756c5f1 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -262,7 +262,7 @@ sys_setxattr(char __user *path, char __user *name, void __user *value, | |||
262 | error = user_path_walk(path, &nd); | 262 | error = user_path_walk(path, &nd); |
263 | if (error) | 263 | if (error) |
264 | return error; | 264 | return error; |
265 | error = setxattr(nd.dentry, name, value, size, flags); | 265 | error = setxattr(nd.path.dentry, name, value, size, flags); |
266 | path_release(&nd); | 266 | path_release(&nd); |
267 | return error; | 267 | return error; |
268 | } | 268 | } |
@@ -277,7 +277,7 @@ sys_lsetxattr(char __user *path, char __user *name, void __user *value, | |||
277 | error = user_path_walk_link(path, &nd); | 277 | error = user_path_walk_link(path, &nd); |
278 | if (error) | 278 | if (error) |
279 | return error; | 279 | return error; |
280 | error = setxattr(nd.dentry, name, value, size, flags); | 280 | error = setxattr(nd.path.dentry, name, value, size, flags); |
281 | path_release(&nd); | 281 | path_release(&nd); |
282 | return error; | 282 | return error; |
283 | } | 283 | } |
@@ -347,7 +347,7 @@ sys_getxattr(char __user *path, char __user *name, void __user *value, | |||
347 | error = user_path_walk(path, &nd); | 347 | error = user_path_walk(path, &nd); |
348 | if (error) | 348 | if (error) |
349 | return error; | 349 | return error; |
350 | error = getxattr(nd.dentry, name, value, size); | 350 | error = getxattr(nd.path.dentry, name, value, size); |
351 | path_release(&nd); | 351 | path_release(&nd); |
352 | return error; | 352 | return error; |
353 | } | 353 | } |
@@ -362,7 +362,7 @@ sys_lgetxattr(char __user *path, char __user *name, void __user *value, | |||
362 | error = user_path_walk_link(path, &nd); | 362 | error = user_path_walk_link(path, &nd); |
363 | if (error) | 363 | if (error) |
364 | return error; | 364 | return error; |
365 | error = getxattr(nd.dentry, name, value, size); | 365 | error = getxattr(nd.path.dentry, name, value, size); |
366 | path_release(&nd); | 366 | path_release(&nd); |
367 | return error; | 367 | return error; |
368 | } | 368 | } |
@@ -421,7 +421,7 @@ sys_listxattr(char __user *path, char __user *list, size_t size) | |||
421 | error = user_path_walk(path, &nd); | 421 | error = user_path_walk(path, &nd); |
422 | if (error) | 422 | if (error) |
423 | return error; | 423 | return error; |
424 | error = listxattr(nd.dentry, list, size); | 424 | error = listxattr(nd.path.dentry, list, size); |
425 | path_release(&nd); | 425 | path_release(&nd); |
426 | return error; | 426 | return error; |
427 | } | 427 | } |
@@ -435,7 +435,7 @@ sys_llistxattr(char __user *path, char __user *list, size_t size) | |||
435 | error = user_path_walk_link(path, &nd); | 435 | error = user_path_walk_link(path, &nd); |
436 | if (error) | 436 | if (error) |
437 | return error; | 437 | return error; |
438 | error = listxattr(nd.dentry, list, size); | 438 | error = listxattr(nd.path.dentry, list, size); |
439 | path_release(&nd); | 439 | path_release(&nd); |
440 | return error; | 440 | return error; |
441 | } | 441 | } |
@@ -482,7 +482,7 @@ sys_removexattr(char __user *path, char __user *name) | |||
482 | error = user_path_walk(path, &nd); | 482 | error = user_path_walk(path, &nd); |
483 | if (error) | 483 | if (error) |
484 | return error; | 484 | return error; |
485 | error = removexattr(nd.dentry, name); | 485 | error = removexattr(nd.path.dentry, name); |
486 | path_release(&nd); | 486 | path_release(&nd); |
487 | return error; | 487 | return error; |
488 | } | 488 | } |
@@ -496,7 +496,7 @@ sys_lremovexattr(char __user *path, char __user *name) | |||
496 | error = user_path_walk_link(path, &nd); | 496 | error = user_path_walk_link(path, &nd); |
497 | if (error) | 497 | if (error) |
498 | return error; | 498 | return error; |
499 | error = removexattr(nd.dentry, name); | 499 | error = removexattr(nd.path.dentry, name); |
500 | path_release(&nd); | 500 | path_release(&nd); |
501 | return error; | 501 | return error; |
502 | } | 502 | } |