~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to fs/dcache.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
296
296
        __releases(parent->d_lock)
297
297
        __releases(dentry->d_inode->i_lock)
298
298
{
299
 
        dentry->d_parent = NULL;
300
299
        list_del(&dentry->d_u.d_child);
 
300
        /*
 
301
         * Inform try_to_ascend() that we are no longer attached to the
 
302
         * dentry tree
 
303
         */
 
304
        dentry->d_flags |= DCACHE_DISCONNECTED;
301
305
        if (parent)
302
306
                spin_unlock(&parent->d_lock);
303
307
        dentry_iput(dentry);
1012
1016
}
1013
1017
 
1014
1018
/*
 
1019
 * This tries to ascend one level of parenthood, but
 
1020
 * we can race with renaming, so we need to re-check
 
1021
 * the parenthood after dropping the lock and check
 
1022
 * that the sequence number still matches.
 
1023
 */
 
1024
static struct dentry *try_to_ascend(struct dentry *old, int locked, unsigned seq)
 
1025
{
 
1026
        struct dentry *new = old->d_parent;
 
1027
 
 
1028
        rcu_read_lock();
 
1029
        spin_unlock(&old->d_lock);
 
1030
        spin_lock(&new->d_lock);
 
1031
 
 
1032
        /*
 
1033
         * might go back up the wrong parent if we have had a rename
 
1034
         * or deletion
 
1035
         */
 
1036
        if (new != old->d_parent ||
 
1037
                 (old->d_flags & DCACHE_DISCONNECTED) ||
 
1038
                 (!locked && read_seqretry(&rename_lock, seq))) {
 
1039
                spin_unlock(&new->d_lock);
 
1040
                new = NULL;
 
1041
        }
 
1042
        rcu_read_unlock();
 
1043
        return new;
 
1044
}
 
1045
 
 
1046
 
 
1047
/*
1015
1048
 * Search for at least 1 mount point in the dentry's subdirs.
1016
1049
 * We descend to the next level whenever the d_subdirs
1017
1050
 * list is non-empty and continue searching.
1066
1099
         * All done at this level ... ascend and resume the search.
1067
1100
         */
1068
1101
        if (this_parent != parent) {
1069
 
                struct dentry *tmp;
1070
 
                struct dentry *child;
1071
 
 
1072
 
                tmp = this_parent->d_parent;
1073
 
                rcu_read_lock();
1074
 
                spin_unlock(&this_parent->d_lock);
1075
 
                child = this_parent;
1076
 
                this_parent = tmp;
1077
 
                spin_lock(&this_parent->d_lock);
1078
 
                /* might go back up the wrong parent if we have had a rename
1079
 
                 * or deletion */
1080
 
                if (this_parent != child->d_parent ||
1081
 
                         (!locked && read_seqretry(&rename_lock, seq))) {
1082
 
                        spin_unlock(&this_parent->d_lock);
1083
 
                        rcu_read_unlock();
 
1102
                struct dentry *child = this_parent;
 
1103
                this_parent = try_to_ascend(this_parent, locked, seq);
 
1104
                if (!this_parent)
1084
1105
                        goto rename_retry;
1085
 
                }
1086
 
                rcu_read_unlock();
1087
1106
                next = child->d_u.d_child.next;
1088
1107
                goto resume;
1089
1108
        }
1181
1200
         * All done at this level ... ascend and resume the search.
1182
1201
         */
1183
1202
        if (this_parent != parent) {
1184
 
                struct dentry *tmp;
1185
 
                struct dentry *child;
1186
 
 
1187
 
                tmp = this_parent->d_parent;
1188
 
                rcu_read_lock();
1189
 
                spin_unlock(&this_parent->d_lock);
1190
 
                child = this_parent;
1191
 
                this_parent = tmp;
1192
 
                spin_lock(&this_parent->d_lock);
1193
 
                /* might go back up the wrong parent if we have had a rename
1194
 
                 * or deletion */
1195
 
                if (this_parent != child->d_parent ||
1196
 
                        (!locked && read_seqretry(&rename_lock, seq))) {
1197
 
                        spin_unlock(&this_parent->d_lock);
1198
 
                        rcu_read_unlock();
 
1203
                struct dentry *child = this_parent;
 
1204
                this_parent = try_to_ascend(this_parent, locked, seq);
 
1205
                if (!this_parent)
1199
1206
                        goto rename_retry;
1200
 
                }
1201
 
                rcu_read_unlock();
1202
1207
                next = child->d_u.d_child.next;
1203
1208
                goto resume;
1204
1209
        }
1607
1612
        __bit_spin_unlock(0, (unsigned long *)&tmp->d_sb->s_anon.first);
1608
1613
        spin_unlock(&tmp->d_lock);
1609
1614
        spin_unlock(&inode->i_lock);
 
1615
        security_d_instantiate(tmp, inode);
1610
1616
 
1611
1617
        return tmp;
1612
1618
 
1613
1619
 out_iput:
 
1620
        if (res && !IS_ERR(res))
 
1621
                security_d_instantiate(res, inode);
1614
1622
        iput(inode);
1615
1623
        return res;
1616
1624
}
2942
2950
                spin_unlock(&dentry->d_lock);
2943
2951
        }
2944
2952
        if (this_parent != root) {
2945
 
                struct dentry *tmp;
2946
 
                struct dentry *child;
2947
 
 
2948
 
                tmp = this_parent->d_parent;
 
2953
                struct dentry *child = this_parent;
2949
2954
                if (!(this_parent->d_flags & DCACHE_GENOCIDE)) {
2950
2955
                        this_parent->d_flags |= DCACHE_GENOCIDE;
2951
2956
                        this_parent->d_count--;
2952
2957
                }
2953
 
                rcu_read_lock();
2954
 
                spin_unlock(&this_parent->d_lock);
2955
 
                child = this_parent;
2956
 
                this_parent = tmp;
2957
 
                spin_lock(&this_parent->d_lock);
2958
 
                /* might go back up the wrong parent if we have had a rename
2959
 
                 * or deletion */
2960
 
                if (this_parent != child->d_parent ||
2961
 
                         (!locked && read_seqretry(&rename_lock, seq))) {
2962
 
                        spin_unlock(&this_parent->d_lock);
2963
 
                        rcu_read_unlock();
 
2958
                this_parent = try_to_ascend(this_parent, locked, seq);
 
2959
                if (!this_parent)
2964
2960
                        goto rename_retry;
2965
 
                }
2966
 
                rcu_read_unlock();
2967
2961
                next = child->d_u.d_child.next;
2968
2962
                goto resume;
2969
2963
        }