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
d7242c46
Commit
d7242c46
authored
Mar 18, 2020
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pNFS: Add a helper to allocate the array of buckets
Signed-off-by:
Trond Myklebust
<
trond.myklebust@hammerspace.com
>
parent
19573c93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
3 deletions
+46
-3
fs/nfs/pnfs.h
fs/nfs/pnfs.h
+3
-0
fs/nfs/pnfs_nfs.c
fs/nfs/pnfs_nfs.c
+31
-0
include/linux/nfs_xdr.h
include/linux/nfs_xdr.h
+12
-3
No files found.
fs/nfs/pnfs.h
View file @
d7242c46
...
...
@@ -366,6 +366,9 @@ bool nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node);
void
nfs4_deviceid_purge_client
(
const
struct
nfs_client
*
);
/* pnfs_nfs.c */
struct
pnfs_commit_array
*
pnfs_alloc_commit_array
(
size_t
n
,
gfp_t
gfp_flags
);
void
pnfs_free_commit_array
(
struct
pnfs_commit_array
*
p
);
void
pnfs_generic_clear_request_commit
(
struct
nfs_page
*
req
,
struct
nfs_commit_info
*
cinfo
);
void
pnfs_generic_commit_release
(
void
*
calldata
);
...
...
fs/nfs/pnfs_nfs.c
View file @
d7242c46
...
...
@@ -87,6 +87,37 @@ pnfs_generic_clear_request_commit(struct nfs_page *req,
}
EXPORT_SYMBOL_GPL
(
pnfs_generic_clear_request_commit
);
struct
pnfs_commit_array
*
pnfs_alloc_commit_array
(
size_t
n
,
gfp_t
gfp_flags
)
{
struct
pnfs_commit_array
*
p
;
struct
pnfs_commit_bucket
*
b
;
p
=
kmalloc
(
struct_size
(
p
,
buckets
,
n
),
gfp_flags
);
if
(
!
p
)
return
NULL
;
p
->
nbuckets
=
n
;
INIT_LIST_HEAD
(
&
p
->
cinfo_list
);
INIT_LIST_HEAD
(
&
p
->
lseg_list
);
p
->
lseg
=
NULL
;
for
(
b
=
&
p
->
buckets
[
0
];
n
!=
0
;
b
++
,
n
--
)
{
INIT_LIST_HEAD
(
&
b
->
written
);
INIT_LIST_HEAD
(
&
b
->
committing
);
b
->
wlseg
=
NULL
;
b
->
clseg
=
NULL
;
b
->
direct_verf
.
committed
=
NFS_INVALID_STABLE_HOW
;
}
return
p
;
}
EXPORT_SYMBOL_GPL
(
pnfs_alloc_commit_array
);
void
pnfs_free_commit_array
(
struct
pnfs_commit_array
*
p
)
{
kfree_rcu
(
p
,
rcu
);
}
EXPORT_SYMBOL_GPL
(
pnfs_free_commit_array
);
static
int
pnfs_generic_scan_ds_commit_list
(
struct
pnfs_commit_bucket
*
bucket
,
struct
nfs_commit_info
*
cinfo
,
...
...
include/linux/nfs_xdr.h
View file @
d7242c46
...
...
@@ -1270,10 +1270,19 @@ struct pnfs_commit_bucket {
struct
nfs_writeverf
direct_verf
;
};
struct
pnfs_commit_array
{
struct
list_head
cinfo_list
;
struct
list_head
lseg_list
;
struct
pnfs_layout_segment
*
lseg
;
struct
rcu_head
rcu
;
unsigned
int
nbuckets
;
struct
pnfs_commit_bucket
buckets
[];
};
struct
pnfs_ds_commit_info
{
int
nwritten
;
int
ncommitting
;
int
nbuckets
;
unsigned
int
nwritten
;
unsigned
int
ncommitting
;
unsigned
int
nbuckets
;
struct
pnfs_commit_bucket
*
buckets
;
};
...
...
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