hi

On Sun, Jul 14, 2013 at 06:33:38PM +0200, Hamza Zia wrote:
> From: hamza zia <[email protected]>
> 
> Inode and device information is added in the file_info struct, it can be
> very useful for a plugin that handles file caching.

I'm actually working in the opposite direction with my gsoc.
I want to move the file_info stuff into the plugins since it is only
really useful when serving static files and at most one static file
should be served per request.
If the variables are only used once per request, I don't see any reason
why it should be kept as members of session_request.

If I've missed some way that this can be used, could you please
enlighten me?

> ---
>  src/include/mk_file.h | 3 +++
>  src/mk_file.c         | 3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/src/include/mk_file.h b/src/include/mk_file.h
> index 5c91d1a..89e8067 100644
> --- a/src/include/mk_file.h
> +++ b/src/include/mk_file.h
> @@ -27,6 +27,9 @@ struct file_info
>      off_t size;
>      time_t last_modification;
> 
> +    ino_t inode;
> +    dev_t device;
> +
>      /* Suggest flags to open this file */
>      int flags_read_only;
> 
> diff --git a/src/mk_file.c b/src/mk_file.c
> index dcd067b..ed9da01 100644
> --- a/src/mk_file.c
> +++ b/src/mk_file.c
> @@ -71,6 +71,9 @@ int mk_file_get_info(const char *path, struct file_info 
> *f_info)
>      f_info->size = target.st_size;
>      f_info->last_modification = target.st_mtime;
> 
> +    f_info->inode = target.st_ino;
> +    f_info->device = target.st_dev;
> +
>      if (S_ISDIR(target.st_mode)) {
>          f_info->is_directory = MK_TRUE;
>          f_info->is_file = MK_FALSE;
> --
> 1.8.1.2
> 
> _______________________________________________
> Monkey mailing list
> [email protected]
> http://lists.monkey-project.com/listinfo/monkey

-- 
Sonny Karlsson
_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to