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
ce23e640
Commit
ce23e640
authored
Apr 11, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
->getxattr(): pass dentry and inode as separate arguments
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b296821a
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
94 additions
and
85 deletions
+94
-85
Documentation/filesystems/porting
Documentation/filesystems/porting
+6
-0
drivers/staging/lustre/lustre/llite/llite_internal.h
drivers/staging/lustre/lustre/llite/llite_internal.h
+2
-2
drivers/staging/lustre/lustre/llite/xattr.c
drivers/staging/lustre/lustre/llite/xattr.c
+2
-4
fs/bad_inode.c
fs/bad_inode.c
+2
-2
fs/ceph/super.h
fs/ceph/super.h
+1
-1
fs/ceph/xattr.c
fs/ceph/xattr.c
+4
-4
fs/cifs/cifsfs.h
fs/cifs/cifsfs.h
+1
-1
fs/cifs/xattr.c
fs/cifs/xattr.c
+3
-3
fs/ecryptfs/crypto.c
fs/ecryptfs/crypto.c
+4
-1
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/ecryptfs_kernel.h
+2
-2
fs/ecryptfs/inode.c
fs/ecryptfs/inode.c
+12
-11
fs/ecryptfs/mmap.c
fs/ecryptfs/mmap.c
+2
-1
fs/fuse/dir.c
fs/fuse/dir.c
+2
-3
fs/gfs2/inode.c
fs/gfs2/inode.c
+4
-5
fs/hfs/attr.c
fs/hfs/attr.c
+2
-3
fs/hfs/hfs_fs.h
fs/hfs/hfs_fs.h
+2
-2
fs/jfs/jfs_xattr.h
fs/jfs/jfs_xattr.h
+1
-1
fs/jfs/xattr.c
fs/jfs/xattr.c
+4
-4
fs/kernfs/inode.c
fs/kernfs/inode.c
+3
-3
fs/kernfs/kernfs-internal.h
fs/kernfs/kernfs-internal.h
+2
-2
fs/libfs.c
fs/libfs.c
+2
-2
fs/overlayfs/inode.c
fs/overlayfs/inode.c
+2
-2
fs/overlayfs/overlayfs.h
fs/overlayfs/overlayfs.h
+2
-2
fs/overlayfs/super.c
fs/overlayfs/super.c
+1
-1
fs/ubifs/ubifs.h
fs/ubifs/ubifs.h
+2
-2
fs/ubifs/xattr.c
fs/ubifs/xattr.c
+3
-3
fs/xattr.c
fs/xattr.c
+6
-5
include/linux/fs.h
include/linux/fs.h
+2
-1
include/linux/xattr.h
include/linux/xattr.h
+1
-1
net/socket.c
net/socket.c
+1
-1
security/commoncap.c
security/commoncap.c
+3
-3
security/integrity/evm/evm_main.c
security/integrity/evm/evm_main.c
+1
-1
security/selinux/hooks.c
security/selinux/hooks.c
+5
-4
security/smack/smack_lsm.c
security/smack/smack_lsm.c
+2
-2
No files found.
Documentation/filesystems/porting
View file @
ce23e640
...
@@ -525,3 +525,9 @@ in your dentry operations instead.
...
@@ -525,3 +525,9 @@ in your dentry operations instead.
set_delayed_call() where it used to set *cookie.
set_delayed_call() where it used to set *cookie.
->put_link() is gone - just give the destructor to set_delayed_call()
->put_link() is gone - just give the destructor to set_delayed_call()
in ->get_link().
in ->get_link().
--
[mandatory]
->getxattr() and xattr_handler.get() get dentry and inode passed separately.
dentry might be yet to be attached to inode, so do _not_ use its ->d_inode
in the instances. Rationale: !@#!@# security_d_instantiate() needs to be
called before we attach dentry to inode.
drivers/staging/lustre/lustre/llite/llite_internal.h
View file @
ce23e640
...
@@ -1042,8 +1042,8 @@ static inline __u64 ll_file_maxbytes(struct inode *inode)
...
@@ -1042,8 +1042,8 @@ static inline __u64 ll_file_maxbytes(struct inode *inode)
/* llite/xattr.c */
/* llite/xattr.c */
int
ll_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
ll_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
const
void
*
value
,
size_t
size
,
int
flags
);
ssize_t
ll_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
ssize_t
ll_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
buffer
,
size_t
size
);
const
char
*
name
,
void
*
buffer
,
size_t
size
);
ssize_t
ll_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
);
ssize_t
ll_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
);
int
ll_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
int
ll_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
...
...
drivers/staging/lustre/lustre/llite/xattr.c
View file @
ce23e640
...
@@ -451,11 +451,9 @@ int ll_getxattr_common(struct inode *inode, const char *name,
...
@@ -451,11 +451,9 @@ int ll_getxattr_common(struct inode *inode, const char *name,
return
rc
;
return
rc
;
}
}
ssize_t
ll_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
ssize_t
ll_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
buffer
,
size_t
size
)
const
char
*
name
,
void
*
buffer
,
size_t
size
)
{
{
struct
inode
*
inode
=
d_inode
(
dentry
);
LASSERT
(
inode
);
LASSERT
(
inode
);
LASSERT
(
name
);
LASSERT
(
name
);
...
...
fs/bad_inode.c
View file @
ce23e640
...
@@ -106,8 +106,8 @@ static int bad_inode_setxattr(struct dentry *dentry, const char *name,
...
@@ -106,8 +106,8 @@ static int bad_inode_setxattr(struct dentry *dentry, const char *name,
return
-
EIO
;
return
-
EIO
;
}
}
static
ssize_t
bad_inode_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
static
ssize_t
bad_inode_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
buffer
,
size_t
size
)
const
char
*
name
,
void
*
buffer
,
size_t
size
)
{
{
return
-
EIO
;
return
-
EIO
;
}
}
...
...
fs/ceph/super.h
View file @
ce23e640
...
@@ -795,7 +795,7 @@ extern int ceph_setxattr(struct dentry *, const char *, const void *,
...
@@ -795,7 +795,7 @@ extern int ceph_setxattr(struct dentry *, const char *, const void *,
int
__ceph_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
int
__ceph_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
ssize_t
__ceph_getxattr
(
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
ssize_t
__ceph_getxattr
(
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
int
__ceph_removexattr
(
struct
dentry
*
,
const
char
*
);
int
__ceph_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
ssize_t
ceph_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
ceph_getxattr
(
struct
dentry
*
,
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
ceph_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
ssize_t
ceph_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
int
ceph_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
int
ceph_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
void
__ceph_build_xattrs_blob
(
struct
ceph_inode_info
*
ci
);
extern
void
__ceph_build_xattrs_blob
(
struct
ceph_inode_info
*
ci
);
...
...
fs/ceph/xattr.c
View file @
ce23e640
...
@@ -804,13 +804,13 @@ ssize_t __ceph_getxattr(struct inode *inode, const char *name, void *value,
...
@@ -804,13 +804,13 @@ ssize_t __ceph_getxattr(struct inode *inode, const char *name, void *value,
return
err
;
return
err
;
}
}
ssize_t
ceph_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
valu
e
,
ssize_t
ceph_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
if
(
!
strncmp
(
name
,
XATTR_SYSTEM_PREFIX
,
XATTR_SYSTEM_PREFIX_LEN
))
if
(
!
strncmp
(
name
,
XATTR_SYSTEM_PREFIX
,
XATTR_SYSTEM_PREFIX_LEN
))
return
generic_getxattr
(
dentry
,
name
,
value
,
size
);
return
generic_getxattr
(
dentry
,
inode
,
name
,
value
,
size
);
return
__ceph_getxattr
(
d_inode
(
dentry
)
,
name
,
value
,
size
);
return
__ceph_getxattr
(
inode
,
name
,
value
,
size
);
}
}
ssize_t
ceph_listxattr
(
struct
dentry
*
dentry
,
char
*
names
,
size_t
size
)
ssize_t
ceph_listxattr
(
struct
dentry
*
dentry
,
char
*
names
,
size_t
size
)
...
...
fs/cifs/cifsfs.h
View file @
ce23e640
...
@@ -123,7 +123,7 @@ extern int cifs_symlink(struct inode *inode, struct dentry *direntry,
...
@@ -123,7 +123,7 @@ extern int cifs_symlink(struct inode *inode, struct dentry *direntry,
extern
int
cifs_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
int
cifs_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
int
cifs_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
extern
int
cifs_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
size_t
,
int
);
extern
ssize_t
cifs_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
cifs_getxattr
(
struct
dentry
*
,
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
cifs_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
ssize_t
cifs_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
long
cifs_ioctl
(
struct
file
*
filep
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
long
cifs_ioctl
(
struct
file
*
filep
,
unsigned
int
cmd
,
unsigned
long
arg
);
#ifdef CONFIG_CIFS_NFSD_EXPORT
#ifdef CONFIG_CIFS_NFSD_EXPORT
...
...
fs/cifs/xattr.c
View file @
ce23e640
...
@@ -213,8 +213,8 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
...
@@ -213,8 +213,8 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
return
rc
;
return
rc
;
}
}
ssize_t
cifs_getxattr
(
struct
dentry
*
direntry
,
const
char
*
ea_nam
e
,
ssize_t
cifs_getxattr
(
struct
dentry
*
direntry
,
struct
inode
*
inod
e
,
void
*
ea_value
,
size_t
buf_size
)
const
char
*
ea_name
,
void
*
ea_value
,
size_t
buf_size
)
{
{
ssize_t
rc
=
-
EOPNOTSUPP
;
ssize_t
rc
=
-
EOPNOTSUPP
;
#ifdef CONFIG_CIFS_XATTR
#ifdef CONFIG_CIFS_XATTR
...
@@ -296,7 +296,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
...
@@ -296,7 +296,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
goto
get_ea_exit
;
/* rc already EOPNOTSUPP */
goto
get_ea_exit
;
/* rc already EOPNOTSUPP */
pacl
=
pTcon
->
ses
->
server
->
ops
->
get_acl
(
cifs_sb
,
pacl
=
pTcon
->
ses
->
server
->
ops
->
get_acl
(
cifs_sb
,
d_inode
(
direntry
)
,
full_path
,
&
acllen
);
inode
,
full_path
,
&
acllen
);
if
(
IS_ERR
(
pacl
))
{
if
(
IS_ERR
(
pacl
))
{
rc
=
PTR_ERR
(
pacl
);
rc
=
PTR_ERR
(
pacl
);
cifs_dbg
(
VFS
,
"%s: error %zd getting sec desc
\n
"
,
cifs_dbg
(
VFS
,
"%s: error %zd getting sec desc
\n
"
,
...
...
fs/ecryptfs/crypto.c
View file @
ce23e640
...
@@ -1369,7 +1369,9 @@ int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode)
...
@@ -1369,7 +1369,9 @@ int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode)
ssize_t
size
;
ssize_t
size
;
int
rc
=
0
;
int
rc
=
0
;
size
=
ecryptfs_getxattr_lower
(
lower_dentry
,
ECRYPTFS_XATTR_NAME
,
size
=
ecryptfs_getxattr_lower
(
lower_dentry
,
ecryptfs_inode_to_lower
(
ecryptfs_inode
),
ECRYPTFS_XATTR_NAME
,
page_virt
,
ECRYPTFS_DEFAULT_EXTENT_SIZE
);
page_virt
,
ECRYPTFS_DEFAULT_EXTENT_SIZE
);
if
(
size
<
0
)
{
if
(
size
<
0
)
{
if
(
unlikely
(
ecryptfs_verbosity
>
0
))
if
(
unlikely
(
ecryptfs_verbosity
>
0
))
...
@@ -1391,6 +1393,7 @@ int ecryptfs_read_and_validate_xattr_region(struct dentry *dentry,
...
@@ -1391,6 +1393,7 @@ int ecryptfs_read_and_validate_xattr_region(struct dentry *dentry,
int
rc
;
int
rc
;
rc
=
ecryptfs_getxattr_lower
(
ecryptfs_dentry_to_lower
(
dentry
),
rc
=
ecryptfs_getxattr_lower
(
ecryptfs_dentry_to_lower
(
dentry
),
ecryptfs_inode_to_lower
(
inode
),
ECRYPTFS_XATTR_NAME
,
file_size
,
ECRYPTFS_XATTR_NAME
,
file_size
,
ECRYPTFS_SIZE_AND_MARKER_BYTES
);
ECRYPTFS_SIZE_AND_MARKER_BYTES
);
if
(
rc
<
ECRYPTFS_SIZE_AND_MARKER_BYTES
)
if
(
rc
<
ECRYPTFS_SIZE_AND_MARKER_BYTES
)
...
...
fs/ecryptfs/ecryptfs_kernel.h
View file @
ce23e640
...
@@ -607,8 +607,8 @@ ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
...
@@ -607,8 +607,8 @@ ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
unsigned
char
*
src
,
struct
dentry
*
ecryptfs_dentry
);
unsigned
char
*
src
,
struct
dentry
*
ecryptfs_dentry
);
int
ecryptfs_truncate
(
struct
dentry
*
dentry
,
loff_t
new_length
);
int
ecryptfs_truncate
(
struct
dentry
*
dentry
,
loff_t
new_length
);
ssize_t
ssize_t
ecryptfs_getxattr_lower
(
struct
dentry
*
lower_dentry
,
const
char
*
nam
e
,
ecryptfs_getxattr_lower
(
struct
dentry
*
lower_dentry
,
struct
inode
*
lower_inod
e
,
void
*
value
,
size_t
size
);
const
char
*
name
,
void
*
value
,
size_t
size
);
int
int
ecryptfs_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
ecryptfs_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
size_t
size
,
int
flags
);
...
...
fs/ecryptfs/inode.c
View file @
ce23e640
...
@@ -1033,29 +1033,30 @@ ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value,
...
@@ -1033,29 +1033,30 @@ ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value,
}
}
ssize_t
ssize_t
ecryptfs_getxattr_lower
(
struct
dentry
*
lower_dentry
,
const
char
*
nam
e
,
ecryptfs_getxattr_lower
(
struct
dentry
*
lower_dentry
,
struct
inode
*
lower_inod
e
,
void
*
value
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
int
rc
=
0
;
int
rc
=
0
;
if
(
!
d_inode
(
lower_dentry
)
->
i_op
->
getxattr
)
{
if
(
!
lower_inode
->
i_op
->
getxattr
)
{
rc
=
-
EOPNOTSUPP
;
rc
=
-
EOPNOTSUPP
;
goto
out
;
goto
out
;
}
}
inode_lock
(
d_inode
(
lower_dentry
)
);
inode_lock
(
lower_inode
);
rc
=
d_inode
(
lower_dentry
)
->
i_op
->
getxattr
(
lower_dentry
,
name
,
valu
e
,
rc
=
lower_inode
->
i_op
->
getxattr
(
lower_dentry
,
lower_inod
e
,
size
);
name
,
value
,
size
);
inode_unlock
(
d_inode
(
lower_dentry
)
);
inode_unlock
(
lower_inode
);
out:
out:
return
rc
;
return
rc
;
}
}
static
ssize_t
static
ssize_t
ecryptfs_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
valu
e
,
ecryptfs_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
return
ecryptfs_getxattr_lower
(
ecryptfs_dentry_to_lower
(
dentry
),
name
,
return
ecryptfs_getxattr_lower
(
ecryptfs_dentry_to_lower
(
dentry
),
value
,
size
);
ecryptfs_inode_to_lower
(
inode
),
name
,
value
,
size
);
}
}
static
ssize_t
static
ssize_t
...
...
fs/ecryptfs/mmap.c
View file @
ce23e640
...
@@ -436,7 +436,8 @@ static int ecryptfs_write_inode_size_to_xattr(struct inode *ecryptfs_inode)
...
@@ -436,7 +436,8 @@ static int ecryptfs_write_inode_size_to_xattr(struct inode *ecryptfs_inode)
goto
out
;
goto
out
;
}
}
inode_lock
(
lower_inode
);
inode_lock
(
lower_inode
);
size
=
lower_inode
->
i_op
->
getxattr
(
lower_dentry
,
ECRYPTFS_XATTR_NAME
,
size
=
lower_inode
->
i_op
->
getxattr
(
lower_dentry
,
lower_inode
,
ECRYPTFS_XATTR_NAME
,
xattr_virt
,
PAGE_CACHE_SIZE
);
xattr_virt
,
PAGE_CACHE_SIZE
);
if
(
size
<
0
)
if
(
size
<
0
)
size
=
8
;
size
=
8
;
...
...
fs/fuse/dir.c
View file @
ce23e640
...
@@ -1759,10 +1759,9 @@ static int fuse_setxattr(struct dentry *entry, const char *name,
...
@@ -1759,10 +1759,9 @@ static int fuse_setxattr(struct dentry *entry, const char *name,
return
err
;
return
err
;
}
}
static
ssize_t
fuse_getxattr
(
struct
dentry
*
entry
,
const
char
*
nam
e
,
static
ssize_t
fuse_getxattr
(
struct
dentry
*
entry
,
struct
inode
*
inod
e
,
void
*
value
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
struct
inode
*
inode
=
d_inode
(
entry
);
struct
fuse_conn
*
fc
=
get_fuse_conn
(
inode
);
struct
fuse_conn
*
fc
=
get_fuse_conn
(
inode
);
FUSE_ARGS
(
args
);
FUSE_ARGS
(
args
);
struct
fuse_getxattr_in
inarg
;
struct
fuse_getxattr_in
inarg
;
...
...
fs/gfs2/inode.c
View file @
ce23e640
...
@@ -1968,22 +1968,21 @@ static int gfs2_setxattr(struct dentry *dentry, const char *name,
...
@@ -1968,22 +1968,21 @@ static int gfs2_setxattr(struct dentry *dentry, const char *name,
return
ret
;
return
ret
;
}
}
static
ssize_t
gfs2_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
static
ssize_t
gfs2_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
data
,
size_t
size
)
const
char
*
name
,
void
*
data
,
size_t
size
)
{
{
struct
inode
*
inode
=
d_inode
(
dentry
);
struct
gfs2_inode
*
ip
=
GFS2_I
(
inode
);
struct
gfs2_inode
*
ip
=
GFS2_I
(
inode
);
struct
gfs2_holder
gh
;
struct
gfs2_holder
gh
;
int
ret
;
int
ret
;
/* For selinux during lookup */
/* For selinux during lookup */
if
(
gfs2_glock_is_locked_by_me
(
ip
->
i_gl
))
if
(
gfs2_glock_is_locked_by_me
(
ip
->
i_gl
))
return
generic_getxattr
(
dentry
,
name
,
data
,
size
);
return
generic_getxattr
(
dentry
,
inode
,
name
,
data
,
size
);
gfs2_holder_init
(
ip
->
i_gl
,
LM_ST_SHARED
,
LM_FLAG_ANY
,
&
gh
);
gfs2_holder_init
(
ip
->
i_gl
,
LM_ST_SHARED
,
LM_FLAG_ANY
,
&
gh
);
ret
=
gfs2_glock_nq
(
&
gh
);
ret
=
gfs2_glock_nq
(
&
gh
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
ret
=
generic_getxattr
(
dentry
,
name
,
data
,
size
);
ret
=
generic_getxattr
(
dentry
,
inode
,
name
,
data
,
size
);
gfs2_glock_dq
(
&
gh
);
gfs2_glock_dq
(
&
gh
);
}
}
gfs2_holder_uninit
(
&
gh
);
gfs2_holder_uninit
(
&
gh
);
...
...
fs/hfs/attr.c
View file @
ce23e640
...
@@ -56,10 +56,9 @@ int hfs_setxattr(struct dentry *dentry, const char *name,
...
@@ -56,10 +56,9 @@ int hfs_setxattr(struct dentry *dentry, const char *name,
return
res
;
return
res
;
}
}
ssize_t
hfs_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
ssize_t
hfs_getxattr
(
struct
dentry
*
unused
,
struct
inode
*
inod
e
,
void
*
value
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
struct
inode
*
inode
=
d_inode
(
dentry
);
struct
hfs_find_data
fd
;
struct
hfs_find_data
fd
;
hfs_cat_rec
rec
;
hfs_cat_rec
rec
;
struct
hfs_cat_file
*
file
;
struct
hfs_cat_file
*
file
;
...
...
fs/hfs/hfs_fs.h
View file @
ce23e640
...
@@ -213,8 +213,8 @@ extern void hfs_delete_inode(struct inode *);
...
@@ -213,8 +213,8 @@ extern void hfs_delete_inode(struct inode *);
/* attr.c */
/* attr.c */
extern
int
hfs_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
extern
int
hfs_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
const
void
*
value
,
size_t
size
,
int
flags
);
extern
ssize_t
hfs_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
extern
ssize_t
hfs_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
value
,
size_t
size
);
const
char
*
name
,
void
*
value
,
size_t
size
);
extern
ssize_t
hfs_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
);
extern
ssize_t
hfs_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
);
/* mdb.c */
/* mdb.c */
...
...
fs/jfs/jfs_xattr.h
View file @
ce23e640
...
@@ -57,7 +57,7 @@ extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *,
...
@@ -57,7 +57,7 @@ extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *,
extern
int
jfs_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
extern
int
jfs_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
int
);
extern
ssize_t
__jfs_getxattr
(
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
__jfs_getxattr
(
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
jfs_getxattr
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
jfs_getxattr
(
struct
dentry
*
,
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
extern
ssize_t
jfs_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
ssize_t
jfs_listxattr
(
struct
dentry
*
,
char
*
,
size_t
);
extern
int
jfs_removexattr
(
struct
dentry
*
,
const
char
*
);
extern
int
jfs_removexattr
(
struct
dentry
*
,
const
char
*
);
...
...
fs/jfs/xattr.c
View file @
ce23e640
...
@@ -933,8 +933,8 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
...
@@ -933,8 +933,8 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
return
size
;
return
size
;
}
}
ssize_t
jfs_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
data
,
ssize_t
jfs_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inode
,
size_t
buf_size
)
const
char
*
name
,
void
*
data
,
size_t
buf_size
)
{
{
int
err
;
int
err
;
...
@@ -944,7 +944,7 @@ ssize_t jfs_getxattr(struct dentry *dentry, const char *name, void *data,
...
@@ -944,7 +944,7 @@ ssize_t jfs_getxattr(struct dentry *dentry, const char *name, void *data,
* for it via sb->s_xattr.
* for it via sb->s_xattr.
*/
*/
if
(
!
strncmp
(
name
,
XATTR_SYSTEM_PREFIX
,
XATTR_SYSTEM_PREFIX_LEN
))
if
(
!
strncmp
(
name
,
XATTR_SYSTEM_PREFIX
,
XATTR_SYSTEM_PREFIX_LEN
))
return
generic_getxattr
(
dentry
,
name
,
data
,
buf_size
);
return
generic_getxattr
(
dentry
,
inode
,
name
,
data
,
buf_size
);
if
(
strncmp
(
name
,
XATTR_OS2_PREFIX
,
XATTR_OS2_PREFIX_LEN
)
==
0
)
{
if
(
strncmp
(
name
,
XATTR_OS2_PREFIX
,
XATTR_OS2_PREFIX_LEN
)
==
0
)
{
/*
/*
...
@@ -959,7 +959,7 @@ ssize_t jfs_getxattr(struct dentry *dentry, const char *name, void *data,
...
@@ -959,7 +959,7 @@ ssize_t jfs_getxattr(struct dentry *dentry, const char *name, void *data,
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
err
=
__jfs_getxattr
(
d_inode
(
dentry
)
,
name
,
data
,
buf_size
);
err
=
__jfs_getxattr
(
inode
,
name
,
data
,
buf_size
);
return
err
;
return
err
;
}
}
...
...
fs/kernfs/inode.c
View file @
ce23e640
...
@@ -208,10 +208,10 @@ int kernfs_iop_removexattr(struct dentry *dentry, const char *name)
...
@@ -208,10 +208,10 @@ int kernfs_iop_removexattr(struct dentry *dentry, const char *name)
return
simple_xattr_set
(
&
attrs
->
xattrs
,
name
,
NULL
,
0
,
XATTR_REPLACE
);
return
simple_xattr_set
(
&
attrs
->
xattrs
,
name
,
NULL
,
0
,
XATTR_REPLACE
);
}
}
ssize_t
kernfs_iop_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buf
,
ssize_t
kernfs_iop_getxattr
(
struct
dentry
*
unused
,
struct
inode
*
inode
,
size_t
size
)
const
char
*
name
,
void
*
buf
,
size_t
size
)
{
{
struct
kernfs_node
*
kn
=
dentry
->
d_fsdata
;
struct
kernfs_node
*
kn
=
inode
->
i_private
;
struct
kernfs_iattrs
*
attrs
;
struct
kernfs_iattrs
*
attrs
;
attrs
=
kernfs_iattrs
(
kn
);
attrs
=
kernfs_iattrs
(
kn
);
...
...
fs/kernfs/kernfs-internal.h
View file @
ce23e640
...
@@ -84,8 +84,8 @@ int kernfs_iop_getattr(struct vfsmount *mnt, struct dentry *dentry,
...
@@ -84,8 +84,8 @@ int kernfs_iop_getattr(struct vfsmount *mnt, struct dentry *dentry,
int
kernfs_iop_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
int
kernfs_iop_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
size_t
size
,
int
flags
);
int
kernfs_iop_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
int
kernfs_iop_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
ssize_t
kernfs_iop_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buf
,
ssize_t
kernfs_iop_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inode
,
size_t
size
);
const
char
*
name
,
void
*
buf
,
size_t
size
);
ssize_t
kernfs_iop_listxattr
(
struct
dentry
*
dentry
,
char
*
buf
,
size_t
size
);
ssize_t
kernfs_iop_listxattr
(
struct
dentry
*
dentry
,
char
*
buf
,
size_t
size
);
/*
/*
...
...
fs/libfs.c
View file @
ce23e640
...
@@ -1127,8 +1127,8 @@ static int empty_dir_setxattr(struct dentry *dentry, const char *name,
...
@@ -1127,8 +1127,8 @@ static int empty_dir_setxattr(struct dentry *dentry, const char *name,
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
static
ssize_t
empty_dir_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
static
ssize_t
empty_dir_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
value
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
...
...
fs/overlayfs/inode.c
View file @
ce23e640
...
@@ -246,8 +246,8 @@ static bool ovl_need_xattr_filter(struct dentry *dentry,
...
@@ -246,8 +246,8 @@ static bool ovl_need_xattr_filter(struct dentry *dentry,
return
false
;
return
false
;
}
}
ssize_t
ovl_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
ssize_t
ovl_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
value
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
struct
path
realpath
;
struct
path
realpath
;
enum
ovl_path_type
type
=
ovl_path_real
(
dentry
,
&
realpath
);
enum
ovl_path_type
type
=
ovl_path_real
(
dentry
,
&
realpath
);
...
...
fs/overlayfs/overlayfs.h
View file @
ce23e640
...
@@ -173,8 +173,8 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr);
...
@@ -173,8 +173,8 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr);
int
ovl_permission
(
struct
inode
*
inode
,
int
mask
);
int
ovl_permission
(
struct
inode
*
inode
,
int
mask
);
int
ovl_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
ovl_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
const
void
*
value
,
size_t
size
,
int
flags
);
ssize_t
ovl_getxattr
(
struct
dentry
*
dentry
,
const
char
*
nam
e
,
ssize_t
ovl_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inod
e
,
void
*
value
,
size_t
size
);
const
char
*
name
,
void
*
value
,
size_t
size
);
ssize_t
ovl_listxattr
(
struct
dentry
*
dentry
,
char
*
list
,
size_t
size
);
ssize_t
ovl_listxattr
(
struct
dentry
*
dentry
,
char
*
list
,
size_t
size
);
int
ovl_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
int
ovl_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
struct
inode
*
ovl_d_select_inode
(
struct
dentry
*
dentry
,
unsigned
file_flags
);
struct
inode
*
ovl_d_select_inode
(
struct
dentry
*
dentry
,
unsigned
file_flags
);
...
...
fs/overlayfs/super.c
View file @
ce23e640
...
@@ -274,7 +274,7 @@ static bool ovl_is_opaquedir(struct dentry *dentry)
...
@@ -274,7 +274,7 @@ static bool ovl_is_opaquedir(struct dentry *dentry)
if
(
!
S_ISDIR
(
inode
->
i_mode
)
||
!
inode
->
i_op
->
getxattr
)
if
(
!
S_ISDIR
(
inode
->
i_mode
)
||
!
inode
->
i_op
->
getxattr
)
return
false
;
return
false
;
res
=
inode
->
i_op
->
getxattr
(
dentry
,
OVL_XATTR_OPAQUE
,
&
val
,
1
);
res
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
OVL_XATTR_OPAQUE
,
&
val
,
1
);
if
(
res
==
1
&&
val
==
'y'
)
if
(
res
==
1
&&
val
==
'y'
)
return
true
;
return
true
;
...
...
fs/ubifs/ubifs.h
View file @
ce23e640
...
@@ -1734,8 +1734,8 @@ int ubifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
...
@@ -1734,8 +1734,8 @@ int ubifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
/* xattr.c */
/* xattr.c */
int
ubifs_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
int
ubifs_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
const
void
*
value
,
size_t
size
,
int
flags
);
ssize_t
ubifs_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buf
,
ssize_t
ubifs_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
host
,
size_t
size
);
const
char
*
name
,
void
*
buf
,
size_t
size
);
ssize_t
ubifs_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
);
ssize_t
ubifs_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
size
);
int
ubifs_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
int
ubifs_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
int
ubifs_init_security
(
struct
inode
*
dentry
,
struct
inode
*
inode
,
int
ubifs_init_security
(
struct
inode
*
dentry
,
struct
inode
*
inode
,
...
...
fs/ubifs/xattr.c
View file @
ce23e640
...
@@ -372,10 +372,10 @@ int ubifs_setxattr(struct dentry *dentry, const char *name,
...
@@ -372,10 +372,10 @@ int ubifs_setxattr(struct dentry *dentry, const char *name,
return
setxattr
(
d_inode
(
dentry
),
name
,
value
,
size
,
flags
);
return
setxattr
(
d_inode
(
dentry
),
name
,
value
,
size
,
flags
);
}
}
ssize_t
ubifs_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buf
,
ssize_t
ubifs_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
host
,
size_t
size
)
const
char
*
name
,
void
*
buf
,
size_t
size
)
{
{
struct
inode
*
inode
,
*
host
=
d_inode
(
dentry
)
;
struct
inode
*
inode
;
struct
ubifs_info
*
c
=
host
->
i_sb
->
s_fs_info
;
struct
ubifs_info
*
c
=
host
->
i_sb
->
s_fs_info
;
struct
qstr
nm
=
QSTR_INIT
(
name
,
strlen
(
name
));
struct
qstr
nm
=
QSTR_INIT
(
name
,
strlen
(
name
));
struct
ubifs_inode
*
ui
;
struct
ubifs_inode
*
ui
;
...
...
fs/xattr.c
View file @
ce23e640
...
@@ -192,7 +192,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
...
@@ -192,7 +192,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
if
(
!
inode
->
i_op
->
getxattr
)
if
(
!
inode
->
i_op
->
getxattr
)
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
error
=
inode
->
i_op
->
getxattr
(
dentry
,
name
,
NULL
,
0
);
error
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
name
,
NULL
,
0
);
if
(
error
<
0
)
if
(
error
<
0
)
return
error
;
return
error
;
...
@@ -203,7 +203,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
...
@@ -203,7 +203,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
memset
(
value
,
0
,
error
+
1
);
memset
(
value
,
0
,
error
+
1
);
}
}
error
=
inode
->
i_op
->
getxattr
(
dentry
,
name
,
value
,
error
);
error
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
name
,
value
,
error
);
*
xattr_value
=
value
;
*
xattr_value
=
value
;
return
error
;
return
error
;
}
}
...
@@ -236,7 +236,7 @@ vfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size)
...
@@ -236,7 +236,7 @@ vfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size)
}
}
nolsm:
nolsm:
if
(
inode
->
i_op
->
getxattr
)
if
(
inode
->
i_op
->
getxattr
)
error
=
inode
->
i_op
->
getxattr
(
dentry
,
name
,
value
,
size
);
error
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
name
,
value
,
size
);
else
else
error
=
-
EOPNOTSUPP
;
error
=
-
EOPNOTSUPP
;
...
@@ -691,14 +691,15 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name)
...
@@ -691,14 +691,15 @@ xattr_resolve_name(const struct xattr_handler **handlers, const char **name)
* Find the handler for the prefix and dispatch its get() operation.
* Find the handler for the prefix and dispatch its get() operation.
*/
*/
ssize_t
ssize_t
generic_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buffer
,
size_t
size
)
generic_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
)
{
{
const
struct
xattr_handler
*
handler
;
const
struct
xattr_handler
*
handler
;
handler
=
xattr_resolve_name
(
dentry
->
d_sb
->
s_xattr
,
&
name
);
handler
=
xattr_resolve_name
(
dentry
->
d_sb
->
s_xattr
,
&
name
);
if
(
IS_ERR
(
handler
))
if
(
IS_ERR
(
handler
))
return
PTR_ERR
(
handler
);
return
PTR_ERR
(
handler
);
return
handler
->
get
(
handler
,
dentry
,
d_inode
(
dentry
)
,
return
handler
->
get
(
handler
,
dentry
,
inode
,
name
,
buffer
,
size
);
name
,
buffer
,
size
);
}
}
...
...
include/linux/fs.h
View file @
ce23e640
...
@@ -1702,7 +1702,8 @@ struct inode_operations {
...
@@ -1702,7 +1702,8 @@ struct inode_operations {
int
(
*
setattr
)
(
struct
dentry
*
,
struct
iattr
*
);
int
(
*
setattr
)
(
struct
dentry
*
,
struct
iattr
*
);
int
(
*
getattr
)
(
struct
vfsmount
*
mnt
,
struct
dentry
*
,
struct
kstat
*
);
int
(
*
getattr
)
(
struct
vfsmount
*
mnt
,
struct
dentry
*
,
struct
kstat
*
);
int
(
*
setxattr
)
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
int
(
*
setxattr
)
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
ssize_t
(
*
getxattr
)
(
struct
dentry
*
,
const
char
*
,
void
*
,
size_t
);
ssize_t
(
*
getxattr
)
(
struct
dentry
*
,
struct
inode
*
,
const
char
*
,
void
*
,
size_t
);
ssize_t
(
*
listxattr
)
(
struct
dentry
*
,
char
*
,
size_t
);
ssize_t
(
*
listxattr
)
(
struct
dentry
*
,
char
*
,
size_t
);
int
(
*
removexattr
)
(
struct
dentry
*
,
const
char
*
);
int
(
*
removexattr
)
(
struct
dentry
*
,
const
char
*
);
int
(
*
fiemap
)(
struct
inode
*
,
struct
fiemap_extent_info
*
,
u64
start
,
int
(
*
fiemap
)(
struct
inode
*
,
struct
fiemap_extent_info
*
,
u64
start
,
...
...
include/linux/xattr.h
View file @
ce23e640
...
@@ -52,7 +52,7 @@ int __vfs_setxattr_noperm(struct dentry *, const char *, const void *, size_t, i
...
@@ -52,7 +52,7 @@ int __vfs_setxattr_noperm(struct dentry *, const char *, const void *, size_t, i
int
vfs_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
int
vfs_setxattr
(
struct
dentry
*
,
const
char
*
,
const
void
*
,
size_t
,
int
);
int
vfs_removexattr
(
struct
dentry
*
,
const
char
*
);
int
vfs_removexattr
(
struct
dentry
*
,
const
char
*
);
ssize_t
generic_getxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
void
*
buffer
,
size_t
size
);
ssize_t
generic_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inode
,
const
char
*
name
,
void
*
buffer
,
size_t
size
);
ssize_t
generic_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
buffer_size
);
ssize_t
generic_listxattr
(
struct
dentry
*
dentry
,
char
*
buffer
,
size_t
buffer_size
);
int
generic_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
int
generic_setxattr
(
struct
dentry
*
dentry
,
const
char
*
name
,
const
void
*
value
,
size_t
size
,
int
flags
);
int
generic_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
int
generic_removexattr
(
struct
dentry
*
dentry
,
const
char
*
name
);
...
...
net/socket.c
View file @
ce23e640
...
@@ -466,7 +466,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
...
@@ -466,7 +466,7 @@ static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
#define XATTR_SOCKPROTONAME_SUFFIX "sockprotoname"
#define XATTR_SOCKPROTONAME_SUFFIX "sockprotoname"
#define XATTR_NAME_SOCKPROTONAME (XATTR_SYSTEM_PREFIX XATTR_SOCKPROTONAME_SUFFIX)
#define XATTR_NAME_SOCKPROTONAME (XATTR_SYSTEM_PREFIX XATTR_SOCKPROTONAME_SUFFIX)
#define XATTR_NAME_SOCKPROTONAME_LEN (sizeof(XATTR_NAME_SOCKPROTONAME)-1)
#define XATTR_NAME_SOCKPROTONAME_LEN (sizeof(XATTR_NAME_SOCKPROTONAME)-1)
static
ssize_t
sockfs_getxattr
(
struct
dentry
*
dentry
,
static
ssize_t
sockfs_getxattr
(
struct
dentry
*
dentry
,
struct
inode
*
inode
,
const
char
*
name
,
void
*
value
,
size_t
size
)
const
char
*
name
,
void
*
value
,
size_t
size
)
{
{
const
char
*
proto_name
;
const
char
*
proto_name
;
...
...
security/commoncap.c
View file @
ce23e640
...
@@ -313,7 +313,7 @@ int cap_inode_need_killpriv(struct dentry *dentry)
...
@@ -313,7 +313,7 @@ int cap_inode_need_killpriv(struct dentry *dentry)
if
(
!
inode
->
i_op
->
getxattr
)
if
(
!
inode
->
i_op
->
getxattr
)
return
0
;
return
0
;
error
=
inode
->
i_op
->
getxattr
(
dentry
,
XATTR_NAME_CAPS
,
NULL
,
0
);
error
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
XATTR_NAME_CAPS
,
NULL
,
0
);
if
(
error
<=
0
)
if
(
error
<=
0
)
return
0
;
return
0
;
return
1
;
return
1
;
...
@@ -397,8 +397,8 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data
...
@@ -397,8 +397,8 @@ int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data
if
(
!
inode
||
!
inode
->
i_op
->
getxattr
)
if
(
!
inode
||
!
inode
->
i_op
->
getxattr
)
return
-
ENODATA
;
return
-
ENODATA
;
size
=
inode
->
i_op
->
getxattr
((
struct
dentry
*
)
dentry
,
XATTR_NAME_CAPS
,
&
caps
,
size
=
inode
->
i_op
->
getxattr
((
struct
dentry
*
)
dentry
,
inode
,
XATTR_CAPS_SZ
);
XATTR_NAME_CAPS
,
&
caps
,
XATTR_CAPS_SZ
);
if
(
size
==
-
ENODATA
||
size
==
-
EOPNOTSUPP
)
if
(
size
==
-
ENODATA
||
size
==
-
EOPNOTSUPP
)
/* no data, that's ok */
/* no data, that's ok */
return
-
ENODATA
;
return
-
ENODATA
;
...
...
security/integrity/evm/evm_main.c
View file @
ce23e640
...
@@ -82,7 +82,7 @@ static int evm_find_protected_xattrs(struct dentry *dentry)
...
@@ -82,7 +82,7 @@ static int evm_find_protected_xattrs(struct dentry *dentry)
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
for
(
xattr
=
evm_config_xattrnames
;
*
xattr
!=
NULL
;
xattr
++
)
{
for
(
xattr
=
evm_config_xattrnames
;
*
xattr
!=
NULL
;
xattr
++
)
{
error
=
inode
->
i_op
->
getxattr
(
dentry
,
*
xattr
,
NULL
,
0
);
error
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
*
xattr
,
NULL
,
0
);
if
(
error
<
0
)
{
if
(
error
<
0
)
{
if
(
error
==
-
ENODATA
)
if
(
error
==
-
ENODATA
)
continue
;
continue
;
...
...
security/selinux/hooks.c
View file @
ce23e640
...
@@ -506,7 +506,8 @@ static int sb_finish_set_opts(struct super_block *sb)
...
@@ -506,7 +506,8 @@ static int sb_finish_set_opts(struct super_block *sb)
rc
=
-
EOPNOTSUPP
;
rc
=
-
EOPNOTSUPP
;
goto
out
;
goto
out
;
}
}
rc
=
root_inode
->
i_op
->
getxattr
(
root
,
XATTR_NAME_SELINUX
,
NULL
,
0
);
rc
=
root_inode
->
i_op
->
getxattr
(
root
,
root_inode
,
XATTR_NAME_SELINUX
,
NULL
,
0
);
if
(
rc
<
0
&&
rc
!=
-
ENODATA
)
{
if
(
rc
<
0
&&
rc
!=
-
ENODATA
)
{
if
(
rc
==
-
EOPNOTSUPP
)
if
(
rc
==
-
EOPNOTSUPP
)
printk
(
KERN_WARNING
"SELinux: (dev %s, type "
printk
(
KERN_WARNING
"SELinux: (dev %s, type "
...
@@ -1412,13 +1413,13 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
...
@@ -1412,13 +1413,13 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
goto
out_unlock
;
goto
out_unlock
;
}
}
context
[
len
]
=
'\0'
;
context
[
len
]
=
'\0'
;
rc
=
inode
->
i_op
->
getxattr
(
dentry
,
XATTR_NAME_SELINUX
,
rc
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
XATTR_NAME_SELINUX
,
context
,
len
);
context
,
len
);
if
(
rc
==
-
ERANGE
)
{
if
(
rc
==
-
ERANGE
)
{
kfree
(
context
);
kfree
(
context
);
/* Need a larger buffer. Query for the right size. */
/* Need a larger buffer. Query for the right size. */
rc
=
inode
->
i_op
->
getxattr
(
dentry
,
XATTR_NAME_SELINUX
,
rc
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
XATTR_NAME_SELINUX
,
NULL
,
0
);
NULL
,
0
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
dput
(
dentry
);
dput
(
dentry
);
...
@@ -1432,7 +1433,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
...
@@ -1432,7 +1433,7 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
goto
out_unlock
;
goto
out_unlock
;
}
}
context
[
len
]
=
'\0'
;
context
[
len
]
=
'\0'
;
rc
=
inode
->
i_op
->
getxattr
(
dentry
,
rc
=
inode
->
i_op
->
getxattr
(
dentry
,
inode
,
XATTR_NAME_SELINUX
,
XATTR_NAME_SELINUX
,
context
,
len
);
context
,
len
);
}
}
...
...
security/smack/smack_lsm.c
View file @
ce23e640
...
@@ -272,7 +272,7 @@ static struct smack_known *smk_fetch(const char *name, struct inode *ip,
...
@@ -272,7 +272,7 @@ static struct smack_known *smk_fetch(const char *name, struct inode *ip,
if
(
buffer
==
NULL
)
if
(
buffer
==
NULL
)
return
ERR_PTR
(
-
ENOMEM
);
return
ERR_PTR
(
-
ENOMEM
);
rc
=
ip
->
i_op
->
getxattr
(
dp
,
name
,
buffer
,
SMK_LONGLABEL
);
rc
=
ip
->
i_op
->
getxattr
(
dp
,
ip
,
name
,
buffer
,
SMK_LONGLABEL
);
if
(
rc
<
0
)
if
(
rc
<
0
)
skp
=
ERR_PTR
(
rc
);
skp
=
ERR_PTR
(
rc
);
else
if
(
rc
==
0
)
else
if
(
rc
==
0
)
...
@@ -3519,7 +3519,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
...
@@ -3519,7 +3519,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
TRANS_TRUE
,
TRANS_TRUE_SIZE
,
TRANS_TRUE
,
TRANS_TRUE_SIZE
,
0
);
0
);
}
else
{
}
else
{
rc
=
inode
->
i_op
->
getxattr
(
dp
,
rc
=
inode
->
i_op
->
getxattr
(
dp
,
inode
,
XATTR_NAME_SMACKTRANSMUTE
,
trattr
,
XATTR_NAME_SMACKTRANSMUTE
,
trattr
,
TRANS_TRUE_SIZE
);
TRANS_TRUE_SIZE
);
if
(
rc
>=
0
&&
strncmp
(
trattr
,
TRANS_TRUE
,
if
(
rc
>=
0
&&
strncmp
(
trattr
,
TRANS_TRUE
,
...
...
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