Skip to content

Commit

Permalink
chimera: rename FsSqlDriver#removeTag into removeAllTags
Browse files Browse the repository at this point in the history
Motivation:
Confusing name. As method is only used by driver internally, makes no
sense to have it the public API.

Modification:
Rename FsSqlDriver#removeTag(FsInode inode) to FsSqlDriver#removeAllTags(FsInode).
Remove removeTag from the  FileSystemProvider public interface.

Result:
same functionality, less confusion.

Fixes: #7277
Acked-by: Albert Rossi
Acked-by: Paul Millar
Target: master
Require-book: no
Require-notes: no
  • Loading branch information
kofemann committed Aug 8, 2023
1 parent 77c2dd6 commit a848b94
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ int setTag(FsInode inode, String tagName, byte[] data,
void removeTag(FsInode dir, String tagName)
throws ChimeraFsException;

void removeTag(FsInode dir) throws ChimeraFsException;

int getTag(FsInode inode, String tagName, byte[] data,
int offset, int len) throws ChimeraFsException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private boolean removeDir(FsInode parent, FsInode inode, String name)
// ensure that t_inodes and t_tags_inodes updated in the same order as
// in mkdir
decNlink(parent);
removeTag(inode);
removeAllTags(inode);

if (!removeInodeIfUnlinked(inode, true)) {
throw new DirNotEmptyChimeraFsException("directory is not empty");
Expand Down Expand Up @@ -350,7 +350,7 @@ void remove(FsInode inode) throws DirNotEmptyChimeraFsException {

boolean isDir = inode.isDirectory();
if (isDir) {
removeTag(inode);
removeAllTags(inode);
}

for (Long parent : parents) {
Expand Down Expand Up @@ -1309,7 +1309,7 @@ void removeTag(FsInode dir, String tag) {
}
}

void removeTag(FsInode dir) {
protected void removeAllTags(FsInode dir) {
/* Get the name of the tags to be removed.
*/
_jdbc.queryForList("SELECT itagname FROM t_tags WHERE inumber=?", String.class, dir.ino())
Expand Down
8 changes: 0 additions & 8 deletions modules/chimera/src/main/java/org/dcache/chimera/JdbcFs.java
Original file line number Diff line number Diff line change
Expand Up @@ -1281,14 +1281,6 @@ public void removeTag(FsInode dir, String tagName) throws ChimeraFsException {
});
}

@Override
public void removeTag(FsInode dir) throws ChimeraFsException {
inTransaction(status -> {
_sqlDriver.removeTag(dir);
return null;
});
}

@Override
public int getTag(FsInode inode, String tagName, byte[] data, int offset, int len)
throws ChimeraFsException {
Expand Down

0 comments on commit a848b94

Please sign in to comment.