Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3f614a3d
Commit
3f614a3d
authored
Feb 25, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Remove flags argument from xattr inode operations again
SGI Modid: 2.5.x-xfs:slinx:140255a
parent
7e1abff7
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
110 additions
and
125 deletions
+110
-125
fs/ext2/acl.c
fs/ext2/acl.c
+4
-4
fs/ext2/xattr.c
fs/ext2/xattr.c
+9
-10
fs/ext2/xattr.h
fs/ext2/xattr.h
+6
-6
fs/ext2/xattr_trusted.c
fs/ext2/xattr_trusted.c
+5
-5
fs/ext2/xattr_user.c
fs/ext2/xattr_user.c
+22
-26
fs/ext3/acl.c
fs/ext3/acl.c
+4
-4
fs/ext3/xattr.c
fs/ext3/xattr.c
+9
-10
fs/ext3/xattr.h
fs/ext3/xattr.h
+7
-7
fs/ext3/xattr_trusted.c
fs/ext3/xattr_trusted.c
+5
-5
fs/ext3/xattr_user.c
fs/ext3/xattr_user.c
+22
-26
fs/jfs/jfs_xattr.h
fs/jfs/jfs_xattr.h
+3
-3
fs/jfs/xattr.c
fs/jfs/xattr.c
+3
-4
fs/xattr.c
fs/xattr.c
+3
-3
fs/xfs/linux/xfs_iops.c
fs/xfs/linux/xfs_iops.c
+3
-6
include/linux/fs.h
include/linux/fs.h
+3
-3
include/linux/xattr.h
include/linux/xattr.h
+2
-3
No files found.
fs/ext2/acl.c
View file @
3f614a3d
...
...
@@ -419,7 +419,7 @@ ext2_acl_chmod(struct inode *inode)
*/
static
size_t
ext2_xattr_list_acl_access
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
size_t
size
=
sizeof
(
XATTR_NAME_ACL_ACCESS
);
...
...
@@ -432,7 +432,7 @@ ext2_xattr_list_acl_access(char *list, struct inode *inode,
static
size_t
ext2_xattr_list_acl_default
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
size_t
size
=
sizeof
(
XATTR_NAME_ACL_DEFAULT
);
...
...
@@ -465,7 +465,7 @@ ext2_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size)
static
int
ext2_xattr_get_acl_access
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
!=
0
)
return
-
EINVAL
;
...
...
@@ -474,7 +474,7 @@ ext2_xattr_get_acl_access(struct inode *inode, const char *name,
static
int
ext2_xattr_get_acl_default
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
!=
0
)
return
-
EINVAL
;
...
...
fs/ext2/xattr.c
View file @
3f614a3d
...
...
@@ -199,7 +199,7 @@ ext2_xattr_handler(int name_index)
*/
ssize_t
ext2_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
struct
ext2_xattr_handler
*
handler
;
struct
inode
*
inode
=
dentry
->
d_inode
;
...
...
@@ -207,7 +207,7 @@ ext2_getxattr(struct dentry *dentry, const char *name,
handler
=
ext2_xattr_resolve_name
(
&
name
);
if
(
!
handler
)
return
-
EOPNOTSUPP
;
return
handler
->
get
(
inode
,
name
,
buffer
,
size
,
flags
);
return
handler
->
get
(
inode
,
name
,
buffer
,
size
);
}
/*
...
...
@@ -217,9 +217,9 @@ ext2_getxattr(struct dentry *dentry, const char *name,
* BKL held [before 2.5.x]
*/
ssize_t
ext2_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
,
int
flags
)
ext2_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
)
{
return
ext2_xattr_list
(
dentry
->
d_inode
,
buffer
,
size
,
flags
);
return
ext2_xattr_list
(
dentry
->
d_inode
,
buffer
,
size
);
}
/*
...
...
@@ -250,7 +250,7 @@ ext2_setxattr(struct dentry *dentry, const char *name,
* BKL held [before 2.5.x]
*/
int
ext2_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
flags
)
ext2_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
)
{
struct
ext2_xattr_handler
*
handler
;
struct
inode
*
inode
=
dentry
->
d_inode
;
...
...
@@ -258,7 +258,7 @@ ext2_removexattr(struct dentry *dentry, const char *name, int flags)
handler
=
ext2_xattr_resolve_name
(
&
name
);
if
(
!
handler
)
return
-
EOPNOTSUPP
;
return
handler
->
set
(
inode
,
name
,
NULL
,
0
,
flags
|
XATTR_REPLACE
);
return
handler
->
set
(
inode
,
name
,
NULL
,
0
,
XATTR_REPLACE
);
}
/*
...
...
@@ -371,8 +371,7 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_get",
* used / required on success.
*/
int
ext2_xattr_list
(
struct
inode
*
inode
,
char
*
buffer
,
size_t
buffer_size
,
int
flags
)
ext2_xattr_list
(
struct
inode
*
inode
,
char
*
buffer
,
size_t
buffer_size
)
{
struct
buffer_head
*
bh
=
NULL
;
struct
ext2_xattr_entry
*
entry
;
...
...
@@ -412,7 +411,7 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list",
handler
=
ext2_xattr_handler
(
entry
->
e_name_index
);
if
(
handler
)
size
+=
handler
->
list
(
NULL
,
inode
,
entry
->
e_name
,
entry
->
e_name_len
,
flags
);
entry
->
e_name_len
);
}
if
(
ext2_xattr_cache_insert
(
bh
))
...
...
@@ -435,7 +434,7 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_list",
handler
=
ext2_xattr_handler
(
entry
->
e_name_index
);
if
(
handler
)
buf
+=
handler
->
list
(
buf
,
inode
,
entry
->
e_name
,
entry
->
e_name_len
,
flags
);
entry
->
e_name_len
);
}
error
=
size
;
...
...
fs/ext2/xattr.h
View file @
3f614a3d
...
...
@@ -58,9 +58,9 @@ struct ext2_xattr_entry {
struct
ext2_xattr_handler
{
char
*
prefix
;
size_t
(
*
list
)(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
);
int
name_len
);
int
(
*
get
)(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
);
size_t
size
);
int
(
*
set
)(
struct
inode
*
inode
,
const
char
*
name
,
const
void
*
buffer
,
size_t
size
,
int
flags
);
};
...
...
@@ -69,12 +69,12 @@ extern int ext2_xattr_register(int, struct ext2_xattr_handler *);
extern
void
ext2_xattr_unregister
(
int
,
struct
ext2_xattr_handler
*
);
extern
int
ext2_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
extern
ssize_t
ext2_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
,
int
);
extern
ssize_t
ext2_listxattr
(
struct
dentry
*
,
char
*
,
size_t
,
int
);
extern
int
ext2_removexattr
(
struct
dentry
*
,
const
char
*
,
int
);
extern
ssize_t
ext2_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
ext2_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
int
ext2_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
int
ext2_xattr_get
(
struct
inode
*
,
int
,
const
char
*
,
void
*
,
size_t
);
extern
int
ext2_xattr_list
(
struct
inode
*
,
char
*
,
size_t
,
int
flags
);
extern
int
ext2_xattr_list
(
struct
inode
*
,
char
*
,
size_t
);
extern
int
ext2_xattr_set
(
struct
inode
*
,
int
,
const
char
*
,
const
void
*
,
size_t
,
int
);
extern
void
ext2_xattr_delete_inode
(
struct
inode
*
);
...
...
fs/ext2/xattr_trusted.c
View file @
3f614a3d
...
...
@@ -16,11 +16,11 @@
static
size_t
ext2_xattr_trusted_list
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
int
prefix_len
=
sizeof
(
XATTR_TRUSTED_PREFIX
)
-
1
;
if
(
!
((
flags
&
XATTR_KERNEL_CONTEXT
)
||
capable
(
CAP_SYS_ADMIN
)
))
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
0
;
if
(
list
)
{
...
...
@@ -33,11 +33,11 @@ ext2_xattr_trusted_list(char *list, struct inode *inode,
static
int
ext2_xattr_trusted_get
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
((
flags
&
XATTR_KERNEL_CONTEXT
)
||
capable
(
CAP_SYS_ADMIN
)
))
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
return
ext2_xattr_get
(
inode
,
EXT2_XATTR_INDEX_TRUSTED
,
name
,
buffer
,
size
);
...
...
@@ -49,7 +49,7 @@ ext2_xattr_trusted_set(struct inode *inode, const char *name,
{
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
((
flags
&
XATTR_KERNEL_CONTEXT
)
||
capable
(
CAP_SYS_ADMIN
)
))
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
return
ext2_xattr_set
(
inode
,
EXT2_XATTR_INDEX_TRUSTED
,
name
,
value
,
size
,
flags
);
...
...
fs/ext2/xattr_user.c
View file @
3f614a3d
...
...
@@ -19,12 +19,11 @@
static
size_t
ext2_xattr_user_list
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
int
prefix_len
=
sizeof
(
XATTR_USER_PREFIX
)
-
1
;
if
(
!
(
flags
&
XATTR_KERNEL_CONTEXT
)
&&
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
0
;
if
(
list
)
{
...
...
@@ -37,13 +36,12 @@ ext2_xattr_user_list(char *list, struct inode *inode,
static
int
ext2_xattr_user_get
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
(
flags
&
XATTR_KERNEL_CONTEXT
))
{
int
error
;
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
-
EOPNOTSUPP
;
#ifdef CONFIG_EXT2_FS_POSIX_ACL
...
...
@@ -53,25 +51,23 @@ ext2_xattr_user_get(struct inode *inode, const char *name,
#endif
if
(
error
)
return
error
;
}
return
ext2_xattr_get
(
inode
,
EXT2_XATTR_INDEX_USER
,
name
,
buffer
,
size
);
return
ext2_xattr_get
(
inode
,
EXT2_XATTR_INDEX_USER
,
name
,
buffer
,
size
);
}
static
int
ext2_xattr_user_set
(
struct
inode
*
inode
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
)
{
int
error
;
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
-
EOPNOTSUPP
;
if
(
!
S_ISREG
(
inode
->
i_mode
)
&&
(
!
S_ISDIR
(
inode
->
i_mode
)
||
inode
->
i_mode
&
S_ISVTX
))
return
-
EPERM
;
if
(
!
(
flags
&
XATTR_KERNEL_CONTEXT
))
{
int
error
;
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
-
EOPNOTSUPP
;
#ifdef CONFIG_EXT2_FS_POSIX_ACL
error
=
ext2_permission_locked
(
inode
,
MAY_WRITE
);
#else
...
...
@@ -79,7 +75,7 @@ ext2_xattr_user_set(struct inode *inode, const char *name,
#endif
if
(
error
)
return
error
;
}
return
ext2_xattr_set
(
inode
,
EXT2_XATTR_INDEX_USER
,
name
,
value
,
size
,
flags
);
}
...
...
fs/ext3/acl.c
View file @
3f614a3d
...
...
@@ -431,7 +431,7 @@ ext3_acl_chmod(struct inode *inode)
*/
static
size_t
ext3_xattr_list_acl_access
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
size_t
size
=
sizeof
(
XATTR_NAME_ACL_ACCESS
);
...
...
@@ -444,7 +444,7 @@ ext3_xattr_list_acl_access(char *list, struct inode *inode,
static
size_t
ext3_xattr_list_acl_default
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
size_t
size
=
sizeof
(
XATTR_NAME_ACL_DEFAULT
);
...
...
@@ -477,7 +477,7 @@ ext3_xattr_get_acl(struct inode *inode, int type, void *buffer, size_t size)
static
int
ext3_xattr_get_acl_access
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
!=
0
)
return
-
EINVAL
;
...
...
@@ -486,7 +486,7 @@ ext3_xattr_get_acl_access(struct inode *inode, const char *name,
static
int
ext3_xattr_get_acl_default
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
!=
0
)
return
-
EINVAL
;
...
...
fs/ext3/xattr.c
View file @
3f614a3d
...
...
@@ -195,7 +195,7 @@ ext3_xattr_handler(int name_index)
*/
ssize_t
ext3_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
struct
ext3_xattr_handler
*
handler
;
struct
inode
*
inode
=
dentry
->
d_inode
;
...
...
@@ -203,7 +203,7 @@ ext3_getxattr(struct dentry *dentry, const char *name,
handler
=
ext3_xattr_resolve_name
(
&
name
);
if
(
!
handler
)
return
-
EOPNOTSUPP
;
return
handler
->
get
(
inode
,
name
,
buffer
,
size
,
flags
);
return
handler
->
get
(
inode
,
name
,
buffer
,
size
);
}
/*
...
...
@@ -212,9 +212,9 @@ ext3_getxattr(struct dentry *dentry, const char *name,
* dentry->d_inode->i_sem down
*/
ssize_t
ext3_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
,
int
flags
)
ext3_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
)
{
return
ext3_xattr_list
(
dentry
->
d_inode
,
buffer
,
size
,
flags
);
return
ext3_xattr_list
(
dentry
->
d_inode
,
buffer
,
size
);
}
/*
...
...
@@ -243,7 +243,7 @@ ext3_setxattr(struct dentry *dentry, const char *name,
* dentry->d_inode->i_sem down
*/
int
ext3_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
flags
)
ext3_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
)
{
struct
ext3_xattr_handler
*
handler
;
struct
inode
*
inode
=
dentry
->
d_inode
;
...
...
@@ -251,7 +251,7 @@ ext3_removexattr(struct dentry *dentry, const char *name, int flags)
handler
=
ext3_xattr_resolve_name
(
&
name
);
if
(
!
handler
)
return
-
EOPNOTSUPP
;
return
handler
->
set
(
inode
,
name
,
NULL
,
0
,
flags
|
XATTR_REPLACE
);
return
handler
->
set
(
inode
,
name
,
NULL
,
0
,
XATTR_REPLACE
);
}
/*
...
...
@@ -364,8 +364,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_get",
* used / required on success.
*/
int
ext3_xattr_list
(
struct
inode
*
inode
,
char
*
buffer
,
size_t
buffer_size
,
int
flags
)
ext3_xattr_list
(
struct
inode
*
inode
,
char
*
buffer
,
size_t
buffer_size
)
{
struct
buffer_head
*
bh
=
NULL
;
struct
ext3_xattr_entry
*
entry
;
...
...
@@ -405,7 +404,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list",
handler
=
ext3_xattr_handler
(
entry
->
e_name_index
);
if
(
handler
)
size
+=
handler
->
list
(
NULL
,
inode
,
entry
->
e_name
,
entry
->
e_name_len
,
flags
);
entry
->
e_name_len
);
}
if
(
ext3_xattr_cache_insert
(
bh
))
...
...
@@ -428,7 +427,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list",
handler
=
ext3_xattr_handler
(
entry
->
e_name_index
);
if
(
handler
)
buf
+=
handler
->
list
(
buf
,
inode
,
entry
->
e_name
,
entry
->
e_name_len
,
flags
);
entry
->
e_name_len
);
}
error
=
size
;
...
...
fs/ext3/xattr.h
View file @
3f614a3d
...
...
@@ -57,9 +57,9 @@ struct ext3_xattr_entry {
struct
ext3_xattr_handler
{
char
*
prefix
;
size_t
(
*
list
)(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
);
int
name_len
);
int
(
*
get
)(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
);
size_t
size
);
int
(
*
set
)(
struct
inode
*
inode
,
const
char
*
name
,
const
void
*
buffer
,
size_t
size
,
int
flags
);
};
...
...
@@ -68,12 +68,12 @@ extern int ext3_xattr_register(int, struct ext3_xattr_handler *);
extern
void
ext3_xattr_unregister
(
int
,
struct
ext3_xattr_handler
*
);
extern
int
ext3_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
extern
ssize_t
ext3_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
,
int
);
extern
ssize_t
ext3_listxattr
(
struct
dentry
*
,
char
*
,
size_t
,
int
);
extern
int
ext3_removexattr
(
struct
dentry
*
,
const
char
*
,
int
);
extern
ssize_t
ext3_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
ext3_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
int
ext3_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
int
ext3_xattr_get
(
struct
inode
*
,
int
,
const
char
*
,
void
*
,
size_t
);
extern
int
ext3_xattr_list
(
struct
inode
*
,
char
*
,
size_t
,
int
flags
);
extern
int
ext3_xattr_list
(
struct
inode
*
,
char
*
,
size_t
);
extern
int
ext3_xattr_set
(
struct
inode
*
,
int
,
const
char
*
,
const
void
*
,
size_t
,
int
);
extern
int
ext3_xattr_set_handle
(
handle_t
*
,
struct
inode
*
,
int
,
const
char
*
,
const
void
*
,
size_t
,
int
);
...
...
@@ -97,7 +97,7 @@ ext3_xattr_get(struct inode *inode, int name_index, const char *name,
}
static
inline
int
ext3_xattr_list
(
struct
inode
*
inode
,
void
*
buffer
,
size_t
size
,
int
flags
)
ext3_xattr_list
(
struct
inode
*
inode
,
void
*
buffer
,
size_t
size
)
{
return
-
EOPNOTSUPP
;
}
...
...
fs/ext3/xattr_trusted.c
View file @
3f614a3d
...
...
@@ -17,11 +17,11 @@
static
size_t
ext3_xattr_trusted_list
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
int
prefix_len
=
sizeof
(
XATTR_TRUSTED_PREFIX
)
-
1
;
if
(
!
((
flags
&
XATTR_KERNEL_CONTEXT
)
||
capable
(
CAP_SYS_ADMIN
)
))
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
0
;
if
(
list
)
{
...
...
@@ -34,11 +34,11 @@ ext3_xattr_trusted_list(char *list, struct inode *inode,
static
int
ext3_xattr_trusted_get
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
((
flags
&
XATTR_KERNEL_CONTEXT
)
||
capable
(
CAP_SYS_ADMIN
)
))
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
return
ext3_xattr_get
(
inode
,
EXT3_XATTR_INDEX_TRUSTED
,
name
,
buffer
,
size
);
...
...
@@ -50,7 +50,7 @@ ext3_xattr_trusted_set(struct inode *inode, const char *name,
{
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
((
flags
&
XATTR_KERNEL_CONTEXT
)
||
capable
(
CAP_SYS_ADMIN
)
))
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EPERM
;
return
ext3_xattr_set
(
inode
,
EXT3_XATTR_INDEX_TRUSTED
,
name
,
value
,
size
,
flags
);
...
...
fs/ext3/xattr_user.c
View file @
3f614a3d
...
...
@@ -21,12 +21,11 @@
static
size_t
ext3_xattr_user_list
(
char
*
list
,
struct
inode
*
inode
,
const
char
*
name
,
int
name_len
,
int
flags
)
const
char
*
name
,
int
name_len
)
{
const
int
prefix_len
=
sizeof
(
XATTR_USER_PREFIX
)
-
1
;
if
(
!
(
flags
&
XATTR_KERNEL_CONTEXT
)
&&
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
0
;
if
(
list
)
{
...
...
@@ -39,13 +38,12 @@ ext3_xattr_user_list(char *list, struct inode *inode,
static
int
ext3_xattr_user_get
(
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
,
int
flags
)
void
*
buffer
,
size_t
size
)
{
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
(
flags
&
XATTR_KERNEL_CONTEXT
))
{
int
error
;
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
-
EOPNOTSUPP
;
#ifdef CONFIG_EXT3_FS_POSIX_ACL
...
...
@@ -55,25 +53,23 @@ ext3_xattr_user_get(struct inode *inode, const char *name,
#endif
if
(
error
)
return
error
;
}
return
ext3_xattr_get
(
inode
,
EXT3_XATTR_INDEX_USER
,
name
,
buffer
,
size
);
return
ext3_xattr_get
(
inode
,
EXT3_XATTR_INDEX_USER
,
name
,
buffer
,
size
);
}
static
int
ext3_xattr_user_set
(
struct
inode
*
inode
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
)
{
int
error
;
if
(
strcmp
(
name
,
""
)
==
0
)
return
-
EINVAL
;
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
-
EOPNOTSUPP
;
if
(
!
S_ISREG
(
inode
->
i_mode
)
&&
(
!
S_ISDIR
(
inode
->
i_mode
)
||
inode
->
i_mode
&
S_ISVTX
))
return
-
EPERM
;
if
(
!
(
flags
&
XATTR_KERNEL_CONTEXT
))
{
int
error
;
if
(
!
test_opt
(
inode
->
i_sb
,
XATTR_USER
))
return
-
EOPNOTSUPP
;
#ifdef CONFIG_EXT3_FS_POSIX_ACL
error
=
ext3_permission_locked
(
inode
,
MAY_WRITE
);
#else
...
...
@@ -81,7 +77,7 @@ ext3_xattr_user_set(struct inode *inode, const char *name,
#endif
if
(
error
)
return
error
;
}
return
ext3_xattr_set
(
inode
,
EXT3_XATTR_INDEX_USER
,
name
,
value
,
size
,
flags
);
}
...
...
fs/jfs/jfs_xattr.h
View file @
3f614a3d
...
...
@@ -57,8 +57,8 @@ extern int __jfs_setxattr(struct inode *, const char *, const void *, size_t,
extern
int
jfs_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
extern
ssize_t
__jfs_getxattr
(
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
jfs_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
,
int
);
extern
ssize_t
jfs_listxattr
(
struct
dentry
*
,
char
*
,
size_t
,
int
);
extern
int
jfs_removexattr
(
struct
dentry
*
,
const
char
*
,
int
);
extern
ssize_t
jfs_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
jfs_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
int
jfs_removexattr
(
struct
dentry
*
,
const
char
*
);
#endif
/* H_JFS_XATTR */
fs/jfs/xattr.c
View file @
3f614a3d
...
...
@@ -962,13 +962,12 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
}
ssize_t
jfs_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
data
,
size_t
buf_size
,
int
flags
)
size_t
buf_size
)
{
return
__jfs_getxattr
(
dentry
->
d_inode
,
name
,
data
,
buf_size
);
}
ssize_t
jfs_listxattr
(
struct
dentry
*
dentry
,
char
*
data
,
size_t
buf_size
,
int
flags
)
ssize_t
jfs_listxattr
(
struct
dentry
*
dentry
,
char
*
data
,
size_t
buf_size
)
{
struct
inode
*
inode
=
dentry
->
d_inode
;
char
*
buffer
;
...
...
@@ -1014,7 +1013,7 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size,
return
size
;
}
int
jfs_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
flags
)
int
jfs_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
)
{
return
__jfs_setxattr
(
dentry
->
d_inode
,
name
,
0
,
0
,
XATTR_REPLACE
);
}
fs/xattr.c
View file @
3f614a3d
...
...
@@ -160,7 +160,7 @@ getxattr(struct dentry *d, char *name, void *value, size_t size)
if
(
error
)
goto
out
;
down
(
&
d
->
d_inode
->
i_sem
);
error
=
d
->
d_inode
->
i_op
->
getxattr
(
d
,
kname
,
kvalue
,
size
,
0
);
error
=
d
->
d_inode
->
i_op
->
getxattr
(
d
,
kname
,
kvalue
,
size
);
up
(
&
d
->
d_inode
->
i_sem
);
}
...
...
@@ -233,7 +233,7 @@ listxattr(struct dentry *d, char *list, size_t size)
if
(
error
)
goto
out
;
down
(
&
d
->
d_inode
->
i_sem
);
error
=
d
->
d_inode
->
i_op
->
listxattr
(
d
,
klist
,
size
,
0
);
error
=
d
->
d_inode
->
i_op
->
listxattr
(
d
,
klist
,
size
);
up
(
&
d
->
d_inode
->
i_sem
);
}
...
...
@@ -308,7 +308,7 @@ removexattr(struct dentry *d, char *name)
if
(
error
)
goto
out
;
down
(
&
d
->
d_inode
->
i_sem
);
error
=
d
->
d_inode
->
i_op
->
removexattr
(
d
,
kname
,
0
);
error
=
d
->
d_inode
->
i_op
->
removexattr
(
d
,
kname
);
up
(
&
d
->
d_inode
->
i_sem
);
}
out:
...
...
fs/xfs/linux/xfs_iops.c
View file @
3f614a3d
...
...
@@ -640,8 +640,7 @@ linvfs_getxattr(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
data
,
size_t
size
,
int
flags
)
size_t
size
)
{
ssize_t
error
;
int
xflags
=
0
;
...
...
@@ -698,8 +697,7 @@ STATIC ssize_t
linvfs_listxattr
(
struct
dentry
*
dentry
,
char
*
data
,
size_t
size
,
int
flags
)
size_t
size
)
{
ssize_t
error
;
int
result
=
0
;
...
...
@@ -743,8 +741,7 @@ linvfs_listxattr(
STATIC
int
linvfs_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
flags
)
const
char
*
name
)
{
int
error
;
int
xflags
=
0
;
...
...
include/linux/fs.h
View file @
3f614a3d
...
...
@@ -743,9 +743,9 @@ struct inode_operations {
int
(
*
setattr
)
(
struct
dentry
*
,
struct
iattr
*
);
int
(
*
getattr
)
(
struct
vfsmount
*
mnt
,
struct
dentry
*
,
struct
kstat
*
);
int
(
*
setxattr
)
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
ssize_t
(
*
getxattr
)
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
,
int
);
ssize_t
(
*
listxattr
)
(
struct
dentry
*
,
char
*
,
size_t
,
int
);
int
(
*
removexattr
)
(
struct
dentry
*
,
const
char
*
,
int
);
ssize_t
(
*
getxattr
)
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
ssize_t
(
*
listxattr
)
(
struct
dentry
*
,
char
*
,
size_t
);
int
(
*
removexattr
)
(
struct
dentry
*
,
const
char
*
);
};
struct
seq_file
;
...
...
include/linux/xattr.h
View file @
3f614a3d
...
...
@@ -9,8 +9,7 @@
#ifndef _LINUX_XATTR_H
#define _LINUX_XATTR_H
#define XATTR_CREATE 0x1
/* fail if attr already exists */
#define XATTR_REPLACE 0x2
/* fail if attr does not exist */
#define XATTR_KERNEL_CONTEXT 0x4
/* called from kernel context */
#define XATTR_CREATE 0x1
/* set value, fail if attr already exists */
#define XATTR_REPLACE 0x2
/* set value, fail if attr does not exist */
#endif
/* _LINUX_XATTR_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment