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
34187d9e
Commit
34187d9e
authored
May 22, 2004
by
Nathan Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Make uses of extended inode flags consistent, remove duplicated code.
SGI Modid: xfs-linux:xfs-kern:171450a
parent
8f299acd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
56 deletions
+57
-56
fs/xfs/linux/xfs_ioctl.c
fs/xfs/linux/xfs_ioctl.c
+22
-12
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.c
+28
-0
fs/xfs/xfs_inode.h
fs/xfs/xfs_inode.h
+3
-2
fs/xfs/xfs_itable.c
fs/xfs/xfs_itable.c
+1
-24
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.c
+3
-18
No files found.
fs/xfs/linux/xfs_ioctl.c
View file @
34187d9e
...
...
@@ -1049,6 +1049,25 @@ xfs_merge_ioc_xflags(
return
xflags
;
}
STATIC
unsigned
int
xfs_di2lxflags
(
__uint16_t
di_flags
)
{
unsigned
int
flags
=
0
;
if
(
di_flags
&
XFS_DIFLAG_IMMUTABLE
)
flags
|=
LINUX_XFLAG_IMMUTABLE
;
if
(
di_flags
&
XFS_DIFLAG_APPEND
)
flags
|=
LINUX_XFLAG_APPEND
;
if
(
di_flags
&
XFS_DIFLAG_SYNC
)
flags
|=
LINUX_XFLAG_SYNC
;
if
(
di_flags
&
XFS_DIFLAG_NOATIME
)
flags
|=
LINUX_XFLAG_NOATIME
;
if
(
di_flags
&
XFS_DIFLAG_NODUMP
)
flags
|=
LINUX_XFLAG_NODUMP
;
return
flags
;
}
STATIC
int
xfs_ioc_xattr
(
vnode_t
*
vp
,
...
...
@@ -1113,17 +1132,7 @@ xfs_ioc_xattr(
}
case
XFS_IOC_GETXFLAGS
:
{
flags
=
0
;
if
(
ip
->
i_d
.
di_flags
&
XFS_XFLAG_IMMUTABLE
)
flags
|=
LINUX_XFLAG_IMMUTABLE
;
if
(
ip
->
i_d
.
di_flags
&
XFS_XFLAG_APPEND
)
flags
|=
LINUX_XFLAG_APPEND
;
if
(
ip
->
i_d
.
di_flags
&
XFS_XFLAG_SYNC
)
flags
|=
LINUX_XFLAG_SYNC
;
if
(
ip
->
i_d
.
di_flags
&
XFS_XFLAG_NOATIME
)
flags
|=
LINUX_XFLAG_NOATIME
;
if
(
ip
->
i_d
.
di_flags
&
XFS_XFLAG_NODUMP
)
flags
|=
LINUX_XFLAG_NODUMP
;
flags
=
xfs_di2lxflags
(
ip
->
i_d
.
di_flags
);
if
(
copy_to_user
((
unsigned
int
*
)
arg
,
&
flags
,
sizeof
(
flags
)))
return
-
XFS_ERROR
(
EFAULT
);
return
0
;
...
...
@@ -1143,7 +1152,8 @@ xfs_ioc_xattr(
attr_flags
|=
ATTR_NONBLOCK
;
va
.
va_mask
=
XFS_AT_XFLAGS
;
va
.
va_xflags
=
xfs_merge_ioc_xflags
(
flags
,
ip
->
i_d
.
di_flags
);
va
.
va_xflags
=
xfs_merge_ioc_xflags
(
flags
,
xfs_dic2xflags
(
&
ip
->
i_d
,
ARCH_NOCONVERT
));
VOP_SETATTR
(
vp
,
&
va
,
attr_flags
,
NULL
,
error
);
if
(
!
error
)
...
...
fs/xfs/xfs_inode.c
View file @
34187d9e
...
...
@@ -854,6 +854,34 @@ xfs_xlate_dinode_core(
INT_XLATE
(
buf_core
->
di_gen
,
mem_core
->
di_gen
,
dir
,
arch
);
}
uint
xfs_dic2xflags
(
xfs_dinode_core_t
*
dic
,
xfs_arch_t
arch
)
{
__uint16_t
di_flags
;
uint
flags
=
0
;
di_flags
=
INT_GET
(
dic
->
di_flags
,
arch
);
if
(
di_flags
&
XFS_DIFLAG_REALTIME
)
flags
|=
XFS_XFLAG_REALTIME
;
if
(
di_flags
&
XFS_DIFLAG_PREALLOC
)
flags
|=
XFS_XFLAG_PREALLOC
;
if
(
di_flags
&
XFS_DIFLAG_IMMUTABLE
)
flags
|=
XFS_XFLAG_IMMUTABLE
;
if
(
di_flags
&
XFS_DIFLAG_APPEND
)
flags
|=
XFS_XFLAG_APPEND
;
if
(
di_flags
&
XFS_DIFLAG_SYNC
)
flags
|=
XFS_XFLAG_SYNC
;
if
(
di_flags
&
XFS_DIFLAG_NOATIME
)
flags
|=
XFS_XFLAG_NOATIME
;
if
(
di_flags
&
XFS_DIFLAG_NODUMP
)
flags
|=
XFS_XFLAG_NODUMP
;
if
(
XFS_CFORK_Q_ARCH
(
dic
,
arch
))
flags
|=
XFS_XFLAG_HASATTR
;
return
flags
;
}
/*
* Given a mount structure and an inode number, return a pointer
* to a newly allocated in-core inode coresponding to the given
...
...
fs/xfs/xfs_inode.h
View file @
34187d9e
...
...
@@ -503,8 +503,9 @@ int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int);
int
xfs_ialloc
(
struct
xfs_trans
*
,
xfs_inode_t
*
,
mode_t
,
nlink_t
,
xfs_dev_t
,
struct
cred
*
,
xfs_prid_t
,
int
,
struct
xfs_buf
**
,
boolean_t
*
,
xfs_inode_t
**
);
void
xfs_xlate_dinode_core
(
xfs_caddr_t
,
struct
xfs_dinode_core
*
,
int
,
xfs_arch_t
);
void
xfs_xlate_dinode_core
(
xfs_caddr_t
,
struct
xfs_dinode_core
*
,
int
,
xfs_arch_t
);
uint
xfs_dic2xflags
(
struct
xfs_dinode_core
*
,
xfs_arch_t
);
int
xfs_ifree
(
struct
xfs_trans
*
,
xfs_inode_t
*
,
struct
xfs_bmap_free
*
);
int
xfs_atruncate_start
(
xfs_inode_t
*
);
...
...
fs/xfs/xfs_itable.c
View file @
34187d9e
...
...
@@ -82,7 +82,6 @@ xfs_bulkstat_one(
xfs_dinode_core_t
*
dic
;
/* dinode core info pointer */
xfs_inode_t
*
ip
=
NULL
;
/* incore inode pointer */
xfs_arch_t
arch
;
/* these are set according to */
__uint16_t
di_flags
;
/* temp */
dip
=
(
xfs_dinode_t
*
)
dibuff
;
...
...
@@ -166,29 +165,7 @@ xfs_bulkstat_one(
buf
->
bs_mtime
.
tv_nsec
=
INT_GET
(
dic
->
di_mtime
.
t_nsec
,
arch
);
buf
->
bs_ctime
.
tv_sec
=
INT_GET
(
dic
->
di_ctime
.
t_sec
,
arch
);
buf
->
bs_ctime
.
tv_nsec
=
INT_GET
(
dic
->
di_ctime
.
t_nsec
,
arch
);
/*
* convert di_flags to bs_xflags.
*/
di_flags
=
INT_GET
(
dic
->
di_flags
,
arch
);
buf
->
bs_xflags
=
((
di_flags
&
XFS_DIFLAG_REALTIME
)
?
XFS_XFLAG_REALTIME
:
0
)
|
((
di_flags
&
XFS_DIFLAG_PREALLOC
)
?
XFS_XFLAG_PREALLOC
:
0
)
|
((
di_flags
&
XFS_DIFLAG_IMMUTABLE
)
?
XFS_XFLAG_IMMUTABLE
:
0
)
|
((
di_flags
&
XFS_DIFLAG_APPEND
)
?
XFS_XFLAG_APPEND
:
0
)
|
((
di_flags
&
XFS_DIFLAG_SYNC
)
?
XFS_XFLAG_SYNC
:
0
)
|
((
di_flags
&
XFS_DIFLAG_NOATIME
)
?
XFS_XFLAG_NOATIME
:
0
)
|
((
di_flags
&
XFS_DIFLAG_NODUMP
)
?
XFS_XFLAG_NODUMP
:
0
)
|
(
XFS_CFORK_Q_ARCH
(
dic
,
arch
)
?
XFS_XFLAG_HASATTR
:
0
);
buf
->
bs_xflags
=
xfs_dic2xflags
(
dic
,
arch
);
buf
->
bs_extsize
=
INT_GET
(
dic
->
di_extsize
,
arch
)
<<
mp
->
m_sb
.
sb_blocklog
;
buf
->
bs_extents
=
INT_GET
(
dic
->
di_nextents
,
arch
);
buf
->
bs_gen
=
INT_GET
(
dic
->
di_gen
,
arch
);
...
...
fs/xfs/xfs_vnodeops.c
View file @
34187d9e
...
...
@@ -246,25 +246,10 @@ xfs_getattr(
goto
all_done
;
/*
*
convert di_flags to xflags
*
Convert di_flags to xflags.
*/
vap
->
va_xflags
=
0
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_REALTIME
)
vap
->
va_xflags
|=
XFS_XFLAG_REALTIME
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_PREALLOC
)
vap
->
va_xflags
|=
XFS_XFLAG_PREALLOC
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_IMMUTABLE
)
vap
->
va_xflags
|=
XFS_XFLAG_IMMUTABLE
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_APPEND
)
vap
->
va_xflags
|=
XFS_XFLAG_APPEND
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_SYNC
)
vap
->
va_xflags
|=
XFS_XFLAG_SYNC
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_NOATIME
)
vap
->
va_xflags
|=
XFS_XFLAG_NOATIME
;
if
(
ip
->
i_d
.
di_flags
&
XFS_DIFLAG_NODUMP
)
vap
->
va_xflags
|=
XFS_XFLAG_NODUMP
;
if
(
XFS_IFORK_Q
(
ip
))
vap
->
va_xflags
|=
XFS_XFLAG_HASATTR
;
vap
->
va_xflags
=
xfs_dic2xflags
(
&
ip
->
i_d
,
ARCH_NOCONVERT
);
/*
* Exit for inode revalidate. See if any of the rest of
* the fields to be filled in are needed.
...
...
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