| .. | .. |
|---|
| 32 | 32 | |
|---|
| 33 | 33 | static void ceph_fl_copy_lock(struct file_lock *dst, struct file_lock *src) |
|---|
| 34 | 34 | { |
|---|
| 35 | | - struct ceph_file_info *fi = dst->fl_file->private_data; |
|---|
| 36 | 35 | struct inode *inode = file_inode(dst->fl_file); |
|---|
| 37 | 36 | atomic_inc(&ceph_inode(inode)->i_filelock_ref); |
|---|
| 38 | | - atomic_inc(&fi->num_locks); |
|---|
| 39 | 37 | } |
|---|
| 40 | 38 | |
|---|
| 41 | 39 | static void ceph_fl_release_lock(struct file_lock *fl) |
|---|
| 42 | 40 | { |
|---|
| 43 | | - struct ceph_file_info *fi = fl->fl_file->private_data; |
|---|
| 44 | 41 | struct inode *inode = file_inode(fl->fl_file); |
|---|
| 45 | 42 | struct ceph_inode_info *ci = ceph_inode(inode); |
|---|
| 46 | | - atomic_dec(&fi->num_locks); |
|---|
| 47 | 43 | if (atomic_dec_and_test(&ci->i_filelock_ref)) { |
|---|
| 48 | 44 | /* clear error when all locks are released */ |
|---|
| 49 | 45 | spin_lock(&ci->i_ceph_lock); |
|---|