View | Details | Raw Unified
Collapse All | Expand All

(-) a/drivers/char/n_tty.c (-2 / +2 lines)
 Lines 1143-1155    Link Here 
{
{
	int retval;
	int retval;
	ssize_t n;
	size_t n;
	unsigned long flags;
	unsigned long flags;
	retval = 0;
	retval = 0;
	spin_lock_irqsave(&tty->read_lock, flags);
	spin_lock_irqsave(&tty->read_lock, flags);
	n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail);
	n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail);
	n = min((ssize_t)*nr, n);
	n = min(*nr, n);
	spin_unlock_irqrestore(&tty->read_lock, flags);
	spin_unlock_irqrestore(&tty->read_lock, flags);
	if (n) {
	if (n) {
		mb();
		mb();
(-) a/fs/proc/generic.c (-1 / +1 lines)
 Lines 60-66    Link Here 
		return -ENOMEM;
		return -ENOMEM;
	while ((nbytes > 0) && !eof) {
	while ((nbytes > 0) && !eof) {
		count = min_t(ssize_t, PROC_BLOCK_SIZE, nbytes);
		count = min_t(size_t, PROC_BLOCK_SIZE, nbytes);
		start = NULL;
		start = NULL;
		if (dp->get_info) {
		if (dp->get_info) {
(-) a/fs/reiserfs/file.c (-12 / +11 lines)
 Lines 588-594    Link Here 
/* Unlock pages prepared by reiserfs_prepare_file_region_for_write */
/* Unlock pages prepared by reiserfs_prepare_file_region_for_write */
void reiserfs_unprepare_pages(struct page **prepared_pages, /* list of locked pages */
void reiserfs_unprepare_pages(struct page **prepared_pages, /* list of locked pages */
			      int num_pages /* amount of pages */) {
			      size_t num_pages /* amount of pages */) {
    int i; // loop counter
    int i; // loop counter
    for (i=0; i < num_pages ; i++) {
    for (i=0; i < num_pages ; i++) {
 Lines 619-625    Link Here 
    int offset; // offset in page
    int offset; // offset in page
    for ( i = 0, offset = (pos & (PAGE_CACHE_SIZE-1)); i < num_pages ; i++,offset=0) {
    for ( i = 0, offset = (pos & (PAGE_CACHE_SIZE-1)); i < num_pages ; i++,offset=0) {
	int count = min_t(int,PAGE_CACHE_SIZE-offset,write_bytes); // How much of bytes to write to this page
	size_t count = min_t(size_t,PAGE_CACHE_SIZE-offset,write_bytes); // How much of bytes to write to this page
	struct page *page=prepared_pages[i]; // Current page we process.
	struct page *page=prepared_pages[i]; // Current page we process.
	fault_in_pages_readable( buf, count);
	fault_in_pages_readable( buf, count);
 Lines 718-725    Link Here 
				struct reiserfs_transaction_handle *th,
				struct reiserfs_transaction_handle *th,
				struct inode *inode,
				struct inode *inode,
				loff_t pos, /* Writing position offset */
				loff_t pos, /* Writing position offset */
				int num_pages, /* Number of pages to write */
				size_t num_pages, /* Number of pages to write */
				int write_bytes, /* number of bytes to write */
				size_t write_bytes, /* number of bytes to write */
				struct page **prepared_pages /* list of pages */
				struct page **prepared_pages /* list of pages */
				)
				)
{
{
 Lines 854-862    Link Here 
static int reiserfs_prepare_file_region_for_write(
static int reiserfs_prepare_file_region_for_write(
				struct inode *inode /* Inode of the file */,
				struct inode *inode /* Inode of the file */,
				loff_t pos, /* position in the file */
				loff_t pos, /* position in the file */
				int num_pages, /* number of pages to
				size_t num_pages, /* number of pages to
					          prepare */
					          prepare */
				int write_bytes, /* Amount of bytes to be
				size_t write_bytes, /* Amount of bytes to be
						    overwritten from
						    overwritten from
						    @pos */
						    @pos */
				struct page **prepared_pages /* pointer to array
				struct page **prepared_pages /* pointer to array
 Lines 1252-1261    Link Here 
    while ( count > 0) {
    while ( count > 0) {
	/* This is the main loop in which we running until some error occures
	/* This is the main loop in which we running until some error occures
	   or until we write all of the data. */
	   or until we write all of the data. */
	int num_pages;/* amount of pages we are going to write this iteration */
	size_t num_pages;/* amount of pages we are going to write this iteration */
	int write_bytes; /* amount of bytes to write during this iteration */
	size_t write_bytes; /* amount of bytes to write during this iteration */
	int blocks_to_allocate; /* how much blocks we need to allocate for
	size_t blocks_to_allocate; /* how much blocks we need to allocate for this iteration */
				   this iteration */
        
        
        /*  (pos & (PAGE_CACHE_SIZE-1)) is an idiom for offset into a page of pos*/
        /*  (pos & (PAGE_CACHE_SIZE-1)) is an idiom for offset into a page of pos*/
	num_pages = !!((pos+count) & (PAGE_CACHE_SIZE - 1)) + /* round up partial
	num_pages = !!((pos+count) & (PAGE_CACHE_SIZE - 1)) + /* round up partial
 Lines 1269-1275    Link Here 
	    /* If we were asked to write more data than we want to or if there
	    /* If we were asked to write more data than we want to or if there
	       is not that much space, then we shorten amount of data to write
	       is not that much space, then we shorten amount of data to write
	       for this iteration. */
	       for this iteration. */
	    num_pages = min_t(int, REISERFS_WRITE_PAGES_AT_A_TIME, reiserfs_can_fit_pages(inode->i_sb));
	    num_pages = min_t(size_t, REISERFS_WRITE_PAGES_AT_A_TIME, reiserfs_can_fit_pages(inode->i_sb));
	    /* Also we should not forget to set size in bytes accordingly */
	    /* Also we should not forget to set size in bytes accordingly */
	    write_bytes = (num_pages << PAGE_CACHE_SHIFT) - 
	    write_bytes = (num_pages << PAGE_CACHE_SHIFT) - 
			    (pos & (PAGE_CACHE_SIZE-1));
			    (pos & (PAGE_CACHE_SIZE-1));
 Lines 1295-1301    Link Here 
	    // But overwriting files on absolutelly full volumes would not
	    // But overwriting files on absolutelly full volumes would not
	    // be very efficient. Well, people are not supposed to fill
	    // be very efficient. Well, people are not supposed to fill
	    // 100% of disk space anyway.
	    // 100% of disk space anyway.
	    write_bytes = min_t(int, count, inode->i_sb->s_blocksize - (pos & (inode->i_sb->s_blocksize - 1)));
	    write_bytes = min_t(size_t, count, inode->i_sb->s_blocksize - (pos & (inode->i_sb->s_blocksize - 1)));
	    num_pages = 1;
	    num_pages = 1;
	    // No blocks were claimed before, so do it now.
	    // No blocks were claimed before, so do it now.
	    reiserfs_claim_blocks_to_be_allocated(inode->i_sb, 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits));
	    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 
}
}
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,int size)
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,size_t size)
{
{
	unsigned long flags;
	unsigned long flags;
	struct atm_dev_addr *walk;
	struct atm_dev_addr *walk;
(-) a/net/atm/addr.h (-1 / +1 lines)
 Lines 13-18    Link Here 
void atm_reset_addr(struct atm_dev *dev);
void atm_reset_addr(struct atm_dev *dev);
int atm_add_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
int atm_add_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
int atm_del_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
int atm_del_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr);
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,int size);
int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,size_t size);
#endif
#endif