lkml.org 
[lkml]   [2005]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [47/48] Suspend2 2.1.9.8 for 2.6.12: 623-generic-block-io.patch
Hi!

> +static int target_type = -1;
> +
> +/*
> +static char * description[7] = {
> + "Socket",
> + "Link",
> + "Regular file",
> + "Block device",
> + "Directory",
> + "Character device",
> + "Fifo",
> +};
> +*/
> +
...
> +/*
> + * Helpers.
> + */
> +
> +/*
> + * Return the type of target we have, an index into the descriptions
> + * above.
> + */
> +static int get_target_type(struct inode * inode)
> +{
> + switch (inode->i_mode & S_IFMT) {
> + case S_IFSOCK:
> + target_type = 0;
> + break;
> + case S_IFLNK:
> + target_type = 1;
> + break;
> + case S_IFREG:
> + target_type = 2;
> + break;
> + case S_IFBLK:
> + target_type = 3;
> + break;
> + case S_IFDIR:
> + target_type = 4;
> + break;
> + case S_IFCHR:
> + target_type = 5;
> + break;
> + case S_IFIFO:
> + target_type = 6;
> + break;
> + }
> + return target_type;
> +}
> +
> +#define target_is_usable (!(target_type == 1 || target_type == 4))
> +#define target_num_sectors (target_inode->i_size >> target_blkbits)

Why do you need this?
Pavel

--
teflon -- maybe it is a trademark, but it should not be.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-10 20:31    [W:0.525 / U:3.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site