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
a6f69dc8
Commit
a6f69dc8
authored
May 30, 2014
by
David Sterba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
btrfs: move commit out of sysfs when changing label
Signed-off-by:
David Sterba
<
dsterba@suse.cz
>
parent
0eae2747
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
fs/btrfs/sysfs.c
fs/btrfs/sysfs.c
+8
-13
No files found.
fs/btrfs/sysfs.c
View file @
a6f69dc8
...
@@ -369,9 +369,6 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
...
@@ -369,9 +369,6 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
const
char
*
buf
,
size_t
len
)
const
char
*
buf
,
size_t
len
)
{
{
struct
btrfs_fs_info
*
fs_info
=
to_fs_info
(
kobj
);
struct
btrfs_fs_info
*
fs_info
=
to_fs_info
(
kobj
);
struct
btrfs_trans_handle
*
trans
;
struct
btrfs_root
*
root
=
fs_info
->
fs_root
;
int
ret
;
size_t
p_len
;
size_t
p_len
;
if
(
fs_info
->
sb
->
s_flags
&
MS_RDONLY
)
if
(
fs_info
->
sb
->
s_flags
&
MS_RDONLY
)
...
@@ -386,20 +383,18 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
...
@@ -386,20 +383,18 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
if
(
p_len
>=
BTRFS_LABEL_SIZE
)
if
(
p_len
>=
BTRFS_LABEL_SIZE
)
return
-
EINVAL
;
return
-
EINVAL
;
trans
=
btrfs_start_transaction
(
root
,
0
);
spin_lock
(
&
fs_info
->
super_lock
);
if
(
IS_ERR
(
trans
))
return
PTR_ERR
(
trans
);
spin_lock
(
&
root
->
fs_info
->
super_lock
);
memset
(
fs_info
->
super_copy
->
label
,
0
,
BTRFS_LABEL_SIZE
);
memset
(
fs_info
->
super_copy
->
label
,
0
,
BTRFS_LABEL_SIZE
);
memcpy
(
fs_info
->
super_copy
->
label
,
buf
,
p_len
);
memcpy
(
fs_info
->
super_copy
->
label
,
buf
,
p_len
);
spin_unlock
(
&
root
->
fs_info
->
super_lock
);
spin_unlock
(
&
fs_info
->
super_lock
);
ret
=
btrfs_commit_transaction
(
trans
,
root
);
if
(
!
ret
)
/*
return
len
;
* We don't want to do full transaction commit from inside sysfs
*/
btrfs_set_pending
(
fs_info
,
COMMIT
);
wake_up_process
(
fs_info
->
transaction_kthread
);
return
ret
;
return
len
;
}
}
BTRFS_ATTR_RW
(
label
,
btrfs_label_show
,
btrfs_label_store
);
BTRFS_ATTR_RW
(
label
,
btrfs_label_show
,
btrfs_label_store
);
...
...
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