~ubuntu-branches/ubuntu/maverick/util-linux/maverick-proposed

« back to all changes in this revision

Viewing changes to shlibs/blkid/src/probe.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2010-03-22 17:35:40 UTC
  • mfrom: (1.6.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100322173540-sm083tdtvne1wa5w
Tags: 2.17.2-0ubuntu1
* Merge from Debian experimental, remaining changes:
  - Since udev is required in Ubuntu, the hwclock.sh init script is
    not called on startup and the hwclockfirst.sh init script is
    removed.
  - Use wildcards for symbols file, since they use versioned symbols
    properly.
  - Remove /etc/adjtime on upgrade if it was not used.
  - Install custom blkid.conf to use /dev/.blkid.tab since we don't
    expect device names to survive a reboot
  - No lsb_release call in mount.preinst since we'd need Pre-Depends
    (LP: #383697).
  - Do not install initramfs hook, since our initramfs already handles
    including blkid.
  - Mention mountall(8) in fstab(5) manpages, along with its special
    options.

* For the case where mount is called with a directory to mount, look
  that directory up in mountall's /lib/init/fstab if we couldn't find
  it mentioned anywhere else.  This means "mount /proc", "mount /sys",
  etc. work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
{
290
290
        int rc;
291
291
 
292
 
        if (!pr && !chn)
 
292
        if (!pr || !chn)
293
293
                return NULL;
294
294
 
295
295
        pr->cur_chain = chn;
465
465
        struct list_head *p;
466
466
        struct blkid_bufinfo *bf = NULL;
467
467
 
 
468
        if (pr->size <= 0)
 
469
                return NULL;
 
470
 
468
471
        list_for_each(p, &pr->buffers) {
469
472
                struct blkid_bufinfo *x =
470
473
                                list_entry(p, struct blkid_bufinfo, bufs);
566
569
                close(pr->fd);
567
570
 
568
571
        pr->flags &= ~BLKID_PRIVATE_FD;
 
572
        pr->flags &= ~BLKID_TINY_DEV;
569
573
        pr->fd = fd;
570
574
        pr->off = off;
571
575
        pr->size = 0;
605
609
                pr->size -= pr->off;
606
610
        }
607
611
 
608
 
        if (!pr->size)
609
 
                goto err;
610
 
        DBG(DEBUG_LOWPROBE, printf("ready for low-probing, offset=%zd, size=%zd\n",
 
612
        DBG(DEBUG_LOWPROBE, printf("ready for low-probing, offset=%jd, size=%jd\n",
611
613
                                pr->off, pr->size));
612
614
 
613
615
        if (pr->size <= 1440 * 1024 && !S_ISCHR(pr->mode))
648
650
 
649
651
        pr->off = off;
650
652
        pr->size = size;
 
653
        pr->flags &= ~BLKID_TINY_DEV;
 
654
 
 
655
        if (pr->size <= 1440 * 1024 && !S_ISCHR(pr->mode))
 
656
                pr->flags |= BLKID_TINY_DEV;
651
657
 
652
658
        blkid_probe_reset_buffer(pr);
653
659