~ubuntu-branches/ubuntu/trusty/linux-linaro-omap/trusty

« back to all changes in this revision

Viewing changes to fs/ceph/locks.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-57i0gl3v99b3lkfg
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        req = ceph_mdsc_create_request(mdsc, operation, USE_AUTH_MDS);
24
24
        if (IS_ERR(req))
25
25
                return PTR_ERR(req);
26
 
        req->r_inode = igrab(inode);
 
26
        req->r_inode = inode;
 
27
        ihold(inode);
27
28
 
28
29
        /* mds requires start and length rather than start and end */
29
30
        if (LLONG_MAX == fl->fl_end)
32
33
                length = fl->fl_end - fl->fl_start + 1;
33
34
 
34
35
        dout("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, "
35
 
             "length: %llu, wait: %d, type`: %d", (int)lock_type,
 
36
             "length: %llu, wait: %d, type: %d", (int)lock_type,
36
37
             (int)operation, (u64)fl->fl_pid, fl->fl_start,
37
38
             length, wait, fl->fl_type);
38
39
 
39
 
 
40
40
        req->r_args.filelock_change.rule = lock_type;
41
41
        req->r_args.filelock_change.type = cmd;
42
42
        req->r_args.filelock_change.pid = cpu_to_le64((u64)fl->fl_pid);
70
70
        }
71
71
        ceph_mdsc_put_request(req);
72
72
        dout("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, "
73
 
             "length: %llu, wait: %d, type`: %d, err code %d", (int)lock_type,
 
73
             "length: %llu, wait: %d, type: %d, err code %d", (int)lock_type,
74
74
             (int)operation, (u64)fl->fl_pid, fl->fl_start,
75
75
             length, wait, fl->fl_type, err);
76
76
        return err;
109
109
                        dout("mds locked, locking locally");
110
110
                        err = posix_lock_file(file, fl, NULL);
111
111
                        if (err && (CEPH_MDS_OP_SETFILELOCK == op)) {
112
 
                                /* undo! This should only happen if the kernel detects
113
 
                                 * local deadlock. */
 
112
                                /* undo! This should only happen if
 
113
                                 * the kernel detects local
 
114
                                 * deadlock. */
114
115
                                ceph_lock_message(CEPH_LOCK_FCNTL, op, file,
115
116
                                                  CEPH_LOCK_UNLOCK, 0, fl);
116
 
                                dout("got %d on posix_lock_file, undid lock", err);
 
117
                                dout("got %d on posix_lock_file, undid lock",
 
118
                                     err);
117
119
                        }
118
120
                }
119
121
 
120
 
        } else {
121
 
                dout("mds returned error code %d", err);
 
122
        } else if (err == -ERESTARTSYS) {
 
123
                dout("undoing lock\n");
 
124
                ceph_lock_message(CEPH_LOCK_FCNTL, op, file,
 
125
                                  CEPH_LOCK_UNLOCK, 0, fl);
122
126
        }
123
127
        return err;
124
128
}
155
159
                                          file, CEPH_LOCK_UNLOCK, 0, fl);
156
160
                        dout("got %d on flock_lock_file_wait, undid lock", err);
157
161
                }
158
 
        } else {
159
 
                dout("mds error code %d", err);
 
162
        } else if (err == -ERESTARTSYS) {
 
163
                dout("undoing lock\n");
 
164
                ceph_lock_message(CEPH_LOCK_FLOCK,
 
165
                                  CEPH_MDS_OP_SETFILELOCK,
 
166
                                  file, CEPH_LOCK_UNLOCK, 0, fl);
160
167
        }
161
168
        return err;
162
169
}