[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH/RFC] Simplify implementation of lock / unlock operations in FSFS

From: Sergey Raevskiy <sergey.raevskiy_at_visualsvn.com>
Date: Wed, 11 Feb 2015 19:51:27 +0300

Hi!

Recently I've spent some time investigating how lock and unlock are implemented
in FSFS and can suggest the following simplification. I attempted just to make
this part clearer and a new code is intended to behave exactly the same.

The patch is attached.

Log message:
[[[
Simplify implementation of svn_fs_fs__lock() / svn_fs_fs__unlock().

* subversion/libsvn_fs_fs/lock.c
  (schedule_index_update): New helper function.
  (struct lock_info_t,
   struct unlock_info_t): Drop the unused fields.
  (lock_body,
   unlock_body): Rework the algorithm.
]]]

PS. I've noticed at least one improper pool usage in locking code:
[[[
info->lock = svn_lock_create(lb->result_pool);

...

info->lock->path = info->path;
info->lock->owner = lb->fs->access_ctx->username;
info->lock->comment = lb->comment;
info->lock->is_dav_comment = lb->is_dav_comment;
info->lock->creation_date = apr_time_now();
info->lock->expiration_date = lb->expiration_date;
]]]

The svn_lock_t * object is created in the result_pool, but its fields like PATH
and OWNER are not getting apr_pstrdup()'ed. I'm going to fix this in another
patch.

Received on 2015-02-11 17:51:54 CET

This is an archived mail posted to the Subversion Dev mailing list.