code: Buffer pinNew(String fileName, PageFormatter fmtr) {
  		// Only the txs acquiring to append the block on the same file will be blocked
  		synchronized (prepareAnchor(fileName)) {
  			
  			// Choose Unpinned Buffer
  			int lastReplacedBuff = this.lastReplacedBuff;
  			int currBlk = (lastReplacedBuff + 1) % bufferPool.length;
  			while (currBlk != lastReplacedBuff) {
  				Buffer buff = bufferPool[currBlk];
  				
  				// Get the lock of buffer if it is free
  				if (buff.getExternalLock().tryLock()) {
  					try {
  						if (!buff.isPinned()) {
  							this.lastReplacedBuff = currBlk;
  							
  							// Swap
  							BlockId oldBlk = buff.block();
  							if (oldBlk != null)
  								blockMap.remove(oldBlk);
  							buff.assignToNew(fileName, fmtr);
  							blockMap.put(buff.block(), buff);
  							if (!buff.isPinned())
  								numAvailable.decrementAndGet();
  							
  							// Pin this buffer
  							buff.pin();
  							return buff;
  						}
  					} finally {
  						// Release the lock of buffer
  						buff.getExternalLock().unlock();
  					}
  				}
  				currBlk = (currBlk + 1) % bufferPool.length;
  			}
  			return null;
  		}
  	}
docs: Allocates a new block in the specified file, and pins a buffer to it.
  Returns null (without allocating the block) if there are no available
  buffers.
  
  @param fileName
  the name of the file
  @param fmtr
  a pageformatter object, used to format the new block
  @return the pinned buffer