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
dc950d2b
Commit
dc950d2b
authored
Oct 01, 2004
by
Nathan Scott
Browse files
Options
Browse Files
Download
Plain Diff
Merge sgi.com:/source2/linux-2.6 into sgi.com:/source2/xfs-linux-2.6
parents
46b043ef
858f38c0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
297 deletions
+24
-297
fs/xfs/Makefile
fs/xfs/Makefile
+0
-2
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_aops.c
+19
-12
fs/xfs/xfs_cap.c
fs/xfs/xfs_cap.c
+0
-206
fs/xfs/xfs_mac.c
fs/xfs/xfs_mac.c
+0
-72
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.c
+5
-5
No files found.
fs/xfs/Makefile
View file @
dc950d2b
...
@@ -67,8 +67,6 @@ endif
...
@@ -67,8 +67,6 @@ endif
xfs-$(CONFIG_XFS_RT)
+=
xfs_rtalloc.o
xfs-$(CONFIG_XFS_RT)
+=
xfs_rtalloc.o
xfs-$(CONFIG_XFS_POSIX_ACL)
+=
xfs_acl.o
xfs-$(CONFIG_XFS_POSIX_ACL)
+=
xfs_acl.o
xfs-$(CONFIG_XFS_POSIX_CAP)
+=
xfs_cap.o
xfs-$(CONFIG_XFS_POSIX_MAC)
+=
xfs_mac.o
xfs-$(CONFIG_PROC_FS)
+=
linux-2.6/xfs_stats.o
xfs-$(CONFIG_PROC_FS)
+=
linux-2.6/xfs_stats.o
xfs-$(CONFIG_SYSCTL)
+=
linux-2.6/xfs_sysctl.o
xfs-$(CONFIG_SYSCTL)
+=
linux-2.6/xfs_sysctl.o
xfs-$(CONFIG_COMPAT)
+=
linux-2.6/xfs_ioctl32.o
xfs-$(CONFIG_COMPAT)
+=
linux-2.6/xfs_ioctl32.o
...
...
fs/xfs/linux-2.6/xfs_aops.c
View file @
dc950d2b
...
@@ -552,18 +552,21 @@ xfs_submit_page(
...
@@ -552,18 +552,21 @@ xfs_submit_page(
struct
page
*
page
,
struct
page
*
page
,
struct
writeback_control
*
wbc
,
struct
writeback_control
*
wbc
,
struct
buffer_head
*
bh_arr
[],
struct
buffer_head
*
bh_arr
[],
int
cnt
)
int
bh_count
,
int
probed_page
,
int
clear_dirty
)
{
{
struct
buffer_head
*
bh
;
struct
buffer_head
*
bh
;
int
i
;
int
i
;
BUG_ON
(
PageWriteback
(
page
));
BUG_ON
(
PageWriteback
(
page
));
set_page_writeback
(
page
);
set_page_writeback
(
page
);
if
(
clear_dirty
)
clear_page_dirty
(
page
);
clear_page_dirty
(
page
);
unlock_page
(
page
);
unlock_page
(
page
);
if
(
c
nt
)
{
if
(
bh_cou
nt
)
{
for
(
i
=
0
;
i
<
c
nt
;
i
++
)
{
for
(
i
=
0
;
i
<
bh_cou
nt
;
i
++
)
{
bh
=
bh_arr
[
i
];
bh
=
bh_arr
[
i
];
mark_buffer_async_write
(
bh
);
mark_buffer_async_write
(
bh
);
if
(
buffer_unwritten
(
bh
))
if
(
buffer_unwritten
(
bh
))
...
@@ -572,8 +575,11 @@ xfs_submit_page(
...
@@ -572,8 +575,11 @@ xfs_submit_page(
clear_buffer_dirty
(
bh
);
clear_buffer_dirty
(
bh
);
}
}
for
(
i
=
0
;
i
<
c
nt
;
i
++
)
for
(
i
=
0
;
i
<
bh_cou
nt
;
i
++
)
submit_bh
(
WRITE
,
bh_arr
[
i
]);
submit_bh
(
WRITE
,
bh_arr
[
i
]);
if
(
probed_page
&&
clear_dirty
)
wbc
->
nr_to_write
--
;
/* Wrote an "extra" page */
}
else
{
}
else
{
end_page_writeback
(
page
);
end_page_writeback
(
page
);
wbc
->
pages_skipped
++
;
/* We didn't write this page */
wbc
->
pages_skipped
++
;
/* We didn't write this page */
...
@@ -612,11 +618,13 @@ xfs_convert_page(
...
@@ -612,11 +618,13 @@ xfs_convert_page(
bh
=
head
=
page_buffers
(
page
);
bh
=
head
=
page_buffers
(
page
);
do
{
do
{
offset
=
i
<<
bbits
;
offset
=
i
<<
bbits
;
if
(
offset
>=
end
)
break
;
if
(
!
(
PageUptodate
(
page
)
||
buffer_uptodate
(
bh
)))
if
(
!
(
PageUptodate
(
page
)
||
buffer_uptodate
(
bh
)))
continue
;
continue
;
if
(
buffer_mapped
(
bh
)
&&
all_bh
&&
if
(
buffer_mapped
(
bh
)
&&
all_bh
&&
!
buffer_unwritten
(
bh
)
&&
!
buffer_delay
(
bh
))
{
!
(
buffer_unwritten
(
bh
)
||
buffer_delay
(
bh
)
))
{
if
(
startio
&&
(
offset
<
end
)
)
{
if
(
startio
)
{
lock_buffer
(
bh
);
lock_buffer
(
bh
);
bh_arr
[
index
++
]
=
bh
;
bh_arr
[
index
++
]
=
bh
;
}
}
...
@@ -644,7 +652,7 @@ xfs_convert_page(
...
@@ -644,7 +652,7 @@ xfs_convert_page(
ASSERT
(
private
);
ASSERT
(
private
);
}
}
}
}
if
(
startio
&&
(
offset
<
end
)
)
{
if
(
startio
)
{
bh_arr
[
index
++
]
=
bh
;
bh_arr
[
index
++
]
=
bh
;
}
else
{
}
else
{
set_buffer_dirty
(
bh
);
set_buffer_dirty
(
bh
);
...
@@ -654,8 +662,7 @@ xfs_convert_page(
...
@@ -654,8 +662,7 @@ xfs_convert_page(
}
while
(
i
++
,
(
bh
=
bh
->
b_this_page
)
!=
head
);
}
while
(
i
++
,
(
bh
=
bh
->
b_this_page
)
!=
head
);
if
(
startio
)
{
if
(
startio
)
{
wbc
->
nr_to_write
--
;
xfs_submit_page
(
page
,
wbc
,
bh_arr
,
index
,
1
,
index
==
i
);
xfs_submit_page
(
page
,
wbc
,
bh_arr
,
index
);
}
else
{
}
else
{
unlock_page
(
page
);
unlock_page
(
page
);
}
}
...
@@ -867,7 +874,7 @@ xfs_page_state_convert(
...
@@ -867,7 +874,7 @@ xfs_page_state_convert(
SetPageUptodate
(
page
);
SetPageUptodate
(
page
);
if
(
startio
)
if
(
startio
)
xfs_submit_page
(
page
,
wbc
,
bh_arr
,
cnt
);
xfs_submit_page
(
page
,
wbc
,
bh_arr
,
cnt
,
0
,
1
);
if
(
iomp
)
{
if
(
iomp
)
{
tlast
=
(
iomp
->
iomap_offset
+
iomp
->
iomap_bsize
-
1
)
>>
tlast
=
(
iomp
->
iomap_offset
+
iomp
->
iomap_bsize
-
1
)
>>
...
@@ -1174,7 +1181,7 @@ linvfs_writepage(
...
@@ -1174,7 +1181,7 @@ linvfs_writepage(
return
0
;
return
0
;
out_fail:
out_fail:
set_page_dirty
(
page
);
redirty_page_for_writepage
(
wbc
,
page
);
unlock_page
(
page
);
unlock_page
(
page
);
return
0
;
return
0
;
out_unlock:
out_unlock:
...
...
fs/xfs/xfs_cap.c
deleted
100644 → 0
View file @
46b043ef
/*
* Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
#include "xfs.h"
STATIC
int
xfs_cap_allow_set
(
vnode_t
*
);
/*
* Test for existence of capability attribute as efficiently as possible.
*/
int
xfs_cap_vhascap
(
vnode_t
*
vp
)
{
int
error
;
int
len
=
sizeof
(
xfs_cap_set_t
);
int
flags
=
ATTR_KERNOVAL
|
ATTR_ROOT
;
VOP_ATTR_GET
(
vp
,
SGI_CAP_LINUX
,
NULL
,
&
len
,
flags
,
sys_cred
,
error
);
return
(
error
==
0
);
}
/*
* Convert from extended attribute representation to in-memory for XFS.
*/
STATIC
int
posix_cap_xattr_to_xfs
(
posix_cap_xattr
*
src
,
size_t
size
,
xfs_cap_set_t
*
dest
)
{
if
(
!
src
||
!
dest
)
return
EINVAL
;
if
(
src
->
c_version
!=
cpu_to_le32
(
POSIX_CAP_XATTR_VERSION
))
return
EINVAL
;
if
(
src
->
c_abiversion
!=
cpu_to_le32
(
_LINUX_CAPABILITY_VERSION
))
return
EINVAL
;
if
(
size
<
sizeof
(
posix_cap_xattr
))
return
EINVAL
;
ASSERT
(
sizeof
(
dest
->
cap_effective
)
==
sizeof
(
src
->
c_effective
));
dest
->
cap_effective
=
src
->
c_effective
;
dest
->
cap_permitted
=
src
->
c_permitted
;
dest
->
cap_inheritable
=
src
->
c_inheritable
;
return
0
;
}
/*
* Convert from in-memory XFS to extended attribute representation.
*/
STATIC
int
posix_cap_xfs_to_xattr
(
xfs_cap_set_t
*
src
,
posix_cap_xattr
*
xattr_cap
,
size_t
size
)
{
size_t
new_size
=
posix_cap_xattr_size
();
if
(
size
<
new_size
)
return
-
ERANGE
;
ASSERT
(
sizeof
(
xattr_cap
->
c_effective
)
==
sizeof
(
src
->
cap_effective
));
xattr_cap
->
c_version
=
cpu_to_le32
(
POSIX_CAP_XATTR_VERSION
);
xattr_cap
->
c_abiversion
=
cpu_to_le32
(
_LINUX_CAPABILITY_VERSION
);
xattr_cap
->
c_effective
=
src
->
cap_effective
;
xattr_cap
->
c_permitted
=
src
->
cap_permitted
;
xattr_cap
->
c_inheritable
=
src
->
cap_inheritable
;
return
new_size
;
}
int
xfs_cap_vget
(
vnode_t
*
vp
,
void
*
cap
,
size_t
size
)
{
int
error
;
int
len
=
sizeof
(
xfs_cap_set_t
);
int
flags
=
ATTR_ROOT
;
xfs_cap_set_t
xfs_cap
=
{
0
};
posix_cap_xattr
*
xattr_cap
=
cap
;
char
*
data
=
(
char
*
)
&
xfs_cap
;
VN_HOLD
(
vp
);
if
((
error
=
_MAC_VACCESS
(
vp
,
NULL
,
VREAD
)))
goto
out
;
if
(
!
size
)
{
flags
|=
ATTR_KERNOVAL
;
data
=
NULL
;
}
VOP_ATTR_GET
(
vp
,
SGI_CAP_LINUX
,
data
,
&
len
,
flags
,
sys_cred
,
error
);
if
(
error
)
goto
out
;
ASSERT
(
len
==
sizeof
(
xfs_cap_set_t
));
error
=
(
size
)
?
-
posix_cap_xattr_size
()
:
-
posix_cap_xfs_to_xattr
(
&
xfs_cap
,
xattr_cap
,
size
);
out:
VN_RELE
(
vp
);
return
-
error
;
}
int
xfs_cap_vremove
(
vnode_t
*
vp
)
{
int
error
;
VN_HOLD
(
vp
);
error
=
xfs_cap_allow_set
(
vp
);
if
(
!
error
)
{
VOP_ATTR_REMOVE
(
vp
,
SGI_CAP_LINUX
,
ATTR_ROOT
,
sys_cred
,
error
);
if
(
error
==
ENOATTR
)
error
=
0
;
/* 'scool */
}
VN_RELE
(
vp
);
return
-
error
;
}
int
xfs_cap_vset
(
vnode_t
*
vp
,
void
*
cap
,
size_t
size
)
{
posix_cap_xattr
*
xattr_cap
=
cap
;
xfs_cap_set_t
xfs_cap
;
int
error
;
if
(
!
cap
)
return
-
EINVAL
;
error
=
posix_cap_xattr_to_xfs
(
xattr_cap
,
size
,
&
xfs_cap
);
if
(
error
)
return
-
error
;
VN_HOLD
(
vp
);
error
=
xfs_cap_allow_set
(
vp
);
if
(
error
)
goto
out
;
VOP_ATTR_SET
(
vp
,
SGI_CAP_LINUX
,
(
char
*
)
&
xfs_cap
,
sizeof
(
xfs_cap_set_t
),
ATTR_ROOT
,
sys_cred
,
error
);
out:
VN_RELE
(
vp
);
return
-
error
;
}
STATIC
int
xfs_cap_allow_set
(
vnode_t
*
vp
)
{
vattr_t
va
;
int
error
;
if
(
vp
->
v_vfsp
->
vfs_flag
&
VFS_RDONLY
)
return
EROFS
;
if
(
vp
->
v_inode
.
i_flags
&
(
S_IMMUTABLE
|
S_APPEND
))
return
EPERM
;
if
((
error
=
_MAC_VACCESS
(
vp
,
NULL
,
VWRITE
)))
return
error
;
va
.
va_mask
=
XFS_AT_UID
;
VOP_GETATTR
(
vp
,
&
va
,
0
,
NULL
,
error
);
if
(
error
)
return
error
;
if
(
va
.
va_uid
!=
current
->
fsuid
&&
!
capable
(
CAP_FOWNER
))
return
EPERM
;
return
error
;
}
fs/xfs/xfs_mac.c
deleted
100644 → 0
View file @
46b043ef
/*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
#include "xfs.h"
static
xfs_mac_label_t
*
mac_low_high_lp
;
static
xfs_mac_label_t
*
mac_high_low_lp
;
static
xfs_mac_label_t
*
mac_admin_high_lp
;
static
xfs_mac_label_t
*
mac_equal_equal_lp
;
/*
* Test for the existence of a MAC label as efficiently as possible.
*/
int
xfs_mac_vhaslabel
(
vnode_t
*
vp
)
{
int
error
;
int
len
=
sizeof
(
xfs_mac_label_t
);
int
flags
=
ATTR_KERNOVAL
|
ATTR_ROOT
;
VOP_ATTR_GET
(
vp
,
SGI_MAC_FILE
,
NULL
,
&
len
,
flags
,
sys_cred
,
error
);
return
(
error
==
0
);
}
int
xfs_mac_iaccess
(
xfs_inode_t
*
ip
,
mode_t
mode
,
struct
cred
*
cr
)
{
xfs_mac_label_t
mac
;
xfs_mac_label_t
*
mp
=
mac_high_low_lp
;
if
(
cr
==
NULL
||
sys_cred
==
NULL
)
{
return
EACCES
;
}
if
(
xfs_attr_fetch
(
ip
,
SGI_MAC_FILE
,
(
char
*
)
&
mac
,
sizeof
(
mac
))
==
0
)
{
if
((
mp
=
mac_add_label
(
&
mac
))
==
NULL
)
{
return
mac_access
(
mac_high_low_lp
,
cr
,
mode
);
}
}
return
mac_access
(
mp
,
cr
,
mode
);
}
fs/xfs/xfs_vnodeops.c
View file @
dc950d2b
...
@@ -841,18 +841,18 @@ xfs_setattr(
...
@@ -841,18 +841,18 @@ xfs_setattr(
if
(
vap
->
va_xflags
&
XFS_XFLAG_NODUMP
)
if
(
vap
->
va_xflags
&
XFS_XFLAG_NODUMP
)
di_flags
|=
XFS_DIFLAG_NODUMP
;
di_flags
|=
XFS_DIFLAG_NODUMP
;
if
((
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
)
{
if
((
ip
->
i_d
.
di_mode
&
S_IFMT
)
==
S_IFDIR
)
{
if
(
vap
->
va_xflags
&
XFS_XFLAG_REALTIME
)
{
ip
->
i_iocore
.
io_flags
|=
XFS_IOCORE_RT
;
di_flags
|=
XFS_DIFLAG_REALTIME
;
}
if
(
vap
->
va_xflags
&
XFS_XFLAG_RTINHERIT
)
if
(
vap
->
va_xflags
&
XFS_XFLAG_RTINHERIT
)
di_flags
|=
XFS_DIFLAG_RTINHERIT
;
di_flags
|=
XFS_DIFLAG_RTINHERIT
;
if
(
vap
->
va_xflags
&
XFS_XFLAG_NOSYMLINKS
)
if
(
vap
->
va_xflags
&
XFS_XFLAG_NOSYMLINKS
)
di_flags
|=
XFS_DIFLAG_NOSYMLINKS
;
di_flags
|=
XFS_DIFLAG_NOSYMLINKS
;
}
else
{
}
else
{
if
(
!
(
vap
->
va_xflags
&
XFS_XFLAG_REALTIME
))
if
(
vap
->
va_xflags
&
XFS_XFLAG_REALTIME
)
{
di_flags
|=
XFS_DIFLAG_REALTIME
;
ip
->
i_iocore
.
io_flags
|=
XFS_IOCORE_RT
;
}
else
{
ip
->
i_iocore
.
io_flags
&=
~
XFS_IOCORE_RT
;
ip
->
i_iocore
.
io_flags
&=
~
XFS_IOCORE_RT
;
}
}
}
ip
->
i_d
.
di_flags
=
di_flags
;
ip
->
i_d
.
di_flags
=
di_flags
;
}
}
xfs_trans_log_inode
(
tp
,
ip
,
XFS_ILOG_CORE
);
xfs_trans_log_inode
(
tp
,
ip
,
XFS_ILOG_CORE
);
...
...
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