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
343eec3c
Commit
343eec3c
authored
Sep 23, 2002
by
Benjamin LaHaise
Browse files
Options
Browse Files
Download
Plain Diff
Merge toomuch.toronto.redhat.com:/md0/linux-2.5
into toomuch.toronto.redhat.com:/md0/aio-2.5
parents
f20bf018
264e7854
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
527 additions
and
140 deletions
+527
-140
drivers/net/ns83820.c
drivers/net/ns83820.c
+510
-118
fs/aio.c
fs/aio.c
+17
-22
No files found.
drivers/net/ns83820.c
View file @
343eec3c
This diff is collapsed.
Click to expand it.
fs/aio.c
View file @
343eec3c
...
...
@@ -176,29 +176,24 @@ static int aio_setup_ring(struct kioctx *ctx)
/* aio_ring_event: returns a pointer to the event at the given index from
* kmap_atomic(, km). Release the pointer with put_aio_ring_event();
*/
static
inline
struct
io_event
*
aio_ring_event
(
struct
aio_ring_info
*
info
,
int
nr
,
enum
km_type
km
)
{
struct
io_event
*
events
;
#define AIO_EVENTS_PER_PAGE (PAGE_SIZE / sizeof(struct io_event))
#define AIO_EVENTS_FIRST_PAGE ((PAGE_SIZE - sizeof(struct aio_ring)) / sizeof(struct io_event))
if
(
nr
<
AIO_EVENTS_FIRST_PAGE
)
{
struct
aio_ring
*
ring
;
ring
=
kmap_atomic
(
info
->
ring_pages
[
0
],
km
);
return
&
ring
->
io_events
[
nr
];
}
nr
-=
AIO_EVENTS_FIRST_PAGE
;
events
=
kmap_atomic
(
info
->
ring_pages
[
1
+
nr
/
AIO_EVENTS_PER_PAGE
],
km
);
return
events
+
(
nr
%
AIO_EVENTS_PER_PAGE
);
}
static
inline
void
put_aio_ring_event
(
struct
io_event
*
event
,
enum
km_type
km
)
{
void
*
p
=
(
void
*
)((
unsigned
long
)
event
&
PAGE_MASK
);
kunmap_atomic
(
p
,
km
);
}
#define AIO_EVENTS_OFFSET (AIO_EVENTS_PER_PAGE - AIO_EVENTS_FIRST_PAGE)
#define aio_ring_event(info, nr, km) ({ \
unsigned pos = (nr) + AIO_EVENTS_OFFSET; \
struct io_event *__event; \
__event = kmap_atomic( \
(info)->ring_pages[pos / AIO_EVENTS_PER_PAGE], km); \
__event += pos % AIO_EVENTS_PER_PAGE; \
__event; \
})
#define put_aio_ring_event(event, km) do { \
struct io_event *__event = (event); \
(void)__event; \
kunmap_atomic((void *)((unsigned long)__event & PAGE_MASK), km); \
} while(0)
/* ioctx_alloc
* Allocates and initializes an ioctx. Returns an ERR_PTR if it failed.
...
...
@@ -557,7 +552,7 @@ int aio_complete(struct kiocb *iocb, long res, long res2)
iocb
->
ki_users
--
;
ret
=
(
0
==
iocb
->
ki_users
);
spin_unlock_irq
(
&
ctx
->
ctx_lock
);
return
0
;
return
ret
;
}
info
=
&
ctx
->
ring_info
;
...
...
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