Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
e572ec7e
Commit
e572ec7e
authored
Mar 18, 2006
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix rmmod problems with elevator attributes, clean them up
parent
3d1ab40f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
175 deletions
+74
-175
block/as-iosched.c
block/as-iosched.c
+22
-49
block/cfq-iosched.c
block/cfq-iosched.c
+20
-73
block/deadline-iosched.c
block/deadline-iosched.c
+21
-43
block/elevator.c
block/elevator.c
+4
-3
include/linux/elevator.h
include/linux/elevator.h
+7
-7
No files found.
block/as-iosched.c
View file @
e572ec7e
...
@@ -1725,7 +1725,7 @@ as_var_store(unsigned long *var, const char *page, size_t count)
...
@@ -1725,7 +1725,7 @@ as_var_store(unsigned long *var, const char *page, size_t count)
return
count
;
return
count
;
}
}
static
ssize_t
as_est
_show
(
elevator_t
*
e
,
char
*
page
)
static
ssize_t
est_time
_show
(
elevator_t
*
e
,
char
*
page
)
{
{
struct
as_data
*
ad
=
e
->
elevator_data
;
struct
as_data
*
ad
=
e
->
elevator_data
;
int
pos
=
0
;
int
pos
=
0
;
...
@@ -1748,11 +1748,11 @@ static ssize_t __FUNC(elevator_t *e, char *page) \
...
@@ -1748,11 +1748,11 @@ static ssize_t __FUNC(elevator_t *e, char *page) \
struct as_data *ad = e->elevator_data; \
struct as_data *ad = e->elevator_data; \
return as_var_show(jiffies_to_msecs((__VAR)), (page)); \
return as_var_show(jiffies_to_msecs((__VAR)), (page)); \
}
}
SHOW_FUNCTION
(
as_readexpire_show
,
ad
->
fifo_expire
[
REQ_SYNC
]);
SHOW_FUNCTION
(
as_read
_
expire_show
,
ad
->
fifo_expire
[
REQ_SYNC
]);
SHOW_FUNCTION
(
as_writeexpire_show
,
ad
->
fifo_expire
[
REQ_ASYNC
]);
SHOW_FUNCTION
(
as_write
_
expire_show
,
ad
->
fifo_expire
[
REQ_ASYNC
]);
SHOW_FUNCTION
(
as_anticexpire_show
,
ad
->
antic_expire
);
SHOW_FUNCTION
(
as_antic
_
expire_show
,
ad
->
antic_expire
);
SHOW_FUNCTION
(
as_read_batchexpire_show
,
ad
->
batch_expire
[
REQ_SYNC
]);
SHOW_FUNCTION
(
as_read_batch
_
expire_show
,
ad
->
batch_expire
[
REQ_SYNC
]);
SHOW_FUNCTION
(
as_write_batchexpire_show
,
ad
->
batch_expire
[
REQ_ASYNC
]);
SHOW_FUNCTION
(
as_write_batch
_
expire_show
,
ad
->
batch_expire
[
REQ_ASYNC
]);
#undef SHOW_FUNCTION
#undef SHOW_FUNCTION
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX) \
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX) \
...
@@ -1767,53 +1767,26 @@ static ssize_t __FUNC(elevator_t *e, const char *page, size_t count) \
...
@@ -1767,53 +1767,26 @@ static ssize_t __FUNC(elevator_t *e, const char *page, size_t count) \
*(__PTR) = msecs_to_jiffies(*(__PTR)); \
*(__PTR) = msecs_to_jiffies(*(__PTR)); \
return ret; \
return ret; \
}
}
STORE_FUNCTION
(
as_readexpire_store
,
&
ad
->
fifo_expire
[
REQ_SYNC
],
0
,
INT_MAX
);
STORE_FUNCTION
(
as_read
_
expire_store
,
&
ad
->
fifo_expire
[
REQ_SYNC
],
0
,
INT_MAX
);
STORE_FUNCTION
(
as_writeexpire_store
,
&
ad
->
fifo_expire
[
REQ_ASYNC
],
0
,
INT_MAX
);
STORE_FUNCTION
(
as_write
_
expire_store
,
&
ad
->
fifo_expire
[
REQ_ASYNC
],
0
,
INT_MAX
);
STORE_FUNCTION
(
as_anticexpire_store
,
&
ad
->
antic_expire
,
0
,
INT_MAX
);
STORE_FUNCTION
(
as_antic
_
expire_store
,
&
ad
->
antic_expire
,
0
,
INT_MAX
);
STORE_FUNCTION
(
as_read_batchexpire_store
,
STORE_FUNCTION
(
as_read_batch
_
expire_store
,
&
ad
->
batch_expire
[
REQ_SYNC
],
0
,
INT_MAX
);
&
ad
->
batch_expire
[
REQ_SYNC
],
0
,
INT_MAX
);
STORE_FUNCTION
(
as_write_batchexpire_store
,
STORE_FUNCTION
(
as_write_batch
_
expire_store
,
&
ad
->
batch_expire
[
REQ_ASYNC
],
0
,
INT_MAX
);
&
ad
->
batch_expire
[
REQ_ASYNC
],
0
,
INT_MAX
);
#undef STORE_FUNCTION
#undef STORE_FUNCTION
static
struct
elv_fs_entry
as_est_entry
=
{
#define AS_ATTR(name) \
.
attr
=
{.
name
=
"est_time"
,
.
mode
=
S_IRUGO
},
__ATTR(name, S_IRUGO|S_IWUSR, as_##name##_show, as_##name##_store)
.
show
=
as_est_show
,
};
static
struct
elv_fs_entry
as_attrs
[]
=
{
static
struct
elv_fs_entry
as_readexpire_entry
=
{
__ATTR_RO
(
est_time
),
.
attr
=
{.
name
=
"read_expire"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
AS_ATTR
(
read_expire
),
.
show
=
as_readexpire_show
,
AS_ATTR
(
write_expire
),
.
store
=
as_readexpire_store
,
AS_ATTR
(
antic_expire
),
};
AS_ATTR
(
read_batch_expire
),
static
struct
elv_fs_entry
as_writeexpire_entry
=
{
AS_ATTR
(
write_batch_expire
),
.
attr
=
{.
name
=
"write_expire"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
__ATTR_NULL
.
show
=
as_writeexpire_show
,
.
store
=
as_writeexpire_store
,
};
static
struct
elv_fs_entry
as_anticexpire_entry
=
{
.
attr
=
{.
name
=
"antic_expire"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
as_anticexpire_show
,
.
store
=
as_anticexpire_store
,
};
static
struct
elv_fs_entry
as_read_batchexpire_entry
=
{
.
attr
=
{.
name
=
"read_batch_expire"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
as_read_batchexpire_show
,
.
store
=
as_read_batchexpire_store
,
};
static
struct
elv_fs_entry
as_write_batchexpire_entry
=
{
.
attr
=
{.
name
=
"write_batch_expire"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
as_write_batchexpire_show
,
.
store
=
as_write_batchexpire_store
,
};
static
struct
attribute
*
as_attrs
[]
=
{
&
as_est_entry
.
attr
,
&
as_readexpire_entry
.
attr
,
&
as_writeexpire_entry
.
attr
,
&
as_anticexpire_entry
.
attr
,
&
as_read_batchexpire_entry
.
attr
,
&
as_write_batchexpire_entry
.
attr
,
NULL
,
};
};
static
struct
elevator_type
iosched_as
=
{
static
struct
elevator_type
iosched_as
=
{
...
...
block/cfq-iosched.c
View file @
e572ec7e
...
@@ -2304,8 +2304,8 @@ SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum, 0);
...
@@ -2304,8 +2304,8 @@ SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum, 0);
SHOW_FUNCTION
(
cfq_queued_show
,
cfqd
->
cfq_queued
,
0
);
SHOW_FUNCTION
(
cfq_queued_show
,
cfqd
->
cfq_queued
,
0
);
SHOW_FUNCTION
(
cfq_fifo_expire_sync_show
,
cfqd
->
cfq_fifo_expire
[
1
],
1
);
SHOW_FUNCTION
(
cfq_fifo_expire_sync_show
,
cfqd
->
cfq_fifo_expire
[
1
],
1
);
SHOW_FUNCTION
(
cfq_fifo_expire_async_show
,
cfqd
->
cfq_fifo_expire
[
0
],
1
);
SHOW_FUNCTION
(
cfq_fifo_expire_async_show
,
cfqd
->
cfq_fifo_expire
[
0
],
1
);
SHOW_FUNCTION
(
cfq_back_max_show
,
cfqd
->
cfq_back_max
,
0
);
SHOW_FUNCTION
(
cfq_back_
seek_
max_show
,
cfqd
->
cfq_back_max
,
0
);
SHOW_FUNCTION
(
cfq_back_penalty_show
,
cfqd
->
cfq_back_penalty
,
0
);
SHOW_FUNCTION
(
cfq_back_
seek_
penalty_show
,
cfqd
->
cfq_back_penalty
,
0
);
SHOW_FUNCTION
(
cfq_slice_idle_show
,
cfqd
->
cfq_slice_idle
,
1
);
SHOW_FUNCTION
(
cfq_slice_idle_show
,
cfqd
->
cfq_slice_idle
,
1
);
SHOW_FUNCTION
(
cfq_slice_sync_show
,
cfqd
->
cfq_slice
[
1
],
1
);
SHOW_FUNCTION
(
cfq_slice_sync_show
,
cfqd
->
cfq_slice
[
1
],
1
);
SHOW_FUNCTION
(
cfq_slice_async_show
,
cfqd
->
cfq_slice
[
0
],
1
);
SHOW_FUNCTION
(
cfq_slice_async_show
,
cfqd
->
cfq_slice
[
0
],
1
);
...
@@ -2333,8 +2333,8 @@ STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, UINT_MAX, 0);
...
@@ -2333,8 +2333,8 @@ STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, UINT_MAX, 0);
STORE_FUNCTION
(
cfq_queued_store
,
&
cfqd
->
cfq_queued
,
1
,
UINT_MAX
,
0
);
STORE_FUNCTION
(
cfq_queued_store
,
&
cfqd
->
cfq_queued
,
1
,
UINT_MAX
,
0
);
STORE_FUNCTION
(
cfq_fifo_expire_sync_store
,
&
cfqd
->
cfq_fifo_expire
[
1
],
1
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_fifo_expire_sync_store
,
&
cfqd
->
cfq_fifo_expire
[
1
],
1
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_fifo_expire_async_store
,
&
cfqd
->
cfq_fifo_expire
[
0
],
1
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_fifo_expire_async_store
,
&
cfqd
->
cfq_fifo_expire
[
0
],
1
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_back_max_store
,
&
cfqd
->
cfq_back_max
,
0
,
UINT_MAX
,
0
);
STORE_FUNCTION
(
cfq_back_
seek_
max_store
,
&
cfqd
->
cfq_back_max
,
0
,
UINT_MAX
,
0
);
STORE_FUNCTION
(
cfq_back_penalty_store
,
&
cfqd
->
cfq_back_penalty
,
1
,
UINT_MAX
,
0
);
STORE_FUNCTION
(
cfq_back_
seek_
penalty_store
,
&
cfqd
->
cfq_back_penalty
,
1
,
UINT_MAX
,
0
);
STORE_FUNCTION
(
cfq_slice_idle_store
,
&
cfqd
->
cfq_slice_idle
,
0
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_slice_idle_store
,
&
cfqd
->
cfq_slice_idle
,
0
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_slice_sync_store
,
&
cfqd
->
cfq_slice
[
1
],
1
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_slice_sync_store
,
&
cfqd
->
cfq_slice
[
1
],
1
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_slice_async_store
,
&
cfqd
->
cfq_slice
[
0
],
1
,
UINT_MAX
,
1
);
STORE_FUNCTION
(
cfq_slice_async_store
,
&
cfqd
->
cfq_slice
[
0
],
1
,
UINT_MAX
,
1
);
...
@@ -2342,75 +2342,22 @@ STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1, UINT_MAX,
...
@@ -2342,75 +2342,22 @@ STORE_FUNCTION(cfq_slice_async_rq_store, &cfqd->cfq_slice_async_rq, 1, UINT_MAX,
STORE_FUNCTION
(
cfq_max_depth_store
,
&
cfqd
->
cfq_max_depth
,
1
,
UINT_MAX
,
0
);
STORE_FUNCTION
(
cfq_max_depth_store
,
&
cfqd
->
cfq_max_depth
,
1
,
UINT_MAX
,
0
);
#undef STORE_FUNCTION
#undef STORE_FUNCTION
static
struct
elv_fs_entry
cfq_quantum_entry
=
{
#define CFQ_ATTR(name) \
.
attr
=
{.
name
=
"quantum"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
__ATTR(name, S_IRUGO|S_IWUSR, cfq_##name##_show, cfq_##name##_store)
.
show
=
cfq_quantum_show
,
.
store
=
cfq_quantum_store
,
static
struct
elv_fs_entry
cfq_attrs
[]
=
{
};
CFQ_ATTR
(
quantum
),
static
struct
elv_fs_entry
cfq_queued_entry
=
{
CFQ_ATTR
(
queued
),
.
attr
=
{.
name
=
"queued"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
CFQ_ATTR
(
fifo_expire_sync
),
.
show
=
cfq_queued_show
,
CFQ_ATTR
(
fifo_expire_async
),
.
store
=
cfq_queued_store
,
CFQ_ATTR
(
back_seek_max
),
};
CFQ_ATTR
(
back_seek_penalty
),
static
struct
elv_fs_entry
cfq_fifo_expire_sync_entry
=
{
CFQ_ATTR
(
slice_sync
),
.
attr
=
{.
name
=
"fifo_expire_sync"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
CFQ_ATTR
(
slice_async
),
.
show
=
cfq_fifo_expire_sync_show
,
CFQ_ATTR
(
slice_async_rq
),
.
store
=
cfq_fifo_expire_sync_store
,
CFQ_ATTR
(
slice_idle
),
};
CFQ_ATTR
(
max_depth
),
static
struct
elv_fs_entry
cfq_fifo_expire_async_entry
=
{
__ATTR_NULL
.
attr
=
{.
name
=
"fifo_expire_async"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_fifo_expire_async_show
,
.
store
=
cfq_fifo_expire_async_store
,
};
static
struct
elv_fs_entry
cfq_back_max_entry
=
{
.
attr
=
{.
name
=
"back_seek_max"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_back_max_show
,
.
store
=
cfq_back_max_store
,
};
static
struct
elv_fs_entry
cfq_back_penalty_entry
=
{
.
attr
=
{.
name
=
"back_seek_penalty"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_back_penalty_show
,
.
store
=
cfq_back_penalty_store
,
};
static
struct
elv_fs_entry
cfq_slice_sync_entry
=
{
.
attr
=
{.
name
=
"slice_sync"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_slice_sync_show
,
.
store
=
cfq_slice_sync_store
,
};
static
struct
elv_fs_entry
cfq_slice_async_entry
=
{
.
attr
=
{.
name
=
"slice_async"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_slice_async_show
,
.
store
=
cfq_slice_async_store
,
};
static
struct
elv_fs_entry
cfq_slice_async_rq_entry
=
{
.
attr
=
{.
name
=
"slice_async_rq"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_slice_async_rq_show
,
.
store
=
cfq_slice_async_rq_store
,
};
static
struct
elv_fs_entry
cfq_slice_idle_entry
=
{
.
attr
=
{.
name
=
"slice_idle"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_slice_idle_show
,
.
store
=
cfq_slice_idle_store
,
};
static
struct
elv_fs_entry
cfq_max_depth_entry
=
{
.
attr
=
{.
name
=
"max_depth"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
cfq_max_depth_show
,
.
store
=
cfq_max_depth_store
,
};
static
struct
attribute
*
cfq_attrs
[]
=
{
&
cfq_quantum_entry
.
attr
,
&
cfq_queued_entry
.
attr
,
&
cfq_fifo_expire_sync_entry
.
attr
,
&
cfq_fifo_expire_async_entry
.
attr
,
&
cfq_back_max_entry
.
attr
,
&
cfq_back_penalty_entry
.
attr
,
&
cfq_slice_sync_entry
.
attr
,
&
cfq_slice_async_entry
.
attr
,
&
cfq_slice_async_rq_entry
.
attr
,
&
cfq_slice_idle_entry
.
attr
,
&
cfq_max_depth_entry
.
attr
,
NULL
,
};
};
static
struct
elevator_type
iosched_cfq
=
{
static
struct
elevator_type
iosched_cfq
=
{
...
...
block/deadline-iosched.c
View file @
e572ec7e
...
@@ -719,11 +719,11 @@ static ssize_t __FUNC(elevator_t *e, char *page) \
...
@@ -719,11 +719,11 @@ static ssize_t __FUNC(elevator_t *e, char *page) \
__data = jiffies_to_msecs(__data); \
__data = jiffies_to_msecs(__data); \
return deadline_var_show(__data, (page)); \
return deadline_var_show(__data, (page)); \
}
}
SHOW_FUNCTION
(
deadline_readexpire_show
,
dd
->
fifo_expire
[
READ
],
1
);
SHOW_FUNCTION
(
deadline_read
_
expire_show
,
dd
->
fifo_expire
[
READ
],
1
);
SHOW_FUNCTION
(
deadline_writeexpire_show
,
dd
->
fifo_expire
[
WRITE
],
1
);
SHOW_FUNCTION
(
deadline_write
_
expire_show
,
dd
->
fifo_expire
[
WRITE
],
1
);
SHOW_FUNCTION
(
deadline_writesstarved_show
,
dd
->
writes_starved
,
0
);
SHOW_FUNCTION
(
deadline_writes
_
starved_show
,
dd
->
writes_starved
,
0
);
SHOW_FUNCTION
(
deadline_frontmerges_show
,
dd
->
front_merges
,
0
);
SHOW_FUNCTION
(
deadline_front
_
merges_show
,
dd
->
front_merges
,
0
);
SHOW_FUNCTION
(
deadline_fifobatch_show
,
dd
->
fifo_batch
,
0
);
SHOW_FUNCTION
(
deadline_fifo
_
batch_show
,
dd
->
fifo_batch
,
0
);
#undef SHOW_FUNCTION
#undef SHOW_FUNCTION
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
...
@@ -742,46 +742,24 @@ static ssize_t __FUNC(elevator_t *e, const char *page, size_t count) \
...
@@ -742,46 +742,24 @@ static ssize_t __FUNC(elevator_t *e, const char *page, size_t count) \
*(__PTR) = __data; \
*(__PTR) = __data; \
return ret; \
return ret; \
}
}
STORE_FUNCTION
(
deadline_readexpire_store
,
&
dd
->
fifo_expire
[
READ
],
0
,
INT_MAX
,
1
);
STORE_FUNCTION
(
deadline_read
_
expire_store
,
&
dd
->
fifo_expire
[
READ
],
0
,
INT_MAX
,
1
);
STORE_FUNCTION
(
deadline_writeexpire_store
,
&
dd
->
fifo_expire
[
WRITE
],
0
,
INT_MAX
,
1
);
STORE_FUNCTION
(
deadline_write
_
expire_store
,
&
dd
->
fifo_expire
[
WRITE
],
0
,
INT_MAX
,
1
);
STORE_FUNCTION
(
deadline_writesstarved_store
,
&
dd
->
writes_starved
,
INT_MIN
,
INT_MAX
,
0
);
STORE_FUNCTION
(
deadline_writes
_
starved_store
,
&
dd
->
writes_starved
,
INT_MIN
,
INT_MAX
,
0
);
STORE_FUNCTION
(
deadline_frontmerges_store
,
&
dd
->
front_merges
,
0
,
1
,
0
);
STORE_FUNCTION
(
deadline_front
_
merges_store
,
&
dd
->
front_merges
,
0
,
1
,
0
);
STORE_FUNCTION
(
deadline_fifobatch_store
,
&
dd
->
fifo_batch
,
0
,
INT_MAX
,
0
);
STORE_FUNCTION
(
deadline_fifo
_
batch_store
,
&
dd
->
fifo_batch
,
0
,
INT_MAX
,
0
);
#undef STORE_FUNCTION
#undef STORE_FUNCTION
static
struct
elv_fs_entry
deadline_readexpire_entry
=
{
#define DD_ATTR(name) \
.
attr
=
{.
name
=
"read_expire"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
__ATTR(name, S_IRUGO|S_IWUSR, deadline_##name##_show, \
.
show
=
deadline_readexpire_show
,
deadline_##name##_store)
.
store
=
deadline_readexpire_store
,
};
static
struct
elv_fs_entry
deadline_attrs
[]
=
{
static
struct
elv_fs_entry
deadline_writeexpire_entry
=
{
DD_ATTR
(
read_expire
),
.
attr
=
{.
name
=
"write_expire"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
DD_ATTR
(
write_expire
),
.
show
=
deadline_writeexpire_show
,
DD_ATTR
(
writes_starved
),
.
store
=
deadline_writeexpire_store
,
DD_ATTR
(
front_merges
),
};
DD_ATTR
(
fifo_batch
),
static
struct
elv_fs_entry
deadline_writesstarved_entry
=
{
__ATTR_NULL
.
attr
=
{.
name
=
"writes_starved"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
deadline_writesstarved_show
,
.
store
=
deadline_writesstarved_store
,
};
static
struct
elv_fs_entry
deadline_frontmerges_entry
=
{
.
attr
=
{.
name
=
"front_merges"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
deadline_frontmerges_show
,
.
store
=
deadline_frontmerges_store
,
};
static
struct
elv_fs_entry
deadline_fifobatch_entry
=
{
.
attr
=
{.
name
=
"fifo_batch"
,
.
mode
=
S_IRUGO
|
S_IWUSR
},
.
show
=
deadline_fifobatch_show
,
.
store
=
deadline_fifobatch_store
,
};
static
struct
attribute
*
deadline_attrs
[]
=
{
&
deadline_readexpire_entry
.
attr
,
&
deadline_writeexpire_entry
.
attr
,
&
deadline_writesstarved_entry
.
attr
,
&
deadline_frontmerges_entry
.
attr
,
&
deadline_fifobatch_entry
.
attr
,
NULL
,
};
};
static
struct
elevator_type
iosched_deadline
=
{
static
struct
elevator_type
iosched_deadline
=
{
...
...
block/elevator.c
View file @
e572ec7e
...
@@ -699,11 +699,12 @@ int elv_register_queue(struct request_queue *q)
...
@@ -699,11 +699,12 @@ int elv_register_queue(struct request_queue *q)
error
=
kobject_add
(
&
e
->
kobj
);
error
=
kobject_add
(
&
e
->
kobj
);
if
(
!
error
)
{
if
(
!
error
)
{
struct
attribute
*
*
attr
=
e
->
elevator_type
->
elevator_attrs
;
struct
elv_fs_entry
*
attr
=
e
->
elevator_type
->
elevator_attrs
;
if
(
attr
)
{
if
(
attr
)
{
while
(
*
attr
)
{
while
(
attr
->
attr
.
name
)
{
if
(
sysfs_create_file
(
&
e
->
kobj
,
*
attr
++
))
if
(
sysfs_create_file
(
&
e
->
kobj
,
&
attr
->
attr
))
break
;
break
;
attr
++
;
}
}
}
}
kobject_uevent
(
&
e
->
kobj
,
KOBJ_ADD
);
kobject_uevent
(
&
e
->
kobj
,
KOBJ_ADD
);
...
...
include/linux/elevator.h
View file @
e572ec7e
...
@@ -53,6 +53,12 @@ struct elevator_ops
...
@@ -53,6 +53,12 @@ struct elevator_ops
#define ELV_NAME_MAX (16)
#define ELV_NAME_MAX (16)
struct
elv_fs_entry
{
struct
attribute
attr
;
ssize_t
(
*
show
)(
elevator_t
*
,
char
*
);
ssize_t
(
*
store
)(
elevator_t
*
,
const
char
*
,
size_t
);
};
/*
/*
* identifies an elevator type, such as AS or deadline
* identifies an elevator type, such as AS or deadline
*/
*/
...
@@ -61,7 +67,7 @@ struct elevator_type
...
@@ -61,7 +67,7 @@ struct elevator_type
struct
list_head
list
;
struct
list_head
list
;
struct
elevator_ops
ops
;
struct
elevator_ops
ops
;
struct
elevator_type
*
elevator_type
;
struct
elevator_type
*
elevator_type
;
struct
attribute
*
*
elevator_attrs
;
struct
elv_fs_entry
*
elevator_attrs
;
char
elevator_name
[
ELV_NAME_MAX
];
char
elevator_name
[
ELV_NAME_MAX
];
struct
module
*
elevator_owner
;
struct
module
*
elevator_owner
;
};
};
...
@@ -142,12 +148,6 @@ enum {
...
@@ -142,12 +148,6 @@ enum {
ELV_MQUEUE_MUST
,
ELV_MQUEUE_MUST
,
};
};
struct
elv_fs_entry
{
struct
attribute
attr
;
ssize_t
(
*
show
)(
elevator_t
*
,
char
*
);
ssize_t
(
*
store
)(
elevator_t
*
,
const
char
*
,
size_t
);
};
#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
#endif
#endif
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