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
nexedi
linux
Commits
40198cf1
Commit
40198cf1
authored
Apr 07, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] remove atomicIncWithWrap
SGI Modid: 2.5.x-xfs:slinx:143647a
parent
8f7d3b53
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
14 deletions
+25
-14
fs/xfs/linux/xfs_globals.c
fs/xfs/linux/xfs_globals.c
+0
-5
fs/xfs/linux/xfs_globals.h
fs/xfs/linux/xfs_globals.h
+0
-4
fs/xfs/support/ktrace.c
fs/xfs/support/ktrace.c
+6
-2
fs/xfs/xfs.h
fs/xfs/xfs.h
+0
-1
fs/xfs/xfs_ialloc.c
fs/xfs/xfs_ialloc.c
+17
-2
fs/xfs/xfs_mount.c
fs/xfs/xfs_mount.c
+1
-0
fs/xfs/xfs_mount.h
fs/xfs/xfs_mount.h
+1
-0
No files found.
fs/xfs/linux/xfs_globals.c
View file @
40198cf1
...
@@ -48,11 +48,6 @@ unsigned long xfs_physmem;
...
@@ -48,11 +48,6 @@ unsigned long xfs_physmem;
*/
*/
xfs_param_t
xfs_params
=
{
0
,
1
,
0
,
0
,
0
,
3
};
xfs_param_t
xfs_params
=
{
0
,
1
,
0
,
0
,
0
,
3
};
/*
* Used to serialize atomicIncWithWrap.
*/
spinlock_t
xfs_atomic_spin
=
SPIN_LOCK_UNLOCKED
;
/*
/*
* Global system credential structure.
* Global system credential structure.
*/
*/
...
...
fs/xfs/linux/xfs_globals.h
View file @
40198cf1
...
@@ -38,11 +38,7 @@
...
@@ -38,11 +38,7 @@
*/
*/
extern
uint64_t
xfs_panic_mask
;
/* set to cause more panics */
extern
uint64_t
xfs_panic_mask
;
/* set to cause more panics */
extern
unsigned
long
xfs_physmem
;
extern
unsigned
long
xfs_physmem
;
extern
spinlock_t
xfs_atomic_spin
;
extern
struct
cred
*
sys_cred
;
extern
struct
cred
*
sys_cred
;
#endif
/* __XFS_GLOBALS_H__ */
#endif
/* __XFS_GLOBALS_H__ */
fs/xfs/support/ktrace.c
View file @
40198cf1
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
#include "kmem.h"
#include "kmem.h"
#include "spin.h"
#include "spin.h"
#include "debug.h"
#include "debug.h"
#include "atomic.h"
#include "ktrace.h"
#include "ktrace.h"
#if (defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
#if (defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
...
@@ -181,6 +180,7 @@ ktrace_enter(
...
@@ -181,6 +180,7 @@ ktrace_enter(
void
*
val14
,
void
*
val14
,
void
*
val15
)
void
*
val15
)
{
{
static
lock_t
wrap_lock
=
SPIN_LOCK_UNLOCKED
;
int
index
;
int
index
;
ktrace_entry_t
*
ktep
;
ktrace_entry_t
*
ktep
;
...
@@ -189,7 +189,11 @@ ktrace_enter(
...
@@ -189,7 +189,11 @@ ktrace_enter(
/*
/*
* Grab an entry by pushing the index up to the next one.
* Grab an entry by pushing the index up to the next one.
*/
*/
index
=
atomicIncWithWrap
(
&
ktp
->
kt_index
,
ktp
->
kt_nentries
);
spin_lock
(
&
wrap_lock
);
index
=
ktp
->
kt_index
;
if
(
++
ktp
->
kt_index
==
ktp
->
kt_nentries
)
ktp
->
kt_index
=
0
;
spin_unlock
(
&
wrap_lock
);
if
(
!
ktp
->
kt_rollover
&&
index
==
ktp
->
kt_nentries
-
1
)
if
(
!
ktp
->
kt_rollover
&&
index
==
ktp
->
kt_nentries
-
1
)
ktp
->
kt_rollover
=
1
;
ktp
->
kt_rollover
=
1
;
...
...
fs/xfs/xfs.h
View file @
40198cf1
...
@@ -46,7 +46,6 @@
...
@@ -46,7 +46,6 @@
#include <support/ktrace.h>
#include <support/ktrace.h>
#include <support/mutex.h>
#include <support/mutex.h>
#include <support/sema.h>
#include <support/sema.h>
#include <support/atomic.h>
#include <support/debug.h>
#include <support/debug.h>
#include <support/move.h>
#include <support/move.h>
#include <support/uuid.h>
#include <support/uuid.h>
...
...
fs/xfs/xfs_ialloc.c
View file @
40198cf1
...
@@ -336,6 +336,21 @@ xfs_ialloc_ag_alloc(
...
@@ -336,6 +336,21 @@ xfs_ialloc_ag_alloc(
return
0
;
return
0
;
}
}
STATIC
__inline
xfs_agnumber_t
xfs_ialloc_next_ag
(
xfs_mount_t
*
mp
)
{
xfs_agnumber_t
agno
;
spin_lock
(
&
mp
->
m_agirotor_lock
);
agno
=
mp
->
m_agirotor
;
if
(
++
mp
->
m_agirotor
==
mp
->
m_maxagi
)
mp
->
m_agirotor
=
0
;
spin_unlock
(
&
mp
->
m_agirotor_lock
);
return
agno
;
}
/*
/*
* Select an allocation group to look for a free inode in, based on the parent
* Select an allocation group to look for a free inode in, based on the parent
* inode and then mode. Return the allocation group buffer.
* inode and then mode. Return the allocation group buffer.
...
@@ -366,7 +381,7 @@ xfs_ialloc_ag_select(
...
@@ -366,7 +381,7 @@ xfs_ialloc_ag_select(
mp
=
tp
->
t_mountp
;
mp
=
tp
->
t_mountp
;
agcount
=
mp
->
m_maxagi
;
agcount
=
mp
->
m_maxagi
;
if
(
S_ISDIR
(
mode
))
if
(
S_ISDIR
(
mode
))
pagno
=
atomicIncWithWrap
((
int
*
)
&
mp
->
m_agirotor
,
agcount
);
pagno
=
xfs_ialloc_next_ag
(
mp
);
else
{
else
{
pagno
=
XFS_INO_TO_AGNO
(
mp
,
parent
);
pagno
=
XFS_INO_TO_AGNO
(
mp
,
parent
);
if
(
pagno
>=
agcount
)
if
(
pagno
>=
agcount
)
...
@@ -394,7 +409,7 @@ xfs_ialloc_ag_select(
...
@@ -394,7 +409,7 @@ xfs_ialloc_ag_select(
agbp
=
NULL
;
agbp
=
NULL
;
if
(
!
pag
->
pagi_inodeok
)
{
if
(
!
pag
->
pagi_inodeok
)
{
atomicIncWithWrap
((
int
*
)
&
mp
->
m_agirotor
,
agcount
);
xfs_ialloc_next_ag
(
mp
);
goto
unlock_nextag
;
goto
unlock_nextag
;
}
}
...
...
fs/xfs/xfs_mount.c
View file @
40198cf1
...
@@ -509,6 +509,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp)
...
@@ -509,6 +509,7 @@ xfs_mount_common(xfs_mount_t *mp, xfs_sb_t *sbp)
int
i
;
int
i
;
mp
->
m_agfrotor
=
mp
->
m_agirotor
=
0
;
mp
->
m_agfrotor
=
mp
->
m_agirotor
=
0
;
spinlock_init
(
&
mp
->
m_agirotor_lock
,
"m_agirotor_lock"
);
mp
->
m_maxagi
=
mp
->
m_sb
.
sb_agcount
;
mp
->
m_maxagi
=
mp
->
m_sb
.
sb_agcount
;
mp
->
m_blkbit_log
=
sbp
->
sb_blocklog
+
XFS_NBBYLOG
;
mp
->
m_blkbit_log
=
sbp
->
sb_blocklog
+
XFS_NBBYLOG
;
mp
->
m_blkbb_log
=
sbp
->
sb_blocklog
-
BBSHIFT
;
mp
->
m_blkbb_log
=
sbp
->
sb_blocklog
-
BBSHIFT
;
...
...
fs/xfs/xfs_mount.h
View file @
40198cf1
...
@@ -291,6 +291,7 @@ typedef struct xfs_mount {
...
@@ -291,6 +291,7 @@ typedef struct xfs_mount {
int
m_bsize
;
/* fs logical block size */
int
m_bsize
;
/* fs logical block size */
xfs_agnumber_t
m_agfrotor
;
/* last ag where space found */
xfs_agnumber_t
m_agfrotor
;
/* last ag where space found */
xfs_agnumber_t
m_agirotor
;
/* last ag dir inode alloced */
xfs_agnumber_t
m_agirotor
;
/* last ag dir inode alloced */
lock_t
m_agirotor_lock
;
/* .. and lock protecting it */
xfs_agnumber_t
m_maxagi
;
/* highest inode alloc group */
xfs_agnumber_t
m_maxagi
;
/* highest inode alloc group */
int
m_ihsize
;
/* size of next field */
int
m_ihsize
;
/* size of next field */
struct
xfs_ihash
*
m_ihash
;
/* fs private inode hash table*/
struct
xfs_ihash
*
m_ihash
;
/* fs private inode hash table*/
...
...
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