Subversion Repositories Kolibri OS

Rev

Rev 4568 | Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4568 Rev 5056
Line 99... Line 99...
99
	BUG_ON(sg_is_chain(sg));
99
	BUG_ON(sg_is_chain(sg));
100
#endif
100
#endif
101
	return (struct page *)((sg)->page_link & ~0x3);
101
	return (struct page *)((sg)->page_link & ~0x3);
102
}
102
}
Line 103... Line -...
103
 
-
 
104
/**
-
 
105
 * sg_set_buf - Set sg entry to point at given data
-
 
106
 * @sg:		 SG entry
-
 
107
 * @buf:	 Data
-
 
108
 * @buflen:	 Data length
-
 
109
 *
-
 
110
 **/
-
 
111
//static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
-
 
112
//                 unsigned int buflen)
-
 
113
//{
-
 
114
//   sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
-
 
115
//}
-
 
116
 
103
 
117
/*
104
/*
118
 * Loop over each sg element, following the pointer to a new list if necessary
105
 * Loop over each sg element, following the pointer to a new list if necessary
119
 */
106
 */
120
#define for_each_sg(sglist, sg, nr, __i)	\
107
#define for_each_sg(sglist, sg, nr, __i)	\
Line 224... Line 211...
224
void sg_init_one(struct scatterlist *, const void *, unsigned int);
211
void sg_init_one(struct scatterlist *, const void *, unsigned int);
Line 225... Line 212...
225
 
212
 
226
typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t);
213
typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t);
Line 227... Line 214...
227
typedef void (sg_free_fn)(struct scatterlist *, unsigned int);
214
typedef void (sg_free_fn)(struct scatterlist *, unsigned int);
228
 
215
 
229
void __sg_free_table(struct sg_table *, unsigned int, sg_free_fn *);
216
void __sg_free_table(struct sg_table *, unsigned int, bool, sg_free_fn *);
230
void sg_free_table(struct sg_table *);
217
void sg_free_table(struct sg_table *);
231
int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t,
218
int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int,
232
		     sg_alloc_fn *);
219
		     struct scatterlist *, gfp_t, sg_alloc_fn *);
233
int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
220
int sg_alloc_table(struct sg_table *, unsigned int, gfp_t);
234
int sg_alloc_table_from_pages(struct sg_table *sgt,
221
int sg_alloc_table_from_pages(struct sg_table *sgt,
235
	struct page **pages, unsigned int n_pages,
222
	struct page **pages, unsigned int n_pages,
Line 239... Line 226...
239
size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
226
size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
240
			   void *buf, size_t buflen);
227
			   void *buf, size_t buflen);
241
size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
228
size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
242
			 void *buf, size_t buflen);
229
			 void *buf, size_t buflen);
Line -... Line 230...
-
 
230
 
-
 
231
size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents,
-
 
232
			    void *buf, size_t buflen, off_t skip);
-
 
233
size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents,
-
 
234
			  void *buf, size_t buflen, off_t skip);
243
 
235
 
244
/*
236
/*
245
 * Maximum number of entries that will be allocated in one piece, if
237
 * Maximum number of entries that will be allocated in one piece, if
246
 * a list larger than this is required then chaining will be utilized.
238
 * a list larger than this is required then chaining will be utilized.
247
 */
239
 */