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
78330667
Commit
78330667
authored
Sep 27, 2002
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XFS: XFS: Make pagebuf use the generic xfs ASSERT() instead of it's own assert()
Modid: 2.5.x-xfs:slinx:127736a
parent
6cd43d77
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
21 deletions
+13
-21
fs/xfs/pagebuf/page_buf.c
fs/xfs/pagebuf/page_buf.c
+7
-5
fs/xfs/pagebuf/page_buf_internal.h
fs/xfs/pagebuf/page_buf_internal.h
+0
-12
fs/xfs/pagebuf/page_buf_locking.c
fs/xfs/pagebuf/page_buf_locking.c
+6
-4
No files found.
fs/xfs/pagebuf/page_buf.c
View file @
78330667
...
@@ -58,7 +58,9 @@
...
@@ -58,7 +58,9 @@
#include <linux/sysctl.h>
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <support/debug.h>
#include <support/kmem.h>
#include <support/kmem.h>
#include "page_buf_internal.h"
#include "page_buf_internal.h"
#define SECTOR_SHIFT 9
#define SECTOR_SHIFT 9
...
@@ -547,8 +549,8 @@ _pagebuf_lookup_pages(
...
@@ -547,8 +549,8 @@ _pagebuf_lookup_pages(
}
else
if
(
!
PagePrivate
(
page
))
{
}
else
if
(
!
PagePrivate
(
page
))
{
unsigned
long
i
,
range
=
(
offset
+
nbytes
)
>>
SECTOR_SHIFT
;
unsigned
long
i
,
range
=
(
offset
+
nbytes
)
>>
SECTOR_SHIFT
;
assert
(
blocksize
<
PAGE_CACHE_SIZE
);
ASSERT
(
blocksize
<
PAGE_CACHE_SIZE
);
assert
(
!
(
pb
->
pb_flags
&
_PBF_PRIVATE_BH
));
ASSERT
(
!
(
pb
->
pb_flags
&
_PBF_PRIVATE_BH
));
/*
/*
* In this case page->private holds a bitmap
* In this case page->private holds a bitmap
* of uptodate sectors (512) within the page
* of uptodate sectors (512) within the page
...
@@ -1316,8 +1318,8 @@ bio_end_io_pagebuf(
...
@@ -1316,8 +1318,8 @@ bio_end_io_pagebuf(
}
else
if
(
!
PagePrivate
(
page
))
{
}
else
if
(
!
PagePrivate
(
page
))
{
unsigned
int
j
,
range
;
unsigned
int
j
,
range
;
assert
(
blocksize
<
PAGE_CACHE_SIZE
);
ASSERT
(
blocksize
<
PAGE_CACHE_SIZE
);
assert
(
!
(
pb
->
pb_flags
&
_PBF_PRIVATE_BH
));
ASSERT
(
!
(
pb
->
pb_flags
&
_PBF_PRIVATE_BH
));
range
=
(
bvec
->
bv_offset
+
bvec
->
bv_len
)
>>
SECTOR_SHIFT
;
range
=
(
bvec
->
bv_offset
+
bvec
->
bv_len
)
>>
SECTOR_SHIFT
;
for
(
j
=
bvec
->
bv_offset
>>
SECTOR_SHIFT
;
j
<
range
;
j
++
)
for
(
j
=
bvec
->
bv_offset
>>
SECTOR_SHIFT
;
j
<
range
;
j
++
)
...
@@ -1606,7 +1608,7 @@ pagebuf_iomove(
...
@@ -1606,7 +1608,7 @@ pagebuf_iomove(
while
(
cboff
<
boff
)
{
while
(
cboff
<
boff
)
{
pagebuf_segment
(
pb
,
&
cboff
,
&
page
,
&
cpoff
,
&
csize
);
pagebuf_segment
(
pb
,
&
cboff
,
&
page
,
&
cpoff
,
&
csize
);
assert
(((
csize
+
cpoff
)
<=
PAGE_CACHE_SIZE
));
ASSERT
(((
csize
+
cpoff
)
<=
PAGE_CACHE_SIZE
));
switch
(
mode
)
{
switch
(
mode
)
{
case
PBRW_ZERO
:
case
PBRW_ZERO
:
...
...
fs/xfs/pagebuf/page_buf_internal.h
View file @
78330667
...
@@ -151,18 +151,6 @@ extern struct pbstats pbstats;
...
@@ -151,18 +151,6 @@ extern struct pbstats pbstats;
#define PB_STATS_INC(count) ( count ++ )
#define PB_STATS_INC(count) ( count ++ )
#undef assert
#ifdef PAGEBUF_DEBUG
# define assert(expr) \
if (!(expr)) { \
printk("Assertion failed: %s\n%s::%s line %d\n",\
#expr,__FILE__,__FUNCTION__,__LINE__); \
BUG(); \
}
#else
# define assert(x) do { } while (0)
#endif
#ifndef STATIC
#ifndef STATIC
# define STATIC static
# define STATIC static
#endif
#endif
...
...
fs/xfs/pagebuf/page_buf_locking.c
View file @
78330667
...
@@ -54,6 +54,8 @@
...
@@ -54,6 +54,8 @@
#include <linux/init.h>
#include <linux/init.h>
#include <linux/major.h>
#include <linux/major.h>
#include <support/debug.h>
#include "page_buf_internal.h"
#include "page_buf_internal.h"
#ifndef EVMS_MAJOR
#ifndef EVMS_MAJOR
...
@@ -76,7 +78,7 @@ pagebuf_cond_lock( /* lock buffer, if not locked */
...
@@ -76,7 +78,7 @@ pagebuf_cond_lock( /* lock buffer, if not locked */
{
{
int
locked
;
int
locked
;
assert
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
ASSERT
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
locked
=
down_trylock
(
&
PBP
(
pb
)
->
pb_sema
)
==
0
;
locked
=
down_trylock
(
&
PBP
(
pb
)
->
pb_sema
)
==
0
;
if
(
locked
)
{
if
(
locked
)
{
...
@@ -97,7 +99,7 @@ int
...
@@ -97,7 +99,7 @@ int
pagebuf_lock_value
(
pagebuf_lock_value
(
page_buf_t
*
pb
)
page_buf_t
*
pb
)
{
{
assert
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
ASSERT
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
return
(
atomic_read
(
&
PBP
(
pb
)
->
pb_sema
.
count
));
return
(
atomic_read
(
&
PBP
(
pb
)
->
pb_sema
.
count
));
}
}
...
@@ -113,7 +115,7 @@ int
...
@@ -113,7 +115,7 @@ int
pagebuf_lock
(
pagebuf_lock
(
page_buf_t
*
pb
)
page_buf_t
*
pb
)
{
{
assert
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
ASSERT
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
PB_TRACE
(
pb
,
PB_TRACE_REC
(
lock
),
0
);
PB_TRACE
(
pb
,
PB_TRACE_REC
(
lock
),
0
);
if
(
atomic_read
(
&
PBP
(
pb
)
->
pb_io_remaining
))
if
(
atomic_read
(
&
PBP
(
pb
)
->
pb_io_remaining
))
...
@@ -219,7 +221,7 @@ void
...
@@ -219,7 +221,7 @@ void
pagebuf_unlock
(
/* unlock buffer */
pagebuf_unlock
(
/* unlock buffer */
page_buf_t
*
pb
)
/* buffer to unlock */
page_buf_t
*
pb
)
/* buffer to unlock */
{
{
assert
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
ASSERT
(
pb
->
pb_flags
&
_PBF_LOCKABLE
);
PB_CLEAR_OWNER
(
pb
);
PB_CLEAR_OWNER
(
pb
);
up
(
&
PBP
(
pb
)
->
pb_sema
);
up
(
&
PBP
(
pb
)
->
pb_sema
);
PB_TRACE
(
pb
,
PB_TRACE_REC
(
unlock
),
0
);
PB_TRACE
(
pb
,
PB_TRACE_REC
(
unlock
),
0
);
...
...
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