Commit 42b1337f authored by Nathan Scott's avatar Nathan Scott Committed by Linus Torvalds

[PATCH] xattr updates (minor, 3/4)

This next incremental patch tidies up the data types passed back
from the `list' and `get' extended attribute syscalls - these now
match the design (ie. using ssize_t) rather than simply using long
or int everywhere; also now use const types in the VFS interface,
where appropriate.

Nathan
parent b8116216
...@@ -138,10 +138,10 @@ sys_fsetxattr(int fd, char *name, void *value, size_t size, int flags) ...@@ -138,10 +138,10 @@ sys_fsetxattr(int fd, char *name, void *value, size_t size, int flags)
/* /*
* Extended attribute GET operations * Extended attribute GET operations
*/ */
static long static ssize_t
getxattr(struct dentry *d, char *name, void *value, size_t size) getxattr(struct dentry *d, char *name, void *value, size_t size)
{ {
int error; ssize_t error;
void *kvalue; void *kvalue;
char kname[XATTR_NAME_MAX + 1]; char kname[XATTR_NAME_MAX + 1];
...@@ -169,11 +169,11 @@ getxattr(struct dentry *d, char *name, void *value, size_t size) ...@@ -169,11 +169,11 @@ getxattr(struct dentry *d, char *name, void *value, size_t size)
return error; return error;
} }
asmlinkage long asmlinkage ssize_t
sys_getxattr(char *path, char *name, void *value, size_t size) sys_getxattr(char *path, char *name, void *value, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
int error; ssize_t error;
error = user_path_walk(path, &nd); error = user_path_walk(path, &nd);
if (error) if (error)
...@@ -183,11 +183,11 @@ sys_getxattr(char *path, char *name, void *value, size_t size) ...@@ -183,11 +183,11 @@ sys_getxattr(char *path, char *name, void *value, size_t size)
return error; return error;
} }
asmlinkage long asmlinkage ssize_t
sys_lgetxattr(char *path, char *name, void *value, size_t size) sys_lgetxattr(char *path, char *name, void *value, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
int error; ssize_t error;
error = user_path_walk_link(path, &nd); error = user_path_walk_link(path, &nd);
if (error) if (error)
...@@ -197,11 +197,11 @@ sys_lgetxattr(char *path, char *name, void *value, size_t size) ...@@ -197,11 +197,11 @@ sys_lgetxattr(char *path, char *name, void *value, size_t size)
return error; return error;
} }
asmlinkage long asmlinkage ssize_t
sys_fgetxattr(int fd, char *name, void *value, size_t size) sys_fgetxattr(int fd, char *name, void *value, size_t size)
{ {
struct file *f; struct file *f;
int error = -EBADF; ssize_t error = -EBADF;
f = fget(fd); f = fget(fd);
if (!f) if (!f)
...@@ -214,10 +214,10 @@ sys_fgetxattr(int fd, char *name, void *value, size_t size) ...@@ -214,10 +214,10 @@ sys_fgetxattr(int fd, char *name, void *value, size_t size)
/* /*
* Extended attribute LIST operations * Extended attribute LIST operations
*/ */
static long static ssize_t
listxattr(struct dentry *d, char *list, size_t size) listxattr(struct dentry *d, char *list, size_t size)
{ {
int error; ssize_t error;
char *klist; char *klist;
klist = (char *)xattr_alloc(size, XATTR_LIST_MAX); klist = (char *)xattr_alloc(size, XATTR_LIST_MAX);
...@@ -238,11 +238,11 @@ listxattr(struct dentry *d, char *list, size_t size) ...@@ -238,11 +238,11 @@ listxattr(struct dentry *d, char *list, size_t size)
return error; return error;
} }
asmlinkage long asmlinkage ssize_t
sys_listxattr(char *path, char *list, size_t size) sys_listxattr(char *path, char *list, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
int error; ssize_t error;
error = user_path_walk(path, &nd); error = user_path_walk(path, &nd);
if (error) if (error)
...@@ -252,11 +252,11 @@ sys_listxattr(char *path, char *list, size_t size) ...@@ -252,11 +252,11 @@ sys_listxattr(char *path, char *list, size_t size)
return error; return error;
} }
asmlinkage long asmlinkage ssize_t
sys_llistxattr(char *path, char *list, size_t size) sys_llistxattr(char *path, char *list, size_t size)
{ {
struct nameidata nd; struct nameidata nd;
int error; ssize_t error;
error = user_path_walk_link(path, &nd); error = user_path_walk_link(path, &nd);
if (error) if (error)
...@@ -266,11 +266,11 @@ sys_llistxattr(char *path, char *list, size_t size) ...@@ -266,11 +266,11 @@ sys_llistxattr(char *path, char *list, size_t size)
return error; return error;
} }
asmlinkage long asmlinkage ssize_t
sys_flistxattr(int fd, char *list, size_t size) sys_flistxattr(int fd, char *list, size_t size)
{ {
struct file *f; struct file *f;
int error = -EBADF; ssize_t error = -EBADF;
f = fget(fd); f = fget(fd);
if (!f) if (!f)
......
...@@ -835,10 +835,10 @@ struct inode_operations { ...@@ -835,10 +835,10 @@ struct inode_operations {
int (*revalidate) (struct dentry *); int (*revalidate) (struct dentry *);
int (*setattr) (struct dentry *, struct iattr *); int (*setattr) (struct dentry *, struct iattr *);
int (*getattr) (struct dentry *, struct iattr *); int (*getattr) (struct dentry *, struct iattr *);
int (*setxattr) (struct dentry *, char *, void *, size_t, int); int (*setxattr) (struct dentry *, const char *, void *, size_t, int);
int (*getxattr) (struct dentry *, char *, void *, size_t); ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
int (*listxattr) (struct dentry *, char *, size_t); ssize_t (*listxattr) (struct dentry *, char *, size_t);
int (*removexattr) (struct dentry *, char *); int (*removexattr) (struct dentry *, const char *);
}; };
struct seq_file; struct seq_file;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment