diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-22 18:42:10 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:10:00 -0400 |
commit | 864bdb3b6cbd9911222543fef1cfe36f88183f44 (patch) | |
tree | bd00e6293592a084ee0fe68e3acb93060f54ae68 /fs | |
parent | 2be7fd55d44882c9818ed2d1dabc0f0abab5eeed (diff) |
new helper: daemonize_descriptors()
descriptor-related parts of daemonize, done right. As the
result we simplify the locking rules for ->files - we
hold task_lock in *all* cases when we modify ->files.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/file.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -519,6 +519,12 @@ struct files_struct init_files = { | |||
519 | .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), | 519 | .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), |
520 | }; | 520 | }; |
521 | 521 | ||
522 | void daemonize_descriptors(void) | ||
523 | { | ||
524 | atomic_inc(&init_files.count); | ||
525 | reset_files_struct(&init_files); | ||
526 | } | ||
527 | |||
522 | /* | 528 | /* |
523 | * allocate a file descriptor, mark it busy. | 529 | * allocate a file descriptor, mark it busy. |
524 | */ | 530 | */ |