Re: [PATCH 1/2] btrfs-progs: add task-utils

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

so started reviewing the patches for inclusion in the 3.18 branch and
found a few things that I've fixed locally, this is just FYI.

On Sun, Nov 09, 2014 at 11:16:55PM +0100, Silvio Fricke wrote:
> Signed-off-by: Silvio Fricke <silvio.fricke@xxxxxxxxx>
> ---
>  task-util.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  task-util.h |  33 +++++++++++++++++
>  2 files changed, 154 insertions(+)
>  create mode 100644 task-util.c
>  create mode 100644 task-util.h
> 
> diff --git a/task-util.c b/task-util.c
> new file mode 100644
> index 0000000..9268df7
> --- /dev/null
> +++ b/task-util.c

Renamed the file to task-utils.c

> diff --git a/task-util.h b/task-util.h
> new file mode 100644
> index 0000000..95f7b5b
> --- /dev/null
> +++ b/task-util.h
> @@ -0,0 +1,33 @@
> +
> +#ifndef __PROGRESS_
> +#define __PROGRESS_

__TASK_UTILS_H__

> +
> +#include <pthread.h>
> +
> +struct periodic_info {
> +	int timer_fd;
> +	unsigned long long wakeups_missed;
> +};
> +
> +struct task_info {
> +	struct periodic_info periodic;
> +	pthread_t id;
> +	void *private_data;
> +	void *(*threadfn)(void *);
> +	int (*postfn)(void *);
> +};
> +
> +/* task life cycle */
> +struct task_info *task_init(void *(*threadfn)(void *), int (*postfn)(void *),
> +			    void *thread_private);
> +int task_start(struct task_info *info);
> +void task_stop(struct task_info *info);
> +void task_deinit(struct task_info *info);
> +
> +/* periodic life cycle */
> +int task_period_start(struct task_info *info, unsigned int period_ms);
> +void task_period_wait(struct task_info *info);
> +void task_period_stop(struct task_info *info);
> +
> +#endif /* __PROGRESS_ */

dtto
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux