~ubuntu-branches/ubuntu/quantal/linux-ti-omap4/quantal-proposed

« back to all changes in this revision

Viewing changes to fs/sysfs/dir.c

  • Committer: Package Import Robot
  • Author(s): Brad Figg, Brad Figg
  • Date: 2013-06-08 09:09:23 UTC
  • Revision ID: package-import@ubuntu.com-20130608090923-ibtnp6edtrn3sxik
Tags: 3.5.0-226.39
[ Brad Figg ]

UBUNTU: Fixup missing abi files causing FTBS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1013
1013
        enum kobj_ns_type type;
1014
1014
        const void *ns;
1015
1015
        ino_t ino;
 
1016
        loff_t off;
1016
1017
 
1017
1018
        type = sysfs_ns_type(parent_sd);
1018
1019
        ns = sysfs_info(dentry->d_sb)->ns[type];
1035
1036
                        return 0;
1036
1037
        }
1037
1038
        mutex_lock(&sysfs_mutex);
 
1039
        off = filp->f_pos;
1038
1040
        for (pos = sysfs_dir_pos(ns, parent_sd, filp->f_pos, pos);
1039
1041
             pos;
1040
1042
             pos = sysfs_dir_next_pos(ns, parent_sd, filp->f_pos, pos)) {
1046
1048
                len = strlen(name);
1047
1049
                ino = pos->s_ino;
1048
1050
                type = dt_type(pos);
1049
 
                filp->f_pos = pos->s_hash;
 
1051
                off = filp->f_pos = pos->s_hash;
1050
1052
                filp->private_data = sysfs_get(pos);
1051
1053
 
1052
1054
                mutex_unlock(&sysfs_mutex);
1053
 
                ret = filldir(dirent, name, len, filp->f_pos, ino, type);
 
1055
                ret = filldir(dirent, name, len, off, ino, type);
1054
1056
                mutex_lock(&sysfs_mutex);
1055
1057
                if (ret < 0)
1056
1058
                        break;
1057
1059
        }
1058
1060
        mutex_unlock(&sysfs_mutex);
1059
 
        if ((filp->f_pos > 1) && !pos) { /* EOF */
1060
 
                filp->f_pos = INT_MAX;
 
1061
 
 
1062
        /* don't reference last entry if its refcount is dropped */
 
1063
        if (!pos) {
1061
1064
                filp->private_data = NULL;
 
1065
 
 
1066
                /* EOF and not changed as 0 or 1 in read/write path */
 
1067
                if (off == filp->f_pos && off > 1)
 
1068
                        filp->f_pos = INT_MAX;
1062
1069
        }
1063
1070
        return 0;
1064
1071
}