register struct inode *rip;
bit_t b;
ino_t i_num;
+ int print_oos_msg = 1;
b = alloc_bit();
if (b == NO_BIT) {
err_code = ENOSPC;
- printf("PipeFS is out of inodes\n");
+ if (print_oos_msg)
+ printf("PipeFS is out of inodes\n");
+ print_oos_msg = 0; /* Don't repeat message */
return(NULL);
}
i_num = (ino_t) b;
+ print_oos_msg = 1;
/* Try to acquire a slot in the inode table. */
register struct inode *rip;
register struct super_block *sp;
- int major, minor, inumb;
+ int inumb;
bit_t b;
+ static int print_oos_msg = 1;
sp = get_super(parent->i_dev); /* get pointer to super_block */
if (sp->s_rd_only) { /* can't allocate an inode on a read only device. */
b = alloc_inode_bit(sp, parent, (bits & I_TYPE) == I_DIRECTORY);
if (b == NO_BIT) {
err_code = ENOSPC;
- major = (int) (sp->s_dev >> MAJOR) & BYTE;
- minor = (int) (sp->s_dev >> MINOR) & BYTE;
- ext2_debug("Out of i-nodes on device %d/%d\n", major, minor);
+ if (print_oos_msg)
+ ext2_debug("Out of i-nodes on device %d/%d\n",
+ major(sp->s_dev), minor(sp->s_dev));
+ print_oos_msg = 0; /* Don't repeat message */
return(NULL);
}
+ print_oos_msg = 1;
inumb = (int) b; /* be careful not to pass unshort as param */
wipe_inode(rip);
}
- return(rip);
+ return(rip);
}
{
/* Allocate a new zone on the indicated device and return its number. */
- int major, minor;
bit_t b, bit;
struct super_block *sp;
+ static int print_oos_msg = 1;
/* Note that the routine alloc_bit() returns 1 for the lowest possible
* zone, which corresponds to sp->s_firstdatazone. To convert a value
b = alloc_bit(sp, ZMAP, bit);
if (b == NO_BIT) {
err_code = ENOSPC;
- major = (int) (sp->s_dev >> MAJOR) & BYTE;
- minor = (int) (sp->s_dev >> MINOR) & BYTE;
- printf("No space on device %d/%d\n", major, minor);
+ if (print_oos_msg)
+ printf("No space on device %d/%d\n", major(sp->s_dev),
+ minor(sp->s_dev));
+ print_oos_msg = 0; /* Don't repeat message */
return(NO_ZONE);
}
+ print_oos_msg = 1;
if (z == sp->s_firstdatazone) sp->s_zsearch = b; /* for next time */
return( (zone_t) (sp->s_firstdatazone - 1) + (zone_t) b);
}