Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 82141
Collapse All | Expand All

(-)a/drivers/char/n_tty.c (-2 / +2 lines)
Lines 1143-1155 Link Here
1143
1143
1144
{
1144
{
1145
	int retval;
1145
	int retval;
1146
	ssize_t n;
1146
	size_t n;
1147
	unsigned long flags;
1147
	unsigned long flags;
1148
1148
1149
	retval = 0;
1149
	retval = 0;
1150
	spin_lock_irqsave(&tty->read_lock, flags);
1150
	spin_lock_irqsave(&tty->read_lock, flags);
1151
	n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail);
1151
	n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail);
1152
	n = min((ssize_t)*nr, n);
1152
	n = min(*nr, n);
1153
	spin_unlock_irqrestore(&tty->read_lock, flags);
1153
	spin_unlock_irqrestore(&tty->read_lock, flags);
1154
	if (n) {
1154
	if (n) {
1155
		mb();
1155
		mb();
(-)a/fs/proc/generic.c (-1 / +1 lines)
Lines 60-66 Link Here
60
		return -ENOMEM;
60
		return -ENOMEM;
61
61
62
	while ((nbytes > 0) && !eof) {
62
	while ((nbytes > 0) && !eof) {
63
		count = min_t(ssize_t, PROC_BLOCK_SIZE, nbytes);
63
		count = min_t(size_t, PROC_BLOCK_SIZE, nbytes);
64
64
65
		start = NULL;
65
		start = NULL;
66
		if (dp->get_info) {
66
		if (dp->get_info) {
(-)a/fs/reiserfs/file.c (-12 / +11 lines)
Lines 588-594 Link Here
588
588
589
/* Unlock pages prepared by reiserfs_prepare_file_region_for_write */
589
/* Unlock pages prepared by reiserfs_prepare_file_region_for_write */
590
void reiserfs_unprepare_pages(struct page **prepared_pages, /* list of locked pages */
590
void reiserfs_unprepare_pages(struct page **prepared_pages, /* list of locked pages */
591
			      int num_pages /* amount of pages */) {
591
			      size_t num_pages /* amount of pages */) {
592
    int i; // loop counter
592
    int i; // loop counter
593
593
594
    for (i=0; i < num_pages ; i++) {
594
    for (i=0; i < num_pages ; i++) {
Lines 619-625 Link Here
619
    int offset; // offset in page
619
    int offset; // offset in page
620
620
621
    for ( i = 0, offset = (pos & (PAGE_CACHE_SIZE-1)); i < num_pages ; i++,offset=0) {
621
    for ( i = 0, offset = (pos & (PAGE_CACHE_SIZE-1)); i < num_pages ; i++,offset=0) {
622
	int count = min_t(int,PAGE_CACHE_SIZE-offset,write_bytes); // How much of bytes to write to this page
622
	size_t count = min_t(size_t,PAGE_CACHE_SIZE-offset,write_bytes); // How much of bytes to write to this page
623
	struct page *page=prepared_pages[i]; // Current page we process.
623
	struct page *page=prepared_pages[i]; // Current page we process.
624
624
625
	fault_in_pages_readable( buf, count);
625
	fault_in_pages_readable( buf, count);
Lines 718-725 Link Here
718
				struct reiserfs_transaction_handle *th,
718
				struct reiserfs_transaction_handle *th,
719
				struct inode *inode,
719
				struct inode *inode,
720
				loff_t pos, /* Writing position offset */
720
				loff_t pos, /* Writing position offset */
721
				int num_pages, /* Number of pages to write */
721
				size_t num_pages, /* Number of pages to write */
722
				int write_bytes, /* number of bytes to write */
722
				size_t write_bytes, /* number of bytes to write */
723
				struct page **prepared_pages /* list of pages */
723
				struct page **prepared_pages /* list of pages */
724
				)
724
				)
725
{
725
{
Lines 854-862 Link Here
854
static int reiserfs_prepare_file_region_for_write(
854
static int reiserfs_prepare_file_region_for_write(
855
				struct inode *inode /* Inode of the file */,
855
				struct inode *inode /* Inode of the file */,
856
				loff_t pos, /* position in the file */
856
				loff_t pos, /* position in the file */
857
				int num_pages, /* number of pages to
857
				size_t num_pages, /* number of pages to
858
					          prepare */
858
					          prepare */
859
				int write_bytes, /* Amount of bytes to be
859
				size_t write_bytes, /* Amount of bytes to be
860
						    overwritten from
860
						    overwritten from
861
						    @pos */
861
						    @pos */
862
				struct page **prepared_pages /* pointer to array
862
				struct page **prepared_pages /* pointer to array
Lines 1252-1261 Link Here
1252
    while ( count > 0) {
1252
    while ( count > 0) {
1253
	/* This is the main loop in which we running until some error occures
1253
	/* This is the main loop in which we running until some error occures
1254
	   or until we write all of the data. */
1254
	   or until we write all of the data. */
1255
	int num_pages;/* amount of pages we are going to write this iteration */
1255
	size_t num_pages;/* amount of pages we are going to write this iteration */
1256
	int write_bytes; /* amount of bytes to write during this iteration */
1256
	size_t write_bytes; /* amount of bytes to write during this iteration */
1257
	int blocks_to_allocate; /* how much blocks we need to allocate for
1257
	size_t blocks_to_allocate; /* how much blocks we need to allocate for this iteration */
1258
				   this iteration */
1259
        
1258
        
1260
        /*  (pos & (PAGE_CACHE_SIZE-1)) is an idiom for offset into a page of pos*/
1259
        /*  (pos & (PAGE_CACHE_SIZE-1)) is an idiom for offset into a page of pos*/
1261
	num_pages = !!((pos+count) & (PAGE_CACHE_SIZE - 1)) + /* round up partial
1260
	num_pages = !!((pos+count) & (PAGE_CACHE_SIZE - 1)) + /* round up partial
Lines 1269-1275 Link Here
1269
	    /* If we were asked to write more data than we want to or if there
1268
	    /* If we were asked to write more data than we want to or if there
1270
	       is not that much space, then we shorten amount of data to write
1269
	       is not that much space, then we shorten amount of data to write
1271
	       for this iteration. */
1270
	       for this iteration. */
1272
	    num_pages = min_t(int, REISERFS_WRITE_PAGES_AT_A_TIME, reiserfs_can_fit_pages(inode->i_sb));
1271
	    num_pages = min_t(size_t, REISERFS_WRITE_PAGES_AT_A_TIME, reiserfs_can_fit_pages(inode->i_sb));
1273
	    /* Also we should not forget to set size in bytes accordingly */
1272
	    /* Also we should not forget to set size in bytes accordingly */
1274
	    write_bytes = (num_pages << PAGE_CACHE_SHIFT) - 
1273
	    write_bytes = (num_pages << PAGE_CACHE_SHIFT) - 
1275
			    (pos & (PAGE_CACHE_SIZE-1));
1274
			    (pos & (PAGE_CACHE_SIZE-1));
Lines 1295-1301 Link Here
1295
	    // But overwriting files on absolutelly full volumes would not
1294
	    // But overwriting files on absolutelly full volumes would not
1296
	    // be very efficient. Well, people are not supposed to fill
1295
	    // be very efficient. Well, people are not supposed to fill
1297
	    // 100% of disk space anyway.
1296
	    // 100% of disk space anyway.
1298
	    write_bytes = min_t(int, count, inode->i_sb->s_blocksize - (pos & (inode->i_sb->s_blocksize - 1)));
1297
	    write_bytes = min_t(size_t, count, inode->i_sb->s_blocksize - (pos & (inode->i_sb->s_blocksize - 1)));
1299
	    num_pages = 1;
1298
	    num_pages = 1;
1300
	    // No blocks were claimed before, so do it now.
1299
	    // No blocks were claimed before, so do it now.
1301
	    reiserfs_claim_blocks_to_be_allocated(inode->i_sb, 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits));
1300
	    reiserfs_claim_blocks_to_be_allocated(inode->i_sb, 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits));
(-)a/net/atm/addr.c (-1 / +1 lines)
Lines 114-120 Link Here
114
}
114
}
115
115
116
116
117
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,int size)
117
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,size_t size)
118
{
118
{
119
	unsigned long flags;
119
	unsigned long flags;
120
	struct atm_dev_addr *walk;
120
	struct atm_dev_addr *walk;
(-)a/net/atm/addr.h (-1 / +1 lines)
Lines 13-18 Link Here
13
void atm_reset_addr(struct atm_dev *dev);
13
void atm_reset_addr(struct atm_dev *dev);
14
int atm_add_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
14
int atm_add_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
15
int atm_del_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
15
int atm_del_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
16
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,int size);
16
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,size_t size);
17
17
18
#endif
18
#endif

Return to bug 82141