r=adilger,vitaly
Properly find out duplicate locks when comparing newly receiwed server locks.
mds_open cannot use accmode because it is affected by owneroverride flag
this allows us to quickly find what pages to write and remove
once lock callback is received.
+Severity : normal
+Bugzilla : 14379
+Description: Too many locks accumulating on client during NFS usage
+Details : mds_open improperly used accmode to find out access mode to a
+ file. Also mdc_intent_lock logic to find out if we already have
+ lock similar to just received was flawed since introduction of
+ skiplists - locks are now added to the front of the granted
+ queue.
+
--------------------------------------------------------------------------------
2007-12-07 Cluster File Systems, Inc. <info@clusterfs.com>
lock = list_entry(tmp, struct ldlm_lock, l_res_link);
if (lock == old_lock)
- break;
+ continue;
/* llite sometimes wants to match locks that will be
* canceled when their users drop, but we allow it to match
/* We cannot use acc_mode here, because it is zeroed in case of
creating a file, so we get wrong lockmode */
- if (accmode(dchild->d_inode, rec->ur_flags) & MAY_WRITE)
+ if (rec->ur_flags & FMODE_WRITE)
child_mode = LCK_CW;
- else if (accmode(dchild->d_inode, rec->ur_flags) & MAY_EXEC)
+ else if (rec->ur_flags & MDS_FMODE_EXEC)
child_mode = LCK_PR;
else
child_mode = LCK_CR;